USGS InfoBank banner.  USGS, Coastal and Marine Geology, InfoBank banner.
 USGS Coastal and Marine Geology banner.    Search InfoBank.
USGS InfoBank program -- geomag Skip navigational links
    ________   ________   ______________   ________   _________   _______________   ________  
  tab edge  Home  tab edge  Data  tab edge  Activities  tab edge  FACS  tab edge  Atlas  tab edge  Definitions  tab edge  More  tab edge  
   
InfoBank Programs: by Name   by Data Type   General Tools   GIS   Plotting   Web   USGS Disclaimer   InfoBank Programs
   
Expanded description
Topic Description
Name
geomag
Synopsis
/infobank/programs/mag/geomag/geomag.for
Description
  Program to calculate the geomagnetic field values from
       a spherical harmonic model.
    
Comments
  Input required by the userer are:

       spherical harmonic model data file, coordinate preference,
       elevation, date, latitude, and longitude.


         Model data file :  Name of the data file containing the 
                            spherical harmonic coefficients of the 
                            chosen model.  The model specified  
                            must be in the current directory.

         Coordinate Preference:  By default, geodetic (measured from
                                 the surface of the earth), 
                                 or geocentric (measured from the
                                 center of the earth).

                    
         Elevation:  Elevation above sea level in kilometers. 
                     If geocentric coordinate preference is used then
                     the elevation must be in the range of
                     6370.20 km - 6971.20 km as measured from the 
                     center of the earth. Enter elevation in kilometers 
                     in the form xxxx.xx .

         Date:  Date, in decimal years, for which to calculate the 
                values of the magnetic field.  The date must be within
                the limits of the model chosen.

         Latitude:  Entered in decimal degrees in the form xxx.xxx .
                    Positive for northern hemisphere, negative for
                    the southern hemisphere.

         Longitude: Entered in decimal degrees in the form xxxx.xxx .
                    Positive for eastern hemisphere, negative for 
                    western hemisphere.

    
Opens
    open (iu, file= mdfile, status='old', iostat=ios,
    
Reads
    read (*, '(a20)') mdfile
    read (iu, rec=nrec, err=999) inarray 
      read (inarray, 45) model(l), epoch(l), (max(j,l),j=1,3),
    read (*, '(i1)') igdgc
      read (*, '(a1,f7.2)') ans, elev
    read (*,'(a1)')ans
    read (*,'(f7.2)') date
    read (*,'(i4)') iyear
    read (*,'(i2)') imnth
    read (*,'(i2)') iday
    read (*,'(a1)')ans
    read (*,'(i4)') inlat
    read (*,'(i3)') inmin
    read (*,'(i3)') insec
    read (*,'(i4)') inlon
    read (*,'(i3)') ilmin
    read (*,'(i3)') ilsec
    read (*,'(f7.3)') flat
    read (*,'(f8.3)') flon
    read (*,'(a1)') ans
    read (*, '(i2)') n
   read (*, '(i2)')j
           read (iu, rec=nrec, iostat=ios, err=55) irat
           read (irat, 40, iostat=ier, err=55) m, n, g, h
           read (iu, rec=nrec, iostat=ios, err=55) irat
           read (irat, 41, iostat=ier, err=55) m, n, g, h
    
Writes
    write (*,90) mdfile, ios 
      write (*,'(a9)') '  enter: '
      write (*,'(a9)') '  enter: '
    write (*,'(a9)') '  xxx.xxx'
    write (*,'(a10)') '  xxxx.xxx'
    write (*,15) elev,date,flat,flon,igdgc
  write (*, 19) date
      write (*,25) k,model(k),yrmin(k),yrmax(k),altmin(k),altmax(k)
   write (*,60) model(k), flat, flon, elev, date
   write (*, 66) d, i, h, x, y, z, f
   write (*, 70) ddot, idot, hdot, xdot, ydot, zdot, fdot
    
Calls
    call julday (iyear, imnth, iday, jyear)
       call getshc (iu, iflag, strec, nmax1, gh1, ios)
      call getshc (iu, iflag, strec, nmax2, gh2, ios)
      call interpsh (date, dte1, nmax1, gh1, dte2, nmax2,
      call interpsh (date+1., dte1, nmax1, gh1, dte2,
       call getshc (iu, iflag, strec, nmax1, gh1, ios)
       call getshc (iu, iflag, strec, nmax2, gh2, ios)
       call extrapsh (date, dte1, nmax1,gh1,
       call extrapsh (date+1., dte1, nmax1, gh1,
    call shval3 (igdgc, flat, flon, elev, erad, a2, b2,
    call dihf (x, y, z, d, i, h, f)
    call shval3 (igdgc, flat, flon, elev, erad, a2, b2,
    call dihf (xtemp, ytemp, ztemp, dtemp, itemp, htemp,
    

Skip footer navigational links

InfoBank   Menlo Park Center   Santa Cruz Center   St. Petersburg Center   Woods Hole Center   Coastal and Marine Geology Program  
 
U. S. Department of the Interior   U. S. Geological Survey   Geologic Information   Ask-A-Geologist   USGS privacy statement   Disclaimer  

URL: /infobank/programs/mag/geomag/geomag.doc.html
Maintainer: Clint Steele
Last modified: Fri Oct 11 03:10:22 PDT 2002  (wcs)