- 4

Trapped Radiation ENvironment model Development


[ Name | Synopsis | Arguments | Description | Diagnostics | Common Blocks | Dependencies | See Also | Reported Bugs | Examples ]


    Subroutine UD320 - evaluate a double time integral over a drift shell


      REAL*8    rpar2, result, rnorm, rdrift
      INTEGER*4 kpar1, ifail
      EXTERNAL  zsub

      CALL UD320 (kpar1, rpar2, zsub, result, rnorm, rdrift, ifail)     


    control parameter passed to zsub [in]
    control parameter passed to zsub [in]
    external subroutine (see note) [in]
    result of the integration [out]
    time integral of the unity [out]
    single time integral of the unity [out]
    Error flag (see diagnostics) [out]


    The subroutine UD320 is intended to average physical quantities over a magnetic drift shell. Before any call to this subroutine, a magnetic drift shell has to be traced with the help of subroutine UD310. As input, the subroutine accepts an external subroutine and two parameters to be passed to this subroutine. The synopsis of the subroutine is given in the note below and is similar to the synopsis of subroutine UD636. As result, the subroutine returns the value of the double time integral
    evaluated over the magnetic drift shell for the function provided by the subroutine zsub (argument result) and for the unity (argument rnorm). The average over the drift shell is given then by result/rnorm. In this equation, ds and dl are elements of length along the field line and along the azimuthal drift direction, respectively. The denominators of ds and dl are proportional to the parallel velocity and the drift velocity, respectively. Since the drift time between two neighbouring field lines depends weakly on the position on the field line, the last factor of the integrant is evaluated only once for each field line (at the local magnetic equator).

    The argument rdrift returns the value of the single time integral

    which is proportional to the drift period.


    The synopsis of the external subroutine has to be the following:
          INTEGER*4 kpar1, ifail
          REAL*8 rpar2, fct
          CALL ZSUB (kpar1, rpar2, mpos, mb, fct, ifail)
    where the arguments kpar1 and rpar2 are control parameters, the arguments mpos and mb are the geographic (geocentric) location and the magnetic field vector where the function has to be evaluated, respectively. The subroutine ZSUB has to return the value of the evaluated function in argument fct. The argument ifail can be used to flag errors in the subroutine zsub. When the subroutine returns a negative value for the argument ifail, the computation is aborted.

    One should note that the synopsis has changed between version 2.00 and 2.01 (see history). Moreover, since version 2.01, the entry UD322 allows an array for argument fct.


  • Hassitt, A., Average effect of the atmosphere on trapped protons, JGR 70 (1965) 5385-5394
  • Heynderickx, D., Kruglanski, M., and Lemaire, J.F., A new tool for calculating drift shell averaged atmospheric density, in "Radiation Belts: Models and Standards", AGU Monograph 97 (1996) 173-178


    The subroutine UD320 does not exist in version 1.05 and earlier. The subroutine UD320 has been completely reviewed in version 2.01, as well as subroutine UD321. The major effects are the addition of a special entry (UD322) and a modification of the synopsis of the zsub external subroutine. In version 2.00 and earlier, the synopsis is
          CALL ZSUB (kpar1, rpar2, mpos, fct, ifail)
    (Before version 2.01, the argument mb was not included; see note for details). Note that subroutine UA636 has been also adapted.


    -32001, invalid drift shell description
    -32002, invalid drift shell description

Common Blocks

    UC110, magnetic drift shell description
    UC120, magnetic field line description
    UC130, set of magnetic field line segments
    UC160, general constants


Called by



    UD321, evaluate a time integral over a magnetic field line
    zsub, external subroutine (see Note)

See also

    UD310, trace a magnetic drift shell
    UA636, evaluate a weighted atmospheric mass

Reported Bugs