Go to the documentation of this file.
46 (/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, &
47 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, &
48 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 /)
122 if (verbose_level .ge. 1)
then
146 integer,
intent(inout) :: rrate_length
148 integer :: alloc_stat
149 integer :: new_length
152 if (
ntab .ne. 0)
then
153 if (.not.
allocated(rrate_array))
then
156 allocate(rrate_array(
ntab),stat=alloc_stat)
157 if ( alloc_stat /= 0)
call raise_exception(
'Allocation of "rrate_array" failed.',&
158 "merge_tabulated_rates",420001)
163 rrate_length = new_length
164 deallocate(rrate_array)
165 allocate(rrate_array(rrate_length))
167 rrate_array(:) = rrate_tmp(:)
195 real(
r_kind),
intent(in) :: temp
196 real(
r_kind),
intent(out) :: rat_calc
198 integer :: tab_rate_index
200 tab_rate_index = int(rrate%param(1))
214 real(
r_kind),
intent(in) :: factor
216 integer :: tab_rate_index
218 tab_rate_index = int(rrate%param(1))
246 integer :: read_stat,alloc_stat
247 integer :: tabtemp_unit
248 character(10000) :: help_reader
250 info_entry(
"readtabulated")
263 read(tabtemp_unit,
"(A)",iostat=read_stat)help_reader
265 if (read_stat .ne. 0)
exit
266 help_reader = trim(adjustl(help_reader))
268 if ((len_trim(help_reader) .eq. 0) .or. (help_reader(1:1) .eq.
"#"))
then
278 do i = 1, len_trim(help_reader)-1
279 if ((help_reader(i:i) ==
' ') .and. (help_reader(i+1:i+1) .ne.
' '))
then
294 call raise_exception(
"Temperature grid is not monotonically increasing",&
295 "readtabulatedtemps",420004)
336 integer,
intent(in) :: sourcefile
337 integer,
intent(out) :: cnttab
340 integer :: group_index
342 character(5),
dimension(6) :: parts
343 integer,
dimension(6) :: parts_index
347 real(
r_kind),
dimension(:),
allocatable :: curtable
349 integer :: j,k,read_stat,alloc_stat
351 info_entry(
"readtabulated")
353 allocate(curtable(
nt_tab),stat=alloc_stat)
360 read(sourcefile,
my_format(1), iostat = read_stat) &
361 grp, parts(1:6), src, res, rev, qvalue
362 if (read_stat /= 0)
exit
365 read(sourcefile,*) curtable
377 tinner_loop_cnt:
do j=1,6
378 if (parts(j) .eq.
' ')
exit tinner_loop_cnt
379 parts_index(j) =
benam(parts(j))
381 if (parts_index(j) .eq. 0) cycle talloc_loop
382 end do tinner_loop_cnt
399 if ( alloc_stat /= 0)
call raise_exception(
'Allocation of "tabulated_rate" failed',&
400 "readtabulated",420001)
408 read(sourcefile,
my_format(1), iostat = read_stat) &
409 grp, parts(1:6), src, res, rev, qvalue
410 if (read_stat /= 0)
exit
412 read(sourcefile,*) curtable
422 tinner_loop:
do j=1,6
423 if (parts(j) .eq.
' ')
exit tinner_loop
424 parts_index(j) =
benam(parts(j))
426 if (parts_index(j) .eq. 0) cycle touter_loop
454 if (
ntab .ne. cnt_two)
then
455 call raise_exception(
'Number of tabulated rates does not match while reading!',&
456 "readtabulated",420003)
463 info_exit(
"readtabulated")
490 real(
r_kind),
dimension(:) :: rate
538 real(
r_kind),
intent(in) :: temp
567 character(len=*),
intent(in) :: path
588 if ( status /= 0)
call raise_exception(
'Allocation of "tabulated_rate" failed',&
589 "readtabulated",420001)
613 character(len=*),
intent(in) :: path
logical use_prepared_network
Use a prepared folder with all necessary data in binary format.
real(r_kind) function, private tabulated_inter(rate, temp)
Interpolate tabulated rates from the table.
real(r_kind), dimension(:), allocatable, private temp_grid_tab
type(reactionrate_type), dimension(:), allocatable, public rrates_tabulated
array containing all tabulated reaction rates in rrate format
Module that deals with reaclib reaction rates.
character(len= *), parameter, private tabulated_binary_name
Filename of binary file to save weak rates.
character(max_fname_len) tabulated_temperature_file
file containing grid of tabulated temperature file ("default" for default grid)
integer function, public benam(name)
Returns the index number of isotope 'name'.
character(:) function, allocatable, public int_to_str(num)
Converts a given integer to a string.
subroutine, public raise_exception(msg, sub, error_code)
Raise a exception with a given error message.
integer, parameter, public max_fname_len
maximum length of filenames
subroutine, public output_binary_tabulated_reaction_data(path)
Save the theoretical tabulated rates to a unformatted binary file.
type(tabulated_rate_type), dimension(:), allocatable, private tabulated_rate
array containing all tabulated reaction rates
subroutine, public write_data_to_std_out(str_msg, value_str, unit)
Write data to the standard output (usually OUT)
subroutine, public multiply_tab_rate_by_factor(rrate, factor)
Multiply a tabulated rate by a factor.
subroutine, public init_tabulated_rates()
Initialize tabulated rates.
logical use_tabulated_rates
switch for using tabulated rates (e.g. talysNGrates.dat)
subroutine, private write_reac_verbose_out()
Write the verbose output of the reaction rates.
integer, dimension(2), private tab_index
Multi-index for the tabulated rates.
subroutine, public read_binary_tabulated_reaction_data(path)
Read the tabulated rates from a unformatted binary file.
Provide some basic file-handling routines.
logical, public tabulated
switch for tabulated rates
character(max_fname_len) tabulated_rates_file
tabulated rates library (e.g. talysNGrates.dat)
subroutine, public tabulated_index(temp)
Set tab_index for a given temperature.
subroutine, public set_reaction_type(rr_tmp)
Set a flag for the reaction type.
integer, private ntab
number of tabulated rates (e.g. calculated with TALYS)
integer function, public open_infile(file_name)
Same for reading (input file)
real(r_kind), dimension(30), private temp_grid_tab_default
default Temperature grid of tabulated reaction rates [GK]
This module contains everything for the tabulated rates that can replace reaclib rates.
subroutine, public merge_tabulated_rates(rrate_array, rrate_length)
Merge tabulated rates into larger rate array.
subroutine, public rrate_qs_replace(x, xs, y, ys, r, out_array, ptz)
Wrapper around the quicksort subroutine.
Contains types and objects shared between multiple modules.
subroutine, public calculate_tab_rate(rrate, temp, rat_calc)
Calculates the tabulated rate.
integer nt_tab
number of temperature grid points,
integer function, public open_unformatted_outfile(file_name)
Shorthand for opening a new unformatted file for writing (output file)
integer function open_unformatted_infile(file_name)
Open an unformatted file for reading.
Module mergesort_module for merging arrays of rates.
subroutine, private readtabulated(sourcefile, cntTab)
Reads tabulated reaction rates.
subroutine, private readtabulatedtemps()
Reads tabulated reaction rate temperature grid.
character(max_fname_len) prepared_network_path
Prepared network folder.
Contains all runtime parameters as well as phys and math constants.
subroutine, public getcoefficients(rate_array, length_rate_array)
Returns the 1/n! factor where n is the number of equal isotopes entering a reaction....
Subroutines needed to initialise the network.