tabulated_rate_module.f90
Go to the documentation of this file.
1 !> @file tabulated_rate_module.f90
2 !!
3 !! The error file code for this file is ***W32***.
4 !!
5 !! Contains the module \ref tabulated_rate_module
6 
7 
8 !>
9 !! @brief This module contains everything for the tabulated rates that
10 !! can replace reaclib rates.
11 !!
12 !! The tabulated rates were implemented by D. Martin. They replace all occurences
13 !! of the corresponding reaclib rate (including resonances). It is useful
14 !! to use rates that are, for example, output of the TALYS code.
15 !!
16 !! @note The temperature grid for the tabulated rates can be changed here.
17 !!
18 !! @see [TALYS](https://tendl.web.psi.ch/tendl_2019/talys.html)
19 !!
20 !! \b Edited:
21 !! - 17.07.22, M.R., made the maximum temperature grid points a variable (nt_tab)
22 !! - 04.10.23 M. Jacobi : Tabulated rates of variable lenghts
23 !! .
24 !!
25 !! @author Moritz Reichert
26 !! @date 24.01.21
27 #include "macros.h"
30  implicit none
31 
32  type,private :: tabulated_rate_type !< type for tabulated reaction rates
33  !< so far contains only the tabulated reaction rates but can be extended
34  real(r_kind),dimension(:),allocatable:: tabulated !< tabulated reaction rates
35  end type tabulated_rate_type
36 
37  integer, private :: ntab !< number of tabulated rates (e.g. calculated with TALYS)
38  integer :: nt_tab !< number of temperature grid points,
39  logical, public :: tabulated !< switch for tabulated rates
40  integer,dimension(2), private :: tab_index !< Multi-index for the tabulated rates
41 
42  character(len=*), private, parameter :: tabulated_binary_name='tabulated_rates.windat' !< Filename of binary file to save weak rates
43 
44  real(r_kind), dimension(:), allocatable, private :: temp_grid_tab
45  real(r_kind), dimension(30), private :: temp_grid_tab_default = &
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 /) !< default Temperature grid of tabulated reaction rates [GK]
49 
50  type(reactionrate_type),dimension(:),allocatable,public :: rrates_tabulated !< array containing all tabulated reaction rates in rrate format
51  type(tabulated_rate_type), dimension(:), allocatable,private :: tabulated_rate !< array containing all tabulated reaction rates
52 
53  !
54  ! Public and private fields and methods of the module
55  !
56  public:: &
60  private:: &
63 contains
64 
65  !> Initialize tabulated rates
66  !!
67  !! This subroutine creates the shorthand flag "tabulated"
68  !! to indicate that tabulated rates are used,
69  !! reads and counts the tabulated rates
70  !!
71  !! @author Moritz Reichert
72  !! @date 24.01.21
73  !!
74  !! \b Edited:
75  !! - 04.10.23, M. Jacobi - support for flexible tabulated temperature grids
76  !! .
77  subroutine init_tabulated_rates()
82 
84  implicit none
85  integer :: tab_unit !< File unit id
86 
87  ! Give the flag a different name
89 
90  ! Read and count tabulated rates
91  ntab = 0
92  nt_tab = 0
93  if (tabulated) then
94  if (use_prepared_network) then
96  else
98  ! readtabulatedtemps reads in the tabulated rate
99  ! temperature grid or sets default if no specific
100  ! grid is given
101  call readtabulatedtemps()
102  ! readtabulated returns number of tabulated rates
103  call readtabulated(tab_unit,ntab)
104  end if
105  ! Give a verbose output
107  endif
108  end subroutine init_tabulated_rates
109 
110 
111  !> Write the verbose output of the reaction rates
112  !!
113  !! The rates are always counted, for a certain verbose level they
114  !! are also printed to the OUT file
115  !!
116  !! @author M. Reichert
117  !! @date 27.01.21
120  implicit none
121 
122  if (verbose_level .ge. 1) then
123  call write_data_to_std_out("Size tabulated rate temperature grid",int_to_str(nt_tab))
124  call write_data_to_std_out("Amount tabulated rates",int_to_str(ntab))
125  end if
126  end subroutine write_reac_verbose_out
127 
128 
129  !> Merge tabulated rates into larger rate array.
130  !!
131  !! This subroutine merges and replaces rates from the input array with
132  !! tabulated rates from \ref tabulated_rate.
133  !!
134  !! @author D. Martin
135  !!
136  !! \b Edited:
137  !! - M. Reichert (25.01.21): Made it a separate subroutine
138  !! - M. Reichert (05.08.22): Temporary save rates in other array
139  !! .
140  subroutine merge_tabulated_rates(rrate_array,rrate_length)
144  implicit none
145  type(reactionrate_type),dimension(:),allocatable,intent(inout) :: rrate_array !< Large rate array, containing all reactions
146  integer,intent(inout) :: rrate_length !< length of rrate_array
147  type(reactionrate_type),dimension(:),allocatable :: rrate_tmp !< Temporary rate array
148  integer :: alloc_stat !< Allocation state
149  integer :: new_length !< New length of rrate_array
150 
151  if (tabulated .and. (.not. use_prepared_network)) then
152  if (ntab .ne. 0) then
153  if (.not. allocated(rrate_array)) then
154  rrate_length = ntab
155  !-- Allocate the reaclib rate array
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)
159  rrate_array(1:ntab) = rrates_tabulated(1:ntab)
160  else
161  !----- merge tabulated rates into rrate
162  call rrate_qs_replace(rrate_array(1:rrate_length),rrate_length,rrates_tabulated(1:ntab),ntab,1,rrate_tmp,new_length)
163  rrate_length = new_length
164  deallocate(rrate_array)
165  allocate(rrate_array(rrate_length))
166  ! TODO throw exception
167  rrate_array(:) = rrate_tmp(:)
168  end if
169  !-- Deallocate the reaclib rate array
170  deallocate(rrates_tabulated)
171  !-- Output the new length
172  end if
173  end if
174 
175  end subroutine merge_tabulated_rates
176 
177 
178 
179  !> Calculates the tabulated rate.
180  !!
181  !! This subroutine serves as an interface between the tabulated_rate_module
182  !! and the jacobian class. It interpolates the rate on the grid and returns
183  !! the rate value at a given temperature
184  !!
185  !! \b Edited:
186  !! - 26.07.22, MR: Created this subroutine to be in line with the other
187  !! reaction rate types.
188  !! - 04.10.23, MJ: Added support for flexible tabulated temperature grids
189  !! .
190  subroutine calculate_tab_rate(rrate, temp, rat_calc)
192  implicit none
193  ! Declare the pass
194  type(reactionrate_type),intent(in) :: rrate !< rate instance
195  real(r_kind),intent(in) :: temp !< Temperature [GK]
196  real(r_kind),intent(out) :: rat_calc !< rate value
197 
198  integer :: tab_rate_index !< index of the tabulated rate
199  ! Interpolate the rate
200  tab_rate_index = int(rrate%param(1))
201  rat_calc = tabulated_inter(tabulated_rate(tab_rate_index)%tabulated,temp)
202  end subroutine calculate_tab_rate
203 
204 
205  !> Multiply a tabulated rate by a factor
206  !!
207  !! This subroutine multiplies a tabulated rate by a factor.
208  !!
209  !! @author M. Reichert
210  !! @date 04.06.24
211  subroutine multiply_tab_rate_by_factor(rrate,factor)
212  implicit none
213  type(reactionrate_type),intent(in) :: rrate
214  real(r_kind),intent(in) :: factor
215  ! Internal variables
216  integer :: tab_rate_index !< index of the tabulated rate
217 
218  tab_rate_index = int(rrate%param(1))
219  tabulated_rate(tab_rate_index)%tabulated(:) = tabulated_rate(tab_rate_index)%tabulated(:) * factor
220 
221  end subroutine multiply_tab_rate_by_factor
222 
223 
224 
225  !> Reads tabulated reaction rate temperature grid.
226  !!
227  !! If tabulated_temperature_file is not given, a default
228  !! temperature grid is used.
229  !!
230  !! @see parameter_class::use_tabulated_rates,
231  !! parameter_class::tabulated_temperature_file
232  !!
233  !! \b Edited:
234  !! - 04.06.24, MR: - Added check for monotonicity
235  !! .
236  !!
237  !! @author M. Jacobi
238  subroutine readtabulatedtemps()
239  use error_msg_class, only: int_to_str
242 
243  implicit none
244 
245  integer :: i
246  integer :: read_stat,alloc_stat
247  integer :: tabtemp_unit !< File unit id
248  character(10000) :: help_reader !< Helper variable
249 
250  info_entry("readtabulated")
251 
252  if (tabulated_temperature_file .eq. "default") then
253  nt_tab = 30
254  allocate(temp_grid_tab(30),stat=alloc_stat)
256  return
257  end if
258 
259  ! Count how many lines to skip and how many are there
261 
262  do ! determine the number of records
263  read(tabtemp_unit,"(A)",iostat=read_stat)help_reader
264  ! Go out, file ended
265  if (read_stat .ne. 0)exit
266  help_reader = trim(adjustl(help_reader))
267  ! Check if the line is to skip or not
268  if ((len_trim(help_reader) .eq. 0) .or. (help_reader(1:1) .eq. "#")) then
269  cycle
270  else
271  exit
272  end if
273  end do
274  close(tabtemp_unit)
275 
276  ! Count the number of space separated entries
277  nt_tab = 0
278  do i = 1, len_trim(help_reader)-1
279  if ((help_reader(i:i) == ' ') .and. (help_reader(i+1:i+1) .ne. ' ')) then
280  nt_tab = nt_tab + 1
281  end if
282  end do
283  nt_tab = nt_tab + 1 ! Add 1 to account for the last entry
284 
285  ! Allocate the temperature grid
286  allocate(temp_grid_tab(nt_tab),stat=alloc_stat)
287 
288  ! Read the temperature grid
289  read(help_reader,*) temp_grid_tab
290 
291  ! Check that it is monotonically increasing
292  do i = 1, nt_tab-1
293  if (temp_grid_tab(i) >= temp_grid_tab(i+1)) then
294  call raise_exception("Temperature grid is not monotonically increasing",&
295  "readtabulatedtemps",420004)
296 
297  end if
298  end do
299 
300 
301  end subroutine readtabulatedtemps
302 
303  !>
304  !! Reads tabulated reaction rates.
305  !!
306  !! The tabulated reaction rate file is given in the same
307  !! chapter style as a usual reaclib file, but has different entries
308  !! instead of the fit values. The temperature grid of the tabulated reactions
309  !! if given with nucstuff_class::temp_grid_tab . This function is only called
310  !! if parameter_class::use_tabulated_rates is set to true. An example file
311  !! could look like:
312  !! \l_file{...
313  !! be7 n be6 tabln -1.06774e+01
314  !! 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 }
315  !!
316  !! @see parameter_class::use_tabulated_rates,
317  !! parameter_class::tabulated_rates_file
318  !!
319  !! @author D. Martin
320  !!
321  !! \b Edited:
322  !! - 14.04.15
323  !! - 23.01.21, MR - set the source to always "tabl"
324  !! - 17.07.22, MR - introduced custom reading format,
325  !! depending on length of the temperature grid
326  !! - 04.10.23, MJ - support for flexible tabulated temperature grids
327  !! - 31.05.24, MR - Fixed bug related to reading rates.
328  !! .
329  subroutine readtabulated(sourcefile,cntTab)
330  use error_msg_class, only: int_to_str
331  use format_class
332  use benam_class
334  implicit none
335 
336  integer, intent(in) :: sourcefile !< file to read tabulated rates from
337  integer, intent(out) :: cnttab !< total count of tabulated rates
338  !
339  integer :: grp
340  integer :: group_index
341  integer :: cnt_two
342  character(5), dimension(6) :: parts
343  integer, dimension(6) :: parts_index
344  character(4) :: src
345  character(1) :: res
346  character(1) :: rev
347  real(r_kind),dimension(:), allocatable :: curtable
348  real(r_kind) :: qvalue
349  integer :: j,k,read_stat,alloc_stat
350 
351  info_entry("readtabulated")
352 
353  allocate(curtable(nt_tab),stat=alloc_stat)
354 
355 
356  k=0
357  !----- first read the input file in order to determine the number of tabulated reactions
358  talloc_loop: do
359  !----- read tabulated rate from file
360  read(sourcefile,my_format(1), iostat = read_stat) &
361  grp, parts(1:6), src, res, rev, qvalue
362  if (read_stat /= 0) exit
363  if (grp .eq. 0) then
364  ! Read the rates on the grid table
365  read(sourcefile,*) curtable
366  else
367  read(sourcefile,*)
368  end if
369 
370  ! Check if reaction is in the network
371  select case (grp)
372  case (1:11)
373  group_index = grp
374  cycle
375  case default
376  parts_index = 0
377  tinner_loop_cnt: do j=1,6
378  if (parts(j) .eq. ' ') exit tinner_loop_cnt
379  parts_index(j) = benam(parts(j))
380  !----- parts_index(j)==0 means that nuclide j is not part of the network
381  if (parts_index(j) .eq. 0) cycle talloc_loop
382  end do tinner_loop_cnt
383  !----- if both participants are part of the network, write the rate into
384  !----- tabulated_rate
385  end select
386 
387  k=k+1
388  end do talloc_loop
389 
390  ntab = k
391  !----- allocate the array of tabulated reactions
392  allocate(rrates_tabulated(ntab),stat=alloc_stat)
393  !----- allocate the array of tabulated rates
394  allocate(tabulated_rate(ntab),stat=alloc_stat)
395  do k=1, ntab
396  allocate(tabulated_rate(k)%tabulated(nt_tab),stat=alloc_stat)
397  end do
398 
399  if ( alloc_stat /= 0) call raise_exception('Allocation of "tabulated_rate" failed',&
400  "readtabulated",420001)
401  rewind(sourcefile)
402 
403  k=1
404  cnt_two =0
405  !----- read the input file again and fill the array of tabulated reactions
406  touter_loop: do
407  !----- read names of participating nuclides and Q-value
408  read(sourcefile,my_format(1), iostat = read_stat) &
409  grp, parts(1:6), src, res, rev, qvalue
410  if (read_stat /= 0) exit
411  if (grp .eq. 0) then
412  read(sourcefile,*) curtable
413  else
414  read(sourcefile,*)
415  end if
416  select case (grp)
417  case (1:11)
418  group_index = grp
419  cycle
420  case default
421  parts_index = 0
422  tinner_loop: do j=1,6
423  if (parts(j) .eq. ' ') exit tinner_loop
424  parts_index(j) = benam(parts(j))
425  !----- parts_index(j)==0 means that nuclide j is not part of the network
426  if (parts_index(j) .eq. 0) cycle touter_loop
427  end do tinner_loop
428  !----- if both participants are part of the network, write the rate into
429  !----- tabulated_rate
430  end select
431 
432  rrates_tabulated(k)%group = group_index
433  rrates_tabulated(k)%parts = parts_index
434  rrates_tabulated(k)%source = src
435  rrates_tabulated(k)%q_value = qvalue
436  rrates_tabulated(k)%is_resonant = (res == "r")
437  rrates_tabulated(k)%is_weak = (res == "w")
438  rrates_tabulated(k)%is_reverse = (rev == "v")
439  rrates_tabulated(k)%param = 0.0
440  rrates_tabulated(k)%param(1) = dble(k)
441  rrates_tabulated(k)%reac_src = rrs_tabl
442  rrates_tabulated(k)%cached = -1
443 
444  tabulated_rate(k)%tabulated = curtable
445 
446  cnt_two=k
447  ! Set the reaction type
449  ! Next rate
450  k=k+1
451  end do touter_loop
452 
453  ! Make the reading bullet proof
454  if (ntab .ne. cnt_two) then
455  call raise_exception('Number of tabulated rates does not match while reading!',&
456  "readtabulated",420003)
457  end if
458 
459  cnttab = ntab
460  ! get the correct coefficients to prevent double counting
462 
463  info_exit("readtabulated")
464  end subroutine readtabulated
465 
466 
467  !> Interpolate tabulated rates from the table
468  !!
469  !! This function uses a lin-log interpolation to calculate
470  !! a given reaction rate (contained in \ref parameter_class::tabulated_rates_file)
471  !! An example entry of a tabulated rate looks like:
472  !!
473  !! \l_file{...
474  !! be7 n be6 tabln -1.06774e+01
475  !! 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 }
476  !!
477  !! @note The function contains also a log-log interpolation that is commented out
478  !! and that can be replaced with the current lin-log interpolation.
479  !!
480  !! @warning This function should be changed in case of a different temperature grid
481  !! for tabulated rates
482  !!
483  !! @see tabulated_inter, temp_grid_tab, parameter_class::use_tabulated_rates,
484  !! parameter_class::tabulated_rates_file
485  !!
486  !! @author D. Martin
487  function tabulated_inter(rate,temp) result (tabr)
488  implicit none
489 
490  real(r_kind),dimension(:) :: rate !< Rate entries
491  real(r_kind) :: temp !< Temperature [GK]
492  real(r_kind) :: tabr !< Interpolated rate at temperature
493 
494  tabr = 0.0d0
495  if(tab_index(1) .eq. tab_index(2)) then
496  tabr = rate(tab_index(1))
497  else
498  if((rate(tab_index(1)).lt.1.d-100) .or. (rate(tab_index(2)).lt.1.d-100)) then
499  tabr = 0.0d0
500  else
501  !!! lin-log
502  tabr = rate(tab_index(1))*(rate(tab_index(2))/rate(tab_index(1)))**((temp-temp_grid_tab(tab_index(1)))&
504  !!! log-log
505  !tabr = rate(tab_index(1))*(rate(tab_index(2))/rate(tab_index(1)))**(dlog10(temp/temp_grid_tab(tab_index(1)))/dlog10(temp_grid_tab(tab_index(2))/temp_grid_tab(tab_index(1))))
506  endif
507  endif
508 
509  return
510 
511  end function tabulated_inter
512 
513 
514  !>
515  !! @brief Set \ref tab_index for a given temperature
516  !!
517  !! Sets the indices for the tabulated rate interpolation
518  !! in \ref tabulated_inter. Temperature values below or above the
519  !! temperature grid will result in two equal indices
520  !! with either 1 or the last index, respectively.
521  !!
522  !! ### Example
523  !!~~~~~~~~~~~~~~.f90
524  !! temp = 7e-4
525  !! call tabulated_index(temp)
526  !! write(*,*) tab_index(1), tab_index(2)
527  !!~~~~~~~~~~~~~~
528  !! will output 2 and 3.
529  !!
530  !! @returns \ref tab_index, array with indices for interpolation
531  !!
532  !! @see tabulated_inter, temp_grid_tab, parameter_class::use_tabulated_rates,
533  !! parameter_class::tabulated_rates_file, readtabulated
534  !!
535  !! @author D. Martin
536  subroutine tabulated_index (temp)
537  implicit none
538  real(r_kind), intent(in) :: temp !< Temperature [GK]
539  integer :: i
540 
541  if (temp .gt. temp_grid_tab(nt_tab)) then
542  tab_index = nt_tab
543  elseif (temp .lt. temp_grid_tab(1)) then
544  tab_index = 1
545  else
546  do i=1,nt_tab
547  if (temp .gt. temp_grid_tab(i)) cycle
548  tab_index(1) = i-1
549  tab_index(2) = i
550  exit
551  enddo
552  endif
553 
554  end subroutine tabulated_index
555 
556 
557  !> Read the tabulated rates from a unformatted binary file
558  !!
559  !! In case the binary file is read, no other data has to be read.
560  !!
561  !! @author M. Jacobi
562  !! @date 04.10.23
566  implicit none
567  character(len=*), intent(in) :: path !< Path to binary file
568  integer :: file_id !< File identifier
569  integer :: i !< Loop variable
570  integer :: status !< Status of allocation
571 
572 
573  file_id = open_unformatted_infile(trim(adjustl(path))//trim(adjustl(tabulated_binary_name)))
574 
575  read(file_id) ntab
576  read(file_id) nt_tab
577 
578  !----- allocate the array containing the temperature grid
579  allocate(temp_grid_tab(nt_tab), stat=status)
580  !----- allocate the array of tabulated reactions
581  allocate(rrates_tabulated(ntab),stat=status)
582  !----- allocate the array of tabulated rates
583  allocate(tabulated_rate(ntab),stat=status)
584  do i=1, ntab
585  allocate(tabulated_rate(i)%tabulated(nt_tab),stat=status)
586  end do
587 
588  if ( status /= 0) call raise_exception('Allocation of "tabulated_rate" failed',&
589  "readtabulated",420001)
590 
591  read(file_id) temp_grid_tab
592 
593  do i=1, ntab
594  read(file_id) tabulated_rate(i)%tabulated
595  end do
596 
597 
598  close(file_id)
599 
601 
602 
603 
604 
605  !> Save the theoretical tabulated rates to a unformatted binary file
606  !!
607  !! @author M. Jacobi
608  !! @date 04.10.23
611 
612  implicit none
613  character(len=*), intent(in) :: path
614  integer :: i
615  integer :: file_id
616 
617  if (.not. tabulated) return
618 
619  ! Open an unformatted file
620  file_id = open_unformatted_outfile(trim(adjustl(path))//trim(adjustl(tabulated_binary_name)))
621  ! Save the data
622  write(file_id) ntab
623  write(file_id) nt_tab
624  write(file_id) temp_grid_tab
625 
626  do i=1,ntab
627  write(file_id) tabulated_rate(i)%tabulated
628  end do
629 
630  close(file_id)
631 
633 
634 end module tabulated_rate_module
parameter_class::use_prepared_network
logical use_prepared_network
Use a prepared folder with all necessary data in binary format.
Definition: parameter_class.f90:94
global_class::reactionrate_type
reaction rate type
Definition: global_class.f90:44
tabulated_rate_module::tabulated_inter
real(r_kind) function, private tabulated_inter(rate, temp)
Interpolate tabulated rates from the table.
Definition: tabulated_rate_module.f90:488
tabulated_rate_module::temp_grid_tab
real(r_kind), dimension(:), allocatable, private temp_grid_tab
Definition: tabulated_rate_module.f90:44
tabulated_rate_module::rrates_tabulated
type(reactionrate_type), dimension(:), allocatable, public rrates_tabulated
array containing all tabulated reaction rates in rrate format
Definition: tabulated_rate_module.f90:50
reaclib_rate_module
Module that deals with reaclib reaction rates.
Definition: reaclib_rate_module.f90:13
tabulated_rate_module::tabulated_binary_name
character(len= *), parameter, private tabulated_binary_name
Filename of binary file to save weak rates.
Definition: tabulated_rate_module.f90:42
parameter_class::tabulated_temperature_file
character(max_fname_len) tabulated_temperature_file
file containing grid of tabulated temperature file ("default" for default grid)
Definition: parameter_class.f90:171
error_msg_class
Error handling routines.
Definition: error_msg_class.f90:16
tabulated_rate_module::tabulated_rate_type
Definition: tabulated_rate_module.f90:32
benam_class::benam
integer function, public benam(name)
Returns the index number of isotope 'name'.
Definition: benam_class.f90:251
error_msg_class::int_to_str
character(:) function, allocatable, public int_to_str(num)
Converts a given integer to a string.
Definition: error_msg_class.f90:224
error_msg_class::raise_exception
subroutine, public raise_exception(msg, sub, error_code)
Raise a exception with a given error message.
Definition: error_msg_class.f90:245
parameter_class::max_fname_len
integer, parameter, public max_fname_len
maximum length of filenames
Definition: parameter_class.f90:58
tabulated_rate_module::output_binary_tabulated_reaction_data
subroutine, public output_binary_tabulated_reaction_data(path)
Save the theoretical tabulated rates to a unformatted binary file.
Definition: tabulated_rate_module.f90:610
tabulated_rate_module::tabulated_rate
type(tabulated_rate_type), dimension(:), allocatable, private tabulated_rate
array containing all tabulated reaction rates
Definition: tabulated_rate_module.f90:51
error_msg_class::write_data_to_std_out
subroutine, public write_data_to_std_out(str_msg, value_str, unit)
Write data to the standard output (usually OUT)
Definition: error_msg_class.f90:122
format_class::my_format
character(60), dimension(100) my_format
Definition: format_class.f90:19
tabulated_rate_module::multiply_tab_rate_by_factor
subroutine, public multiply_tab_rate_by_factor(rrate, factor)
Multiply a tabulated rate by a factor.
Definition: tabulated_rate_module.f90:212
tabulated_rate_module::init_tabulated_rates
subroutine, public init_tabulated_rates()
Initialize tabulated rates.
Definition: tabulated_rate_module.f90:78
parameter_class::use_tabulated_rates
logical use_tabulated_rates
switch for using tabulated rates (e.g. talysNGrates.dat)
Definition: parameter_class.f90:92
tabulated_rate_module::write_reac_verbose_out
subroutine, private write_reac_verbose_out()
Write the verbose output of the reaction rates.
Definition: tabulated_rate_module.f90:119
tabulated_rate_module::tab_index
integer, dimension(2), private tab_index
Multi-index for the tabulated rates.
Definition: tabulated_rate_module.f90:40
tabulated_rate_module::read_binary_tabulated_reaction_data
subroutine, public read_binary_tabulated_reaction_data(path)
Read the tabulated rates from a unformatted binary file.
Definition: tabulated_rate_module.f90:564
file_handling_class
Provide some basic file-handling routines.
Definition: file_handling_class.f90:18
tabulated_rate_module::tabulated
logical, public tabulated
switch for tabulated rates
Definition: tabulated_rate_module.f90:39
parameter_class::tabulated_rates_file
character(max_fname_len) tabulated_rates_file
tabulated rates library (e.g. talysNGrates.dat)
Definition: parameter_class.f90:170
r_kind
#define r_kind
Definition: macros.h:46
tabulated_rate_module::tabulated_index
subroutine, public tabulated_index(temp)
Set tab_index for a given temperature.
Definition: tabulated_rate_module.f90:537
reaclib_rate_module::set_reaction_type
subroutine, public set_reaction_type(rr_tmp)
Set a flag for the reaction type.
Definition: reaclib_rate_module.f90:569
tabulated_rate_module::ntab
integer, private ntab
number of tabulated rates (e.g. calculated with TALYS)
Definition: tabulated_rate_module.f90:37
file_handling_class::open_infile
integer function, public open_infile(file_name)
Same for reading (input file)
Definition: file_handling_class.f90:126
tabulated_rate_module::temp_grid_tab_default
real(r_kind), dimension(30), private temp_grid_tab_default
default Temperature grid of tabulated reaction rates [GK]
Definition: tabulated_rate_module.f90:45
tabulated_rate_module
This module contains everything for the tabulated rates that can replace reaclib rates.
Definition: tabulated_rate_module.f90:28
tabulated_rate_module::merge_tabulated_rates
subroutine, public merge_tabulated_rates(rrate_array, rrate_length)
Merge tabulated rates into larger rate array.
Definition: tabulated_rate_module.f90:141
mergesort_module::rrate_qs_replace
subroutine, public rrate_qs_replace(x, xs, y, ys, r, out_array, ptz)
Wrapper around the quicksort subroutine.
Definition: mergesort_module.f90:425
global_class
Contains types and objects shared between multiple modules.
Definition: global_class.f90:19
tabulated_rate_module::calculate_tab_rate
subroutine, public calculate_tab_rate(rrate, temp, rat_calc)
Calculates the tabulated rate.
Definition: tabulated_rate_module.f90:191
tabulated_rate_module::nt_tab
integer nt_tab
number of temperature grid points,
Definition: tabulated_rate_module.f90:38
file_handling_class::open_unformatted_outfile
integer function, public open_unformatted_outfile(file_name)
Shorthand for opening a new unformatted file for writing (output file)
Definition: file_handling_class.f90:74
format_class
Define custom format statements used to read in major data files.
Definition: format_class.f90:16
file_handling_class::open_unformatted_infile
integer function open_unformatted_infile(file_name)
Open an unformatted file for reading.
Definition: file_handling_class.f90:89
mergesort_module
Module mergesort_module for merging arrays of rates.
Definition: mergesort_module.f90:16
tabulated_rate_module::readtabulated
subroutine, private readtabulated(sourcefile, cntTab)
Reads tabulated reaction rates.
Definition: tabulated_rate_module.f90:330
tabulated_rate_module::readtabulatedtemps
subroutine, private readtabulatedtemps()
Reads tabulated reaction rate temperature grid.
Definition: tabulated_rate_module.f90:239
parameter_class::prepared_network_path
character(max_fname_len) prepared_network_path
Prepared network folder.
Definition: parameter_class.f90:198
rrs_tabl
#define rrs_tabl
Definition: macros.h:50
parameter_class
Contains all runtime parameters as well as phys and math constants.
Definition: parameter_class.f90:24
benam_class::getcoefficients
subroutine, public getcoefficients(rate_array, length_rate_array)
Returns the 1/n! factor where n is the number of equal isotopes entering a reaction....
Definition: benam_class.f90:307
benam_class
Subroutines needed to initialise the network.
Definition: benam_class.f90:11