generate_distribution Program

Uses

  • program~~generate_distribution~~UsesGraph program~generate_distribution generate_distribution module~alps_distribution_analyt alps_distribution_analyt program~generate_distribution->module~alps_distribution_analyt

This program generates distribution files for input into ALPS based on pre-defined functions.


Calls

program~~generate_distribution~~CallsGraph program~generate_distribution generate_distribution dgamma dgamma program~generate_distribution->dgamma proc~distribution_analyt distribution_analyt program~generate_distribution->proc~distribution_analyt proc~read_in_params~2 read_in_params program~generate_distribution->proc~read_in_params~2 proc~get_indexed_namelist_unit~2 get_indexed_namelist_unit proc~read_in_params~2->proc~get_indexed_namelist_unit~2 proc~get_runname~3 get_runname proc~read_in_params~2->proc~get_runname~3 proc~get_unused_unit~3 get_unused_unit proc~read_in_params~2->proc~get_unused_unit~3 proc~spec_read~2 spec_read proc~read_in_params~2->proc~spec_read~2 proc~get_indexed_namelist_unit~2->proc~get_unused_unit~3 proc~input_unit_exist~3 input_unit_exist proc~get_indexed_namelist_unit~2->proc~input_unit_exist~3 proc~input_unit~3 input_unit proc~get_indexed_namelist_unit~2->proc~input_unit~3

Variables

Type Attributes Name Initial
integer :: iperp

Index to loop over perpendicular momentum.

integer :: ipar

Index to loop over parallel momentum.

integer :: nperp

Number of steps in perpendicular momentum.

integer :: npar

Number of steps in parallel momentum.

integer :: nspec

Total number of plasma species.

integer :: is

Index to loop over plasma species.

integer, dimension(:), allocatable :: unit_out

Index for unit for output. (1:nspec)

character(len=500) :: writeName

String for part of file name.

character(len=500) :: outputName

String for part of file name.

double precision :: dpperp

Inifinitesimal step in perpendicular momentum.

double precision :: dppar

Inifinitesimal step in parallel momentum.

double precision :: ppar_max

Maximum parallel momentum.

double precision :: pperp_max

Maximum perpendicular momentum.

double precision :: iperpcorr

Perpendicular correction .

double precision :: ifit_1

Ideal first fit parameter .

double precision :: ifit_2

Ideal second fit parameter .

double precision :: ifit_3

Ideal third fit parameter .

double precision :: ifit_4

Ideal fourth fit parameter .

double precision :: ifit_5

Ideal fifth fit parameter .

double precision :: ppar

Parallel momentum.

double precision :: pperp

Perpendicular momentum.

double precision :: f0

Distribution function.

double precision, dimension(:), allocatable :: ms

Mass of species. (1:nspec)

double precision, dimension(:), allocatable :: tau

Parallel temperature ratio of species. (1:nspec)

double precision, dimension(:), allocatable :: alph

Temperature anisotropy of species. (1:nspec)

double precision, dimension(:), allocatable :: p_drift

Drift momentum of species. (1:nspec)

double precision, dimension(:), allocatable :: kappa

Kappa index of species. (1:nspec)

double precision, dimension(:), allocatable :: maxPperp

Maximum perpendicular momentum of species. (1:nspec)

double precision, dimension(:), allocatable :: maxPpar

Maximum parallel momentum of species. (1:nspec)

logical, dimension (:), allocatable :: autoscale

Flag for autoscaling of grid for species. (1:nspec)

integer, dimension(:), allocatable :: distribution

Type of distribution for species. (1:nspec)

double precision :: beta

Plasma beta.

double precision :: vA

Ratio of Alfven speed to c.

double precision :: maxP

Maximum momentum.

double precision :: pi

Pi.

double precision :: integrate

Integration variable.

double precision :: norm

Normalisation factor for f0.

double precision :: a

Helper variable for parts of distributions.

double precision :: BESSK

Modified Bessel function.

double complex :: ppar_C

Complex version of parallel momentum.

integer :: unit

Unit for file i/o.

integer, parameter :: stdout_unit = 6

Flag for file i/o.

integer, save :: input_unit_no

Saved input unit for use with multiple read in calls.

integer, save :: error_unit_no = stdout_unit

Error output unit.

character(len=500) :: runname

String parameter for input file.


Functions

function input_unit_exist(nml, exist)

Determine if a particular namelist already opened.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: nml

Namelist to be opened.

logical, intent(out) :: exist

Determination if namelist is open.

Return Value integer

I/O dummy index.

function input_unit(nml)

Assigns input unit for namelist opening.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: nml

Namelist string.

Return Value integer

I/O dummy index.


Subroutines

subroutine read_in_params()

This subroutine reads in the parameters for the generation of distribution functions for ALPS.

Arguments

None

subroutine spec_read(is)

Subroutine for reading in species parameters.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: is

Species index.

subroutine get_indexed_namelist_unit(unit, nml, index_in)

Determines unused I/O unit.

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: unit

Unit to be defined.

character(len=*), intent(in) :: nml

Character string for namelist to be read in.

integer, intent(in) :: index_in

Index of namelist to be read in.

subroutine get_unused_unit(unit)

Determine unused number for I/O index.

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: unit

Unit to be assigned.

subroutine get_runname(runname)

Get runname for output files from input argument.

Arguments

Type IntentOptional Attributes Name
character(len=500), intent(out) :: runname

Basename for file I/O.