EIRAM
atomic and molecular data in form of polynomial fits
Data Types | Functions/Subroutines | Variables
eiram Module Reference

Data Types

type  eiram_data
 Data for one reaction. More...
 

Functions/Subroutines

subroutine, public eiram_load (filePath, fileName, err)
 Initialization of the module from input files (data sets) More...
 
subroutine, public eiram_deallocate (err)
 Deallocate dynamic arrays used by this module. More...
 
integer function, public eiram_get_id (fileName, reactionType, reactionIndex, err)
 Return the ID-index of the given reaction in the arrays of the module. More...
 
subroutine, public eiram_get_order (N, M, Id, err)
 Return order of the polynomial for both variables. More...
 
subroutine, public eiram_create_image (data, err)
 Create a copy (image) of the reactions array stored in the module. More...
 
real(eiram_dp) function, public eiram_calc1_fast (Id, lnX)
 Calculate single polynomial fit: scalar version W/O CHECKS. More...
 
subroutine, public eiram_calc1 (Y, Id, lnX, err)
 Calculate single polynomial fit. More...
 
subroutine, public eiram_calc12 (B, Id, lnX, err)
 Reduce double polynomial fit to single polynomials for given values of the second variable. More...
 
subroutine, public eiram_calc2 (Y, Id, LnX1, LnX2, err)
 Calculate double polynomial fit. More...
 

Variables

integer, parameter, public eiram_dp = SELECTED_REAL_KIND(13)
 Kind parameter for real numbers. More...
 
integer, public eiram_unit = 6
 Unit to which messages are written. More...
 
integer, parameter units_length =32
 Length of the string with units. More...
 
integer, parameter quantity_length =64
 Length of the string with description of a quantity. More...
 
integer, parameter reaction_length =128
 Length of the string with the reaction equation. More...
 
integer, parameter description_length =256
 Length of the string with description of the process. More...
 
integer, parameter, public eiram_file_name_length = 32
 Length of the string with a name of an input file. More...
 
integer, parameter, public eiram_type_length = 8
 Length of the string with reactiontype. More...
 
integer, parameter, public eiram_index_length = 16
 Length of the string with reaction index. More...
 
integer, parameter max_line_length = 256
 Maximum length of a line read from an file. More...
 
logical, parameter debug = .false.
 
external, public eiram_fit
 
integer, public eiram_nreact =0
 current number of loaded reactions More...
 
type(eiram_data), dimension(:), allocatable reactions
 Array of reactions. More...
 

Function/Subroutine Documentation

subroutine, public eiram::eiram_load ( character(*), intent(in)  filePath,
character(*), intent(in)  fileName,
integer, intent(out)  err 
)

Initialization of the module from input files (data sets)

This subroutine reads data from the files HYDHEL, AMJUEL etc. The subroutine can be called more than once - in this case the data loaded on the previous calls are appended

Error code 310 is returned if requested input file is not found

Parameters
[in]filepathFull path to the input file (w/o its name)
[in]filenameName of the input file
[out]errError code

number of read data sets

upper bound for number of data sets

Definition at line 206 of file eiram.f90.

References debug, eiram_nreact, eiram_unit, max_line_length, and reactions.

Referenced by eiram_load_wrapper(), eiram_test::eiram_test_calc12(), eiram_test::eiram_test_calculation(), eiram_test::eiram_test_image(), eiram_test::eiram_test_load(), eiram_test::eiram_test_unknown_reaction(), eiram_test::eiram_test_wrong_file(), eiram_test::eiram_test_wrong_ids(), eiram_test::eiram_test_wrong_size(), eiram_test::eiram_test_wrong_type(), initallfiles(), and mexfunction().

Here is the caller graph for this function:

subroutine, public eiram::eiram_deallocate ( integer, intent(out)  err)
integer function, public eiram::eiram_get_id ( character(*), intent(in)  fileName,
character(*), intent(in)  reactionType,
character(*), intent(in)  reactionIndex,
integer, intent(out)  err 
)

Return the ID-index of the given reaction in the arrays of the module.

This Id must be used then in eiram_calc

Parameters
[in]filenameName of the input file (dat set): HYDHEL, AMJUEl etc.
[in]reactiontypeType of the reaction: H.1, H.2 etc.
[in]reactionindexIndex of the reaction: 2.1.5 etc.
[out]errError code

Definition at line 857 of file eiram.f90.

References eiram_unit, and reactions.

Referenced by eiram_get_id_wrapper(), eiram_matlab_calc1(), eiram_matlab_calc2(), eiram_test::eiram_test_calc12(), eiram_test::eiram_test_calculation(), eiram_test::eiram_test_unknown_reaction(), eiram_test::eiram_test_used_uninitialized(), eiram_test::eiram_test_wrong_size(), and eiram_test::eiram_test_wrong_type().

Here is the caller graph for this function:

subroutine, public eiram::eiram_get_order ( integer, intent(out)  N,
integer, intent(out)  M,
integer, intent(in)  Id,
integer, intent(out)  err 
)

Return order of the polynomial for both variables.

Parameters
[out]nOrder of polynomial for X1
[out]mOrder of polynomial for X2
[in]idIndex of the reaction (returned by eiram_getId)
[out]errError code

Definition at line 895 of file eiram.f90.

References eiram_unit, and reactions.

Referenced by eiram_get_order_wrapper(), eiram_test::eiram_test_calc12(), and eiram_test::eiram_test_used_uninitialized().

Here is the caller graph for this function:

subroutine, public eiram::eiram_create_image ( type(eiram_data), dimension(:), allocatable  data,
integer, intent(out)  err 
)

Create a copy (image) of the reactions array stored in the module.

WARNING: array data which is already allocated will be overwritten. In case of error (err /= 0) not allocated array is returned

Parameters
dataResulting image of the module
[out]errError code

Definition at line 931 of file eiram.f90.

References eiram_unit, and reactions.

Referenced by eiram_test::eiram_test_image(), eiram_test::eiram_test_used_uninitialized(), and sendavailablereactions().

Here is the caller graph for this function:

real(eiram_dp) function, public eiram::eiram_calc1_fast ( integer, intent(in)  Id,
real(eiram_dp), intent(in)  lnX 
)

Calculate single polynomial fit: scalar version W/O CHECKS.

This function is intended for calculation of cross-sections during a Monte-Carlo particle tracing

Parameters
[in]idID of the reaction returned by eiram_getId
[in]lnxNatural logarithm of the argument

Definition at line 1042 of file eiram.f90.

References eiram_fit, and reactions.

Referenced by eiram_calc1_fast_wrapper().

Here is the caller graph for this function:

subroutine, public eiram::eiram_calc1 ( real(eiram_dp), dimension(:), intent(out)  Y,
integer, intent(in)  Id,
real(eiram_dp), dimension(:), intent(in)  lnX,
integer, intent(out)  err 
)

Calculate single polynomial fit.

Opposite to eiram_calc1_fast this subroutine performs checks and returns an array. It is indended for plotting and data analysis rather than for execution during a Monte-Carlo particle tracing

Parameters
[out]yArray of the results: Y(k) for each LnX(k)
[in]idID of the reaction returned by eiram_getId
[in]lnxNatural logarithm of the argument
[out]errError code

Definition at line 1060 of file eiram.f90.

References eiram_fit, eiram_unit, and reactions.

Referenced by eiram_calc1_wrapper(), eiram_matlab_calc1(), eiram_test::eiram_test_calculation(), eiram_test::eiram_test_used_uninitialized(), eiram_test::eiram_test_wrong_ids(), eiram_test::eiram_test_wrong_size(), and eiram_test::eiram_test_wrong_type().

Here is the caller graph for this function:

subroutine, public eiram::eiram_calc12 ( real(eiram_dp), dimension(:,:), intent(out)  B,
integer, intent(in)  Id,
real(eiram_dp), dimension(:), intent(in)  lnX,
integer, intent(out)  err 
)

Reduce double polynomial fit to single polynomials for given values of the second variable.

$ b_i = \sum^m_{j=0} a_{ji}\log^j{X_2} $

Then:

$ \log{Y} = \sum^n_{i=0} b_i\log^i{X_1} $

2nd dimension of B must be equal to the length of lnX, 1st dimension of B must be equal to the order of polynomial N plus 1. N is returned by eiram_get_order

This subroutine can be used e.g. in Monte-Carlo sampling for H.3 reactions. The background temperature is fixed and does not change. Coefficients B are calculated in advance for the temperatures in each cell. During the sampling the collision rate is calculated using the equation for $ \log{Y} $ above: with $ X_1 $ = energy of the test particle. eiram_fit can be used for that purpose

Parameters
[out]bCoefficients of the reduced fit $b_i$

1st index is $i$=0..N, 2nd index is k: lnX(k)

Parameters
[in]idID of the reaction returned by eiram_getId
[in]lnxNatural logarithm of the 2nd argument X2
[out]errError code

Definition at line 1142 of file eiram.f90.

References eiram_fit, eiram_unit, and reactions.

Referenced by eiram_calc12_wrapper(), eiram_test::eiram_test_calc12(), eiram_test::eiram_test_used_uninitialized(), eiram_test::eiram_test_wrong_ids(), eiram_test::eiram_test_wrong_size(), and eiram_test::eiram_test_wrong_type().

Here is the caller graph for this function:

subroutine, public eiram::eiram_calc2 ( real(eiram_dp), dimension(:), intent(out)  Y,
integer, intent(in)  Id,
real(eiram_dp), dimension(:), intent(in)  LnX1,
real(eiram_dp), dimension(:), intent(in)  LnX2,
integer, intent(out)  err 
)

Calculate double polynomial fit.

Lengths of Y and LnX2 must be equal. Length of LnX1 must be either equal to the length of Y, or equal to 1. In this latter case all Y are calculated for the same value of LnX1

Parameters
[out]yArray of the results: Y(k) for each pair (LnX1(k),LnX2(k))
[in]idID of the reaction returned by eiram_getId
[in]lnx1Natural logarithm of the 1st argument
[in]lnx2Natural logarithm of the 2nd argument
[out]errError code

Definition at line 1219 of file eiram.f90.

References eiram_fit, eiram_unit, and reactions.

Referenced by eiram_calc2_wrapper(), eiram_matlab_calc2(), eiram_test::eiram_test_calc12(), eiram_test::eiram_test_calculation(), eiram_test::eiram_test_used_uninitialized(), eiram_test::eiram_test_wrong_ids(), eiram_test::eiram_test_wrong_size(), and eiram_test::eiram_test_wrong_type().

Here is the caller graph for this function:

Variable Documentation

integer, parameter, public eiram::eiram_dp = SELECTED_REAL_KIND(13)

Kind parameter for real numbers.

Definition at line 110 of file eiram.f90.

integer, public eiram::eiram_unit = 6
integer, parameter eiram::units_length =32

Length of the string with units.

Definition at line 115 of file eiram.f90.

integer, parameter eiram::quantity_length =64

Length of the string with description of a quantity.

Definition at line 117 of file eiram.f90.

integer, parameter eiram::reaction_length =128

Length of the string with the reaction equation.

Definition at line 119 of file eiram.f90.

integer, parameter eiram::description_length =256

Length of the string with description of the process.

Definition at line 121 of file eiram.f90.

integer, parameter, public eiram::eiram_file_name_length = 32

Length of the string with a name of an input file.

Definition at line 123 of file eiram.f90.

Referenced by mexfunction().

integer, parameter, public eiram::eiram_type_length = 8

Length of the string with reactiontype.

Definition at line 125 of file eiram.f90.

Referenced by mexfunction().

integer, parameter, public eiram::eiram_index_length = 16

Length of the string with reaction index.

Definition at line 127 of file eiram.f90.

Referenced by mexfunction().

integer, parameter eiram::max_line_length = 256

Maximum length of a line read from an file.

Definition at line 129 of file eiram.f90.

Referenced by eiram_load().

logical, parameter eiram::debug = .false.

Definition at line 131 of file eiram.f90.

Referenced by eiram_deallocate(), and eiram_load().

real(eiram_dp), external, public eiram::eiram_fit
integer, public eiram::eiram_nreact =0

current number of loaded reactions

Definition at line 187 of file eiram.f90.

Referenced by eiram_deallocate(), eiram_load(), and eiram_test::eiram_test_load().

type(eiram_data), dimension(:), allocatable eiram::reactions