tabulated_rate_module Module Reference

This module contains everything for the tabulated rates that can replace reaclib rates. More...

Data Types

type  tabulated_rate_type
 

Functions/Subroutines

subroutine, public init_tabulated_rates ()
 Initialize tabulated rates. More...
 
subroutine, private write_reac_verbose_out ()
 Write the verbose output of the reaction rates. More...
 
subroutine, public merge_tabulated_rates (rrate_array, rrate_length)
 Merge tabulated rates into larger rate array. More...
 
subroutine, public calculate_tab_rate (rrate, temp, rat_calc)
 Calculates the tabulated rate. More...
 
subroutine, public multiply_tab_rate_by_factor (rrate, factor)
 Multiply a tabulated rate by a factor. More...
 
subroutine, private readtabulatedtemps ()
 Reads tabulated reaction rate temperature grid. More...
 
subroutine, private readtabulated (sourcefile, cntTab)
 Reads tabulated reaction rates. More...
 
real(r_kind) function, private tabulated_inter (rate, temp)
 Interpolate tabulated rates from the table. More...
 
subroutine, public tabulated_index (temp)
 Set tab_index for a given temperature. More...
 
subroutine, public read_binary_tabulated_reaction_data (path)
 Read the tabulated rates from a unformatted binary file. More...
 
subroutine, public output_binary_tabulated_reaction_data (path)
 Save the theoretical tabulated rates to a unformatted binary file. More...
 

Variables

integer, private ntab
 number of tabulated rates (e.g. calculated with TALYS) More...
 
integer nt_tab
 number of temperature grid points, More...
 
logical, public tabulated
 switch for tabulated rates More...
 
integer, dimension(2), private tab_index
 Multi-index for the tabulated rates. More...
 
character(len= *), parameter, private tabulated_binary_name ='tabulated_rates.windat'
 Filename of binary file to save weak rates. More...
 
real(r_kind), dimension(:), allocatable, private temp_grid_tab
 
real(r_kind), dimension(30), private temp_grid_tab_default = (/1.0d-4,5.0d-4,1.0d-3,5.0d-3,1.0d-2,5.0d-2,1.0d-1,1.5d-1,2.0d-1,2.5d-1, 3.0d-1,4.0d-1,5.0d-1,6.0d-1,7.0d-1,8.0d-1,9.0d-1,1.0d+0,1.5d+0,2.0d+0, 2.5d+0,3.0d+0,3.5d+0,4.0d+0,5.0d+0,6.0d+0,7.0d+0,8.0d+0,9.0d+0,1.0d+1 /)
 default Temperature grid of tabulated reaction rates [GK] More...
 
type(reactionrate_type), dimension(:), allocatable, public rrates_tabulated
 array containing all tabulated reaction rates in rrate format More...
 
type(tabulated_rate_type), dimension(:), allocatable, private tabulated_rate
 array containing all tabulated reaction rates More...
 

Detailed Description

This module contains everything for the tabulated rates that can replace reaclib rates.

The tabulated rates were implemented by D. Martin. They replace all occurences of the corresponding reaclib rate (including resonances). It is useful to use rates that are, for example, output of the TALYS code.

Note
The temperature grid for the tabulated rates can be changed here.
See also
TALYS

Edited:

  • 17.07.22, M.R., made the maximum temperature grid points a variable (nt_tab)
  • 04.10.23 M. Jacobi : Tabulated rates of variable lenghts
Author
Moritz Reichert
Date
24.01.21

Function/Subroutine Documentation

◆ calculate_tab_rate()

subroutine, public tabulated_rate_module::calculate_tab_rate ( type(reactionrate_type), intent(in)  rrate,
real(r_kind), intent(in)  temp,
real(r_kind), intent(out)  rat_calc 
)

Calculates the tabulated rate.

This subroutine serves as an interface between the tabulated_rate_module and the jacobian class. It interpolates the rate on the grid and returns the rate value at a given temperature

Edited:

  • 26.07.22, MR: Created this subroutine to be in line with the other reaction rate types.
  • 04.10.23, MJ: Added support for flexible tabulated temperature grids
Parameters
[in]rraterate instance
[in]tempTemperature [GK]
[out]rat_calcrate value

Definition at line 190 of file tabulated_rate_module.f90.

Here is the call graph for this function:

◆ init_tabulated_rates()

subroutine, public tabulated_rate_module::init_tabulated_rates

Initialize tabulated rates.

This subroutine creates the shorthand flag "tabulated" to indicate that tabulated rates are used, reads and counts the tabulated rates

Author
Moritz Reichert
Date
24.01.21

Edited:

  • 04.10.23, M. Jacobi - support for flexible tabulated temperature grids

Definition at line 77 of file tabulated_rate_module.f90.

Here is the call graph for this function:

◆ merge_tabulated_rates()

subroutine, public tabulated_rate_module::merge_tabulated_rates ( type(reactionrate_type), dimension(:), intent(inout), allocatable  rrate_array,
integer, intent(inout)  rrate_length 
)

Merge tabulated rates into larger rate array.

This subroutine merges and replaces rates from the input array with tabulated rates from tabulated_rate.

Author
D. Martin

Edited:

  • M. Reichert (25.01.21): Made it a separate subroutine
  • M. Reichert (05.08.22): Temporary save rates in other array
Parameters
[in,out]rrate_arrayLarge rate array, containing all reactions
[in,out]rrate_lengthlength of rrate_array

Definition at line 140 of file tabulated_rate_module.f90.

Here is the call graph for this function:

◆ multiply_tab_rate_by_factor()

subroutine, public tabulated_rate_module::multiply_tab_rate_by_factor ( type(reactionrate_type), intent(in)  rrate,
real(r_kind), intent(in)  factor 
)

Multiply a tabulated rate by a factor.

This subroutine multiplies a tabulated rate by a factor.

Author
M. Reichert
Date
04.06.24

Definition at line 211 of file tabulated_rate_module.f90.

◆ output_binary_tabulated_reaction_data()

subroutine, public tabulated_rate_module::output_binary_tabulated_reaction_data ( character(len=*), intent(in)  path)

Save the theoretical tabulated rates to a unformatted binary file.

Author
M. Jacobi
Date
04.10.23

Definition at line 609 of file tabulated_rate_module.f90.

Here is the call graph for this function:

◆ read_binary_tabulated_reaction_data()

subroutine, public tabulated_rate_module::read_binary_tabulated_reaction_data ( character(len=*), intent(in)  path)

Read the tabulated rates from a unformatted binary file.

In case the binary file is read, no other data has to be read.

Author
M. Jacobi
Date
04.10.23
Parameters
[in]pathPath to binary file

Definition at line 563 of file tabulated_rate_module.f90.

Here is the call graph for this function:

◆ readtabulated()

subroutine, private tabulated_rate_module::readtabulated ( integer, intent(in)  sourcefile,
integer, intent(out)  cntTab 
)
private

Reads tabulated reaction rates.

The tabulated reaction rate file is given in the same chapter style as a usual reaclib file, but has different entries instead of the fit values. The temperature grid of the tabulated reactions if given with nucstuff_class::temp_grid_tab . This function is only called if parameter_class::use_tabulated_rates is set to true. An example file could look like:

...
       be7    n  be6                       tabln    -1.06774e+01
 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 1.323e-94 1.437e-76 1.129e-63 5.421e-54 1.868e-46 2.028e-40 2.890e-22 3.813e-13 1.201e-07 5.800e-04 2.562e-01 2.534e+01 1.669e+04 1.341e+06 3.232e+07 3.659e+08 2.502e+09 1.201e+10 
See also
parameter_class::use_tabulated_rates, parameter_class::tabulated_rates_file
Author
D. Martin

Edited:

  • 14.04.15
  • 23.01.21, MR - set the source to always "tabl"
  • 17.07.22, MR - introduced custom reading format, depending on length of the temperature grid
  • 04.10.23, MJ - support for flexible tabulated temperature grids
  • 31.05.24, MR - Fixed bug related to reading rates.
Parameters
[in]sourcefilefile to read tabulated rates from
[out]cnttabtotal count of tabulated rates

Definition at line 329 of file tabulated_rate_module.f90.

Here is the call graph for this function:

◆ readtabulatedtemps()

subroutine, private tabulated_rate_module::readtabulatedtemps
private

Reads tabulated reaction rate temperature grid.

If tabulated_temperature_file is not given, a default temperature grid is used.

See also
parameter_class::use_tabulated_rates, parameter_class::tabulated_temperature_file

Edited:

  • 04.06.24, MR: - Added check for monotonicity
Author
M. Jacobi

Definition at line 238 of file tabulated_rate_module.f90.

Here is the call graph for this function:

◆ tabulated_index()

subroutine, public tabulated_rate_module::tabulated_index ( real(r_kind), intent(in)  temp)

Set tab_index for a given temperature.

Sets the indices for the tabulated rate interpolation in tabulated_inter. Temperature values below or above the temperature grid will result in two equal indices with either 1 or the last index, respectively.

Example

temp = 7e-4
call tabulated_index(temp)
write(*,*) tab_index(1), tab_index(2)

will output 2 and 3.

Returns
tab_index, array with indices for interpolation
See also
tabulated_inter, temp_grid_tab, parameter_class::use_tabulated_rates, parameter_class::tabulated_rates_file, readtabulated
Author
D. Martin
Parameters
[in]tempTemperature [GK]

Definition at line 536 of file tabulated_rate_module.f90.

◆ tabulated_inter()

real(r_kind) function, private tabulated_rate_module::tabulated_inter ( real(r_kind), dimension(:)  rate,
real(r_kind temp 
)
private

Interpolate tabulated rates from the table.

This function uses a lin-log interpolation to calculate a given reaction rate (contained in parameter_class::tabulated_rates_file) An example entry of a tabulated rate looks like:

...
       be7    n  be6                       tabln    -1.06774e+01
 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 1.323e-94 1.437e-76 1.129e-63 5.421e-54 1.868e-46 2.028e-40 2.890e-22 3.813e-13 1.201e-07 5.800e-04 2.562e-01 2.534e+01 1.669e+04 1.341e+06 3.232e+07 3.659e+08 2.502e+09 1.201e+10 
Note
The function contains also a log-log interpolation that is commented out and that can be replaced with the current lin-log interpolation.
Warning
This function should be changed in case of a different temperature grid for tabulated rates
See also
tabulated_inter, temp_grid_tab, parameter_class::use_tabulated_rates, parameter_class::tabulated_rates_file
Author
D. Martin
Parameters
rateRate entries
tempTemperature [GK]
Returns
Interpolated rate at temperature

Definition at line 487 of file tabulated_rate_module.f90.

◆ write_reac_verbose_out()

subroutine, private tabulated_rate_module::write_reac_verbose_out
private

Write the verbose output of the reaction rates.

The rates are always counted, for a certain verbose level they are also printed to the OUT file

Author
M. Reichert
Date
27.01.21

Definition at line 118 of file tabulated_rate_module.f90.

Here is the call graph for this function:

Variable Documentation

◆ nt_tab

integer tabulated_rate_module::nt_tab

number of temperature grid points,

Definition at line 38 of file tabulated_rate_module.f90.

◆ ntab

integer, private tabulated_rate_module::ntab
private

number of tabulated rates (e.g. calculated with TALYS)

Definition at line 37 of file tabulated_rate_module.f90.

◆ rrates_tabulated

type(reactionrate_type), dimension(:), allocatable, public tabulated_rate_module::rrates_tabulated

array containing all tabulated reaction rates in rrate format

Definition at line 50 of file tabulated_rate_module.f90.

◆ tab_index

integer, dimension(2), private tabulated_rate_module::tab_index
private

Multi-index for the tabulated rates.

Definition at line 40 of file tabulated_rate_module.f90.

◆ tabulated

logical, public tabulated_rate_module::tabulated

switch for tabulated rates

Definition at line 39 of file tabulated_rate_module.f90.

◆ tabulated_binary_name

character(len=*), parameter, private tabulated_rate_module::tabulated_binary_name ='tabulated_rates.windat'
private

Filename of binary file to save weak rates.

Definition at line 42 of file tabulated_rate_module.f90.

◆ tabulated_rate

type(tabulated_rate_type), dimension(:), allocatable, private tabulated_rate_module::tabulated_rate
private

array containing all tabulated reaction rates

Definition at line 51 of file tabulated_rate_module.f90.

◆ temp_grid_tab

real(r_kind), dimension(:), allocatable, private tabulated_rate_module::temp_grid_tab
private

Definition at line 44 of file tabulated_rate_module.f90.

◆ temp_grid_tab_default

real(r_kind), dimension(30), private tabulated_rate_module::temp_grid_tab_default = (/1.0d-4,5.0d-4,1.0d-3,5.0d-3,1.0d-2,5.0d-2,1.0d-1,1.5d-1,2.0d-1,2.5d-1, 3.0d-1,4.0d-1,5.0d-1,6.0d-1,7.0d-1,8.0d-1,9.0d-1,1.0d+0,1.5d+0,2.0d+0, 2.5d+0,3.0d+0,3.5d+0,4.0d+0,5.0d+0,6.0d+0,7.0d+0,8.0d+0,9.0d+0,1.0d+1 /)
private

default Temperature grid of tabulated reaction rates [GK]

Definition at line 45 of file tabulated_rate_module.f90.