T.03 - How to customize the magnetic field model used by the library ?¶
Answer¶
In the UNILIB library, the magnetic field model is defined by the selection of a geomagnetic field model (e.g. IGRF) and an external field model (e.g. Tsyganenko). These selections are made by a call to the subroutines
um510()
andum520()
respectively. Both subroutines modify the contents of the common blockuc140
which is used by the subroutineum530()
to evaluate the magnetic field vector at any geographic location. The subroutineum530()
and subordinate subroutines use:
msun.utdeg
andmext.vkp
to evaluate the distance to the magnetopause;
mint.kinner
,mint.norder
,mint.coef
andmint.saarot
to evaluate the geomagnetic field;
mext.trans
,mext.tilt
,mext.kouter
,mext.ikp
,mext.wdens
,mext.wvel
andmext.vdst
to evaluate the external magnetic field model.The magnetic field model can be customize by the user when the customisation includes only change of parameter values. For the internal part of the magnetic field model, the arguments
mint.norder
andmint.coef
of the common blockuc140
can be easily modified by the users. The elementmint.coef(i,j)
corresponds to
hj-1i when i<j;
gi-1j-1 otherwise.
The coefficients have to satisfy the Schmidt normalisation (except when
mint.kinner
is set to 4). Note thatmint.colat
,mint.elong
andmint.gmmo
are evaluated in subroutineum510()
from the elements (1,2), (2,1) and (2,2) ofmint.coef
.For the external part of the magnetic field model, the arguments used by the subroutine
um530()
are function of the model selected (mext.kouter
). The Tsyganenko models are expressed in the GSM coordinates while the other models use the SM coordinates. The transformation array from GEO coordinates to GSM or SM coordinates is stored inmext.trans
. The transformation array can be directly evaluated by a call to the subroutinesum522()
andum523()
or to the subroutinesum522()
andum524()
.
Illustration¶
In this illustration, the common block
uc140
is modified such that the magnetic field model corresponds to a centered magnetic field aligned with the Earth’s axis. The common block is initialized firstly to an IGRF magnetic field model. The spherical harmonic coefficients of the IGRF field are used to compute the elementg10
. Note that the magnetic field dipole produced by the subroutineum510()
whenkint
is set to 3 is different. The magnetic dipole of subroutineum510()
is not aligned with the Earth’s axis; it includes the elementsg10
,g11
andh11
.
PROGRAM faqt03
C
INCLUDE 'unilib.h'
C
COMMON /UC140/ mint, mext, msun
C
TYPE(zimf) mint
TYPE(zsun) msun
TYPE(zemf) mext
C
INTEGER*4 kunit, kinit, ifail, kint, kext
CHARACTER*32 lbint, lbext
REAL*8 year, param, amjd
C
C initialize variables
C
DATA kunit, kinit/ 6, 1/
DATA kint, kext/ 0, 0/
DATA year, amjd, param/ 1995.0d0, 0.0d0, 10*0.0d0/
C
C initialize the library
C
CALL UT990(kunit, kinit, ifail)
IF( ifail .LT. 0 ) STOP
C
C set the geomagnetic field model
C (kint=0, DGRF/IGRF)
C
C
CALL UM510(kint, year, lbint, kunit, ifail)
IF( ifail .LT. 0 ) STOP
C
C set the external magnetic field model
C (kext=0, none)
C
CALL UM520(kext, amjd, param, lbext, kunit, ifail)
IF( ifail .LT. 0 ) STOP
C
C restrict the geomagnetic field to its dipolar component
C and align the magnetic dipole with the Earths axis
C
mint%norder = 2
mint%label = 'Dipolar magnetic field '
mint%coef(2,1) = mint%gmmo * 1.0d+05
mint%coef(1,2) = 0.0d+00
mint%coef(2,2) = 0.0d+00
mint%elong = 0.0d+00
mint%colat = 0.0d+00
C
C To be followed by the user application
C
end
- See also
UNILIB/tags/v3.02