nucstuff_class Module Reference

Module with helper functions such as rate tabulation, partition functions, and theoretical weak rates. More...

Functions/Subroutines

subroutine init_nucstuff ()
 Initialize nucstuff class. More...
 
logical function, public is_stable (Z, N)
 Function to decide whether a given isotope is stable or not. More...
 
subroutine, public inter_partf (temp, interpol)
 Calculates partition function. More...
 
subroutine, public calc_t9_pow (t9)
 A helper to compute powers of temperature used in the reaction rates. More...
 
subroutine, public el_ab (Y, Ye)
 Computes the electron fraction. More...
 
integer function get_chapter (nr_react, nr_prod)
 Get the reaclib chapter based on nr. of prods. and educts. More...
 
integer function get_nr_reactants (group)
 Get number of reactants of the reaction based on the reaclib chapter. More...
 
integer function get_nr_products (group)
 Get number of products of the reaction based on the reaclib chapter. More...
 
subroutine, public masscalc (Y, m_tot)
 Total mass used to check the mass conservation. More...
 
subroutine, public analyze_src_string (input_string, output_array, length_output)
 Analyze a string and split it with delimiter ";". More...
 

Variables

real(r_kind), dimension(9), public t9_pow
 Powers of T, used for the rates. More...
 
integer, public ntgp
 (24/72) Number of temp grid points for the partition functions More...
 
real(r_kind), dimension(:), allocatable, public pf
 partition functions More...
 

Detailed Description

Module with helper functions such as rate tabulation, partition functions, and theoretical weak rates.

Function/Subroutine Documentation

◆ analyze_src_string()

subroutine, public nucstuff_class::analyze_src_string ( character(len=max_fname_len), intent(in)  input_string,
character(len=4), dimension(:), intent(out), allocatable  output_array,
integer, intent(out)  length_output 
)

Analyze a string and split it with delimiter ";".

This routine is used to analyze the parameters parameter_class::detailed_balance_src_ignore, parameter_class::detailed_balance_src_q_reac, parameter_class::detailed_balance_src_q_winvn. It takes a string and splits it if there is a ";" in it. Afterwards it returns an array with the splitted strings.

Example

a = "rath; pkrF;abc"
b = "ths8"
call analyze_src_string(a,c,d)
call analyze_src_string(b,e,f)

Afterwards, c will be an array containing (/"rath", "pkrF", " abc"/), d will be 3, e will be (/"ths8"/), and f will be 1.

Author
M. Reichert
Date
04.08.22
Parameters
[in]input_stringString with src to analyse, separated by ";"
[out]output_arrayArray with sources
[out]length_outputLength of sources

Definition at line 421 of file nucstuff_class.f90.

◆ calc_t9_pow()

subroutine, public nucstuff_class::calc_t9_pow ( real(r_kind), intent(in)  t9)

A helper to compute powers of temperature used in the reaction rates.

The reaclib reaction rates are calculated with the following fit formula:

\[ \lambda = \mathrm{exp} \left[ a_0 + \sum \limits _{i=1} ^5 a_i T_9 ^{\frac{2i-5}{3}} a_6 \, \mathrm{ln} T_9 \right]. \]

The helper array t9_pow stores the powers of the temperature used for this calculation (starting with index 2 for i=1, index 1 stores unity). The t9_pow array is after the call given by

\[ \mathrm{t9\_pow} = [ T_9 ^{0}, T_9 ^{-1}, T_9 ^{-1/3}, T_9 ^{1/3}, T_9 ^{1}, T_9 ^{5/3}, \log T_9, T_9 ^{7/3}, T_9 ^{9/3} ] \]

Returns
Array (t9_pow) that contains the temperature with different exponents

Edited:

  • MR : 19.01.2021 - renamed subroutine and removed rho as input
Parameters
[in]t9Temperature [GK]

Definition at line 189 of file nucstuff_class.f90.

◆ el_ab()

subroutine, public nucstuff_class::el_ab ( real(r_kind), dimension(:), intent(in)  Y,
real(r_kind), intent(out)  Ye 
)

Computes the electron fraction.

The electron fraction is defined as:

\[ Y_e = \sum Z(i) \cdot Y(i) \]

, with the number of protons Z and the abundance Y of each isotope i.

Edited:

  • MR : 19.01.2021
Parameters
[in]yAbundances
[out]yeElectron fraction

Definition at line 218 of file nucstuff_class.f90.

◆ get_chapter()

integer function nucstuff_class::get_chapter ( integer, intent(in)  nr_react,
integer, intent(in)  nr_prod 
)

Get the reaclib chapter based on nr. of prods. and educts.

This function translates the number of educts and products into the corresponding reaclib chapter.

Example

b = get_chapter(2,2)

b will be 5 afterwards.

@Author M. Reichert

Date
01.08.22
Parameters
[in]nr_reactNr. reactants
[in]nr_prodNr. products
Returns
Reaclib chapter

Definition at line 244 of file nucstuff_class.f90.

Here is the call graph for this function:

◆ get_nr_products()

integer function nucstuff_class::get_nr_products ( integer, intent(in)  group)

Get number of products of the reaction based on the reaclib chapter.

Returns the number of products in the reaction.

Example

b = get_nr_products(2)

b will be 2 afterwards.

Warning
Chapter 8 may return a different value in the original reaclib format. There, reactions can also be chapter 9 reactions.
See also
Reaclib help

@Author M. Reichert

Date
01.08.22
Parameters
[in]groupReaclib chapter
Returns
Amount of educts

Definition at line 344 of file nucstuff_class.f90.

Here is the call graph for this function:

◆ get_nr_reactants()

integer function nucstuff_class::get_nr_reactants ( integer, intent(in)  group)

Get number of reactants of the reaction based on the reaclib chapter.

Returns the number of reactants in the reaction.

Example

b = get_nr_reactants(2)

b will be 1 afterwards.

See also
Reaclib help

@Author M. Reichert

Date
01.08.22
Parameters
[in]groupReaclib chapter
Returns
Amount of educts

Definition at line 300 of file nucstuff_class.f90.

Here is the call graph for this function:

◆ init_nucstuff()

subroutine nucstuff_class::init_nucstuff

Initialize nucstuff class.

Allocate the partition function array.

Author
M. Reichert
Date
26.07.22

Definition at line 39 of file nucstuff_class.f90.

Here is the call graph for this function:

◆ inter_partf()

subroutine, public nucstuff_class::inter_partf ( real(r_kind), intent(in)  temp,
real(r_kind), dimension(0:net_size), intent(out)  interpol 
)

Calculates partition function.

The partition functions are interpolated from the temperature grid (stored in t9_data, read from the winvn in benam_class::get_nuclear_properties (index 1-24) and the htpf file in benam_class::read_htpf (index 25-72)) and the tabulated partition functions global_class::isotope%part_func.

Edited:

  • MR : 19.01.2021 - set ntgp to 72
Parameters
[in]temptemperature [GK]
[out]interpolpartition function

Definition at line 131 of file nucstuff_class.f90.

◆ is_stable()

logical function, public nucstuff_class::is_stable ( integer, intent(in)  Z,
integer, intent(in)  N 
)

Function to decide whether a given isotope is stable or not.

Example

b = is_stable(2,2)

b will be true.

Author
M. Reichert
Parameters
[in]zproton number
[in]nneutron number
Returns
is the isotope stable?

Definition at line 64 of file nucstuff_class.f90.

◆ masscalc()

subroutine, public nucstuff_class::masscalc ( real(r_kind), dimension(:), intent(in)  Y,
real(r_kind), intent(out)  m_tot 
)

Total mass used to check the mass conservation.

This subroutine calculates

\[ \mathrm{m\_tot} = \sum A_i \cdot Y_i \]

Note
This subroutine used to calculate the neutron excess as well and it can be commented in again.

Edited:

  • MR : 20.01.21 - Removed neutron excess
Parameters
[in]yAbundances
[out]m_totSum of mass fractions

Definition at line 383 of file nucstuff_class.f90.

Variable Documentation

◆ ntgp

integer, public nucstuff_class::ntgp

(24/72) Number of temp grid points for the partition functions

Definition at line 17 of file nucstuff_class.f90.

◆ pf

real(r_kind), dimension(:), allocatable, public nucstuff_class::pf

partition functions

Definition at line 18 of file nucstuff_class.f90.

◆ t9_pow

real(r_kind), dimension(9), public nucstuff_class::t9_pow

Powers of T, used for the rates.

See also
calc_t9_pow

Definition at line 15 of file nucstuff_class.f90.