Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- geomag

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
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.

    
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
Opens
         open (iu, file= mdfile, status='old', iostat=ios,
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

Coastal and Marine Science Centers:  Pacific   St. Petersburg   Woods Hole  
InfoBank   Coastal and Marine Geology Program   Geologic Information   Ask-A-Geologist   USGS Disclaimer  


Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://walrus.wr.usgs.gov/infobank/programs/mag/geomag/geomag.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:37:07 PDT 2013  (chd)