European Space Agency

European Space Agency

Royal Belgian Institute for Aeronomy

Royal Belgian Institute for Aeronomy

../_images/whiteSpace.png

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() and um520() respectively. Both subroutines modify the contents of the common block uc140 which is used by the subroutine um530() to evaluate the magnetic field vector at any geographic location. The subroutine um530() and subordinate subroutines use:

  • msun.utdeg and mext.vkp to evaluate the distance to the magnetopause;

  • mint.kinner, mint.norder, mint.coef and mint.saarot to evaluate the geomagnetic field;

  • mext.trans, mext.tilt, mext.kouter, mext.ikp, mext.wdens, mext.wvel and mext.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 and mint.coef of the common block uc140 can be easily modified by the users. The element mint.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 that mint.colat, mint.elong and mint.gmmo are evaluated in subroutine um510() from the elements (1,2), (2,1) and (2,2) of mint.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 in mext.trans. The transformation array can be directly evaluated by a call to the subroutines um522() and um523() or to the subroutines um522() and um524().

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 element g10. Note that the magnetic field dipole produced by the subroutine um510() when kint is set to 3 is different. The magnetic dipole of subroutine um510() is not aligned with the Earth’s axis; it includes the elements g10, g11 and h11.

      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
  • uc140, magnetic field description

  • um510(), select a geomagnetic field model

  • um520(), select an external magnetic field model

  • um515(), perform a Schmidt normalisation


UNILIB/tags/v3.02