trm_type Derived Type

type, public :: trm_type

main class for the aep8 model


Inherited by

type~~trm_type~~InheritedByGraph type~trm_type trm_type type~radbelt_type radbelt_type type~radbelt_type->type~trm_type trm

Components

Type Visibility Attributes Name Initial
character(len=:), private, allocatable :: aep8_dir

directory containing the data files

character(len=:), private, allocatable :: file_loaded

the file that has been loaded

integer, private, dimension(8) :: ihead = 0
integer, private, dimension(:), allocatable :: map
real(kind=wp), private :: fistep = 0.0_wp

the stepsize for the parameterization of the logarithm of flux. formerly stored in common block tra2

real(kind=wp), private :: f1 = 1.001_wp
real(kind=wp), private :: f2 = 1.002_wp

Type-Bound Procedures

procedure, public :: aep8

main routine

  • private subroutine aep8(me, e, l, bb0, imname, flux)

    Main wrapper for the radiation model. Reads the coefficient file and calls the low-level routine.

    Arguments

    Type IntentOptional Attributes Name
    class(trm_type), intent(inout) :: me
    real(kind=wp), intent(in) :: e
    real(kind=wp), intent(in) :: l
    real(kind=wp), intent(in) :: bb0
    integer, intent(in) :: imname

    which model to load (index in mname array)

    real(kind=wp), intent(out) :: flux

procedure, public :: trara2

low-level routine

  • private function trara2(me, map, il, ib)

    trara2 interpolates linearly in l-b/b0-map to obtain the logarithm of integral flux at given l and b/b0.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(trm_type), intent(inout) :: me
    integer, intent(in) :: map(*)

    is sub-map (for specific energy) of trapped radiation model map

    integer, intent(in) :: il

    scaled l-value

    integer, intent(in) :: ib

    scaled b/b0-1

    Return Value real(kind=wp)

    scaled logarithm of particle flux

procedure, public :: trara1

  • private subroutine trara1(me, descr, map, fl, bb0, e, f, n)

    trara1 finds particle fluxes for given energies, magnetic field strength and l-value. function trara2 is used to interpolate in b-l-space.

    Arguments

    Type IntentOptional Attributes Name
    class(trm_type), intent(inout) :: me
    integer, intent(in) :: descr(8)

    header of specified trapped radition model

    integer, intent(in) :: map(*)

    map of trapped radition model (descr and map are explained at the begin of the main program model)

    real(kind=wp), intent(in) :: fl

    l-value

    real(kind=wp), intent(in) :: bb0

    =b/b0 magnetic field strength normalized to field strength at magnetic equator

    real(kind=wp), intent(in) :: e(n)

    array of energies in mev

    real(kind=wp), intent(out) :: f(n)

    decadic logarithm of integral fluxes in particles/(cmcmsec)

    integer, intent(in) :: n

    number of energies

procedure, public :: get_data_file_dir

  • private function get_data_file_dir(me) result(dir)

    Get the directory containing the data files.

    Arguments

    Type IntentOptional Attributes Name
    class(trm_type), intent(in) :: me

    Return Value character(len=:), allocatable

procedure, public :: set_data_file_dir

  • private subroutine set_data_file_dir(me, dir)

    Set the directory containing the data files.

    Arguments

    Type IntentOptional Attributes Name
    class(trm_type), intent(inout) :: me
    character(len=*), intent(in) :: dir

Source Code

    type, public :: trm_type
      !! main class for the `aep8` model
        private

        character(len=:), allocatable :: aep8_dir !! directory containing the data files

        ! data read from the files:
        character(len=:), allocatable :: file_loaded !! the file that has been loaded
        integer, dimension(8) :: ihead = 0
        integer, dimension(:), allocatable :: map

        real(wp) :: fistep = 0.0_wp !! the stepsize for the parameterization of the logarithm of flux.
                                  !! formerly stored in common block `tra2`

        ! formerly saved variables in trara1:
        real(wp) :: f1 = 1.001_wp
        real(wp) :: f2 = 1.002_wp

    contains
        private
        procedure, public :: aep8 !! main routine
        procedure, public :: trara1, trara2 !! low-level routine
        procedure, public :: set_data_file_dir, get_data_file_dir
    end type trm_type