Ex #1. Evaluation of the magnetic field vector¶
Description¶
Evaluation of the magnetic field vector at a given geographic location. The magnetic field is described by the combination of the DGRF/IGRF 1995 geomagnetic model and the Olson & Pfitzer dynamic model. The geographic location is provided in geodetic coordinates.
Source¶
PROGRAM example1
C
INCLUDE 'unilib.h'
C
INTEGER*4 kunit, kinit, ifail, kint, kext
CHARACTER*32 lbint, lbext
REAL*8 year, param(10)
TYPE(ZDAT) mdate
TYPE(ZGEO) mgeod, mpos
TYPE(ZVEC) mb
C
C initialize variables
C
DATA kunit, kinit/ 6, 1/
DATA kint, kext/ 0, 6/
DATA year, param/ 1995.d0, 0.d0, -30.d0, 0.d0, 25.d0, 300.d0,
: 0.d0, 0.d0, 0.d0, 0.d0, 0.d0/
C
C initialize the library
C
C
CALL UT990 (kunit, kinit, ifail)
IF( ifail .LT. 0 )STOP
C
C set the geomagnetic field model
C (kint=0, DGRF/IGRF)
C
CALL UM510 (kint, year, lbint, kunit, ifail)
IF( ifail .LT. 0 )STOP
C
C set date and time
C
mdate%iyear = 1995
mdate%imonth = 1
mdate%iday = 1
mdate%ihour = 0
mdate%imin = 0
mdate%secs = 0.0d0
C
C compute the modified julian day
C (based on January 1, 1950)
C
CALL UT540 (mdate)
C
C set the external magnetic field model
C (kext=6, Olson et Pfizer dynamic)
C
CALL UM520 (kext, mdate%amjd, param,
: lbext, kunit, ifail)
IF( ifail .LT. 0 )STOP
C
C set the geographic location
C
mgeod%radius = 300.0d0 + 6371.2d0
mgeod%colat = 120.0d0
mgeod%elong = 30.0d0
C
C convert from geodetic to geocentric
C
CALL UM536 (mgeod, mpos)
C
C evaluate the magnetic field vector
C
CALL UM530 (mpos, mb, ifail)
IF( ifail .LT. 0 )STOP
C
C write the result
C
WRITE(kunit,1000) mb%dnrm, mb%rho, mb%theta, mb%phi
C
1000 FORMAT(
: /'RESULT: magnetic field',/25x,
: 'norm =', g, ' Gauss',/,13x,
: 'radial component =', g, ' Gauss',/,13x
: 'along colatitude =', g, ' Gauss',/,14x
: 'along longitude =', g, ' Gauss' )
C
END
Results¶
SPENVIS
UNILIB Library
Version 2.22_YCH_initPrep
Generated by SPENVIS team
--- Main control parameters ---
UC160 (general constants):
Geoid major axis = 6378.16 km
Geoid minor axis = 6356.77 km
Mean Earth radius (Re) = 6371.20 km
Ecliptic inclination = 23.441512 deg
McIlwain Earth dipole = 0.311653 G/Re^3
UC190 (field line tracing):
Maximum step size = 477.8 km at one Re
Maximum "last" step size = 15.0 km
Minimum step size = 2.0 km
Altitude precision = 200. m
Magnetic field precision = 0.0006 %
UC192 (magnetic field evaluation):
Max. geomagnetic latitude = 85.0 deg
Minimum radius = 0.157 Re
(drift shell tracing):
Precision on L = 0.10000 %
Precision on the longitude = 0.05 deg
--- Geomagnetic field model ---
Model ( 0): DGRF 1995 Epoch 1995.
Order + 1 = 11
Calculation epoch = 1995.0 year
Colatitude of the dipole pole = 10.68 deg
Longitude of the dipole pole = -71.42 deg
Earth dipole moment = 0.302151 G/Re^3
Correction for the SAA drift = 0.00 deg
--- External magnetic field model ---
Model (6): Olson-Pfitzer dynamic
Storm activity index Dst = -30.0 nT
Solar wind density = 25.0 1/cm^3
Solar wind velocity = 300.0 km/s
Standoff distance = 8.6 Re
Planetary activity index Kp = 0.0 (magnetopause check)
Date = 01-Jan-1995
Universal Time = 0.00 hrs
Greenwich angle of equinox = 100.18 deg
GEO direction of the Sun, X = -0.9200
Y = -0.0129
Z = -0.3917
Dipole tilt angle = -25.91 deg
-------------------------
RESULT: magnetic field
norm = 2.567571783908246E-01 gauss
radial component = 2.283426241361413E-01 gauss
along colatitude = -1.097868129720019E-01 gauss
along longitude = -4.160228786123785E-02 gauss
-------------------------
UNILIB/tags/v3.02