jacobian_class.f90
Go to the documentation of this file.
1 !> @file jacobian_class.f90
2 !!
3 !! The error file code for this file is ***W28***.
4 !! @brief Module jacobian_class for calculating and solving the linearized equations
5 !!
6 
7 !> Contains subroutines to assemble the system Jacobian and changes in the abundances
8 !!
9 !! \b Edited:
10 !! - 23.01.21, MR - fixed overflows and turned off fission in NSE
11 #include "macros.h"
13 
15  use pardiso_class, only: vals,jind
16  use benam_class
17  use nucstuff_class
18  use effphase_class
19  use nuflux_class
21  use global_class, only: nreac
22  implicit none
23 
24  ! helper variables
25  real(r_kind),parameter,private :: rate_min_cutoff = 1d-50 !< Minimum cutoff for the reaction rates
26  real(r_kind),parameter,private :: rate_max_cutoff = 1d99 !< Maximum cutoff for the reaction rates
27  logical,private :: freeze_rate_indicator = .false. !< Indicator for debug statement
28  real(r_kind),private :: old_time=-99, old_temp=-99, old_dens=-99, old_ye=-99, old_rad=-99
29  !
30  ! Public and private fields and methods of the module (all routines are publis)
31  !
32  public:: &
34  private:: &
36 
37 contains
38 
39 
40 
41 !> Subroutine to calculate the reaction rates
42 !!
43 !! The calculation depends on the source flag of the reaction rate.
44 !! While reaclib rates are done by a simple fit formula, tabulated rates
45 !! have to be interpolated, theoretical weak rates have to interpolate
46 !! on a temperature-density grid, etc.
47 !!
48 !! @see reaclib_rate_module::calculate_reacl_rate, tabulated_rate_module::calculate_tab_rate,
49 !! tw_rate_module::calculate_twr_rate
50 !!
51 !! \b Edited:
52 !! - 26.07.22, MR: Created this subroutine from code snippets
53 !! that were flying around in Jacobi_init and abchange.
54 !! .
55 subroutine calculate_reaction_rate(time, temp, rho, Ye, rkm, rrate_array, idx, rat_calc)
64  use screening_module, only: screen, hv, iscreen
66  implicit none
67  ! Declare the pass
68  type(reactionrate_type),dimension(nreac),intent(inout),optional :: rrate_array!< Rate array
69  real(r_kind),intent(in) :: time !< Time [s]
70  real(r_kind),intent(in) :: temp !< Temperature
71  integer,intent(in),optional :: idx !< Index of rate in array
72  real(r_kind),intent(in) :: rho !< Density
73  real(r_kind),intent(in) :: ye !< Electron fraction
74  real(r_kind),intent(in) :: rkm !< Radius in km
75  real(r_kind),intent(out),optional :: rat_calc !< Calculated reaction rate
76  ! Internal variables
77  character*4 :: src !< Source flag of reaction
78  logical :: is_same_step !< Flag that determines if it is the same step
79  ! or if the conditions changed
80  real(r_kind) :: eta_e,eta_p
81  real(r_kind) :: elnd !< Electron density
82  integer :: reac_origin !< Origin of the reaclib rate (tabulated, reaclib, ...)
83 
84 
85  ! Check if indices and other things have to be updated
86  if ((old_time .eq. time) .and. (old_temp .eq. temp) .and. &
87  (old_dens .eq. rho) .and. (old_ye .eq. ye) .and.&
88  (old_rad .eq. rkm)) then
89  is_same_step = .true.
90  else
91  old_time = time
92  old_temp = temp
93  old_dens = rho
94  old_ye = ye
95  old_rad = rkm
96  is_same_step = .false.
97  end if
98 
99  ! NOTE, MR: Probably one could implement a flag for an hydrostatic run here
100  ! to avoid calculating the rates again for this case.
101 
102  ! Update general things as indices and the chemical potential
103  if (is_same_step .eqv. .false.) then
104  ! t9_pow calculates powers of t9 and rho needed to evaluate reaction rates
105  call calc_t9_pow(temp)
106 
107  ! inter_partf interpolates the partition functions for a given temperature
108  call inter_partf (temp, pf)
109 
110  ! screen (by U.Frischknecht) calculates the screening coefficients hv
111  if(iscreen) call screen(temp,rho,nreac,ye,0) ! Calculates coefficient hv
112 
113  ! tabulated_index determines the boundaries for the temp interpolation
114  if (tabulated) call tabulated_index (temp)
115 
116  ! Get the chemical potential for theoretical weak rates
117  if (weak .and. (iwformat .eq. 2) .and. use_timmes_mue) then
118  call chempot(1.d9*temp,rho,ye,eta_e,eta_p)
119  mue = eta_e * temp * 1.d9 * unit%k_MeV
120  mue = mue + unit%mass_e
121  end if
122 
123  ! Interpolate neutrino quantities at given time
124  if (nuflag.ge.1) then
125  call nuflux(time, rkm) ! returns fluxnu(4)
126  call nutemp(time) ! returns tempnu(4)
127  call nucs()
128  end if
129  end if
130 
131  ! If no rate is present exit here
132  if (present(rrate_array).eqv..false.) return
133 
134  ! Get the source flag and origin of the rate, depending on the flag the calculation
135  ! of the rate differs
136  src = rrate_array(idx)%source
137  reac_origin = rrate_array(idx)%reac_src
138 
139  ! Calculate of the reaction rates
140  ! theoretical weak rates.
141  ! Here is the place to implement new type of reactions
142  if (reac_origin .eq. rrs_twr) then
143  call calculate_twr_rate(rrate_array(idx), temp, rho, ye, rat_calc,.true.)
144  ! tabulated rates
145  else if (reac_origin .eq. rrs_tabl) then
146  call calculate_tab_rate(rrate_array(idx), temp, rat_calc)
147  ! Neutrino reactions
148  else if (reac_origin .eq. rrs_nu) then
149  call calculate_nu_rate(rrate_array(idx),rat_calc)
150  ! Detailed balance rate
151  else if (reac_origin .eq. rrs_detb) then
152  call calculate_detailed_balance(temp,rrate_array,rrate_array(idx),rat_calc)
153  ! Fission rate (treat like reaclib)
154  else if (reac_origin .eq. rrs_fiss) then
155  call calculate_reacl_rate(rrate_array(idx),rat_calc)
156  ! Beta delayed neutron emission format (treat like reaclib)
157  else if (reac_origin .eq. rrs_wext) then
158  call calculate_reacl_rate(rrate_array(idx),rat_calc)
159  ! Additional alpha decays (treat like reaclib)
160  else if (reac_origin .eq. rrs_aext) then
161  call calculate_reacl_rate(rrate_array(idx),rat_calc)
162  ! Reaclib rate
163  else if (reac_origin .eq. rrs_reacl) then
164  call calculate_reacl_rate(rrate_array(idx),rat_calc)
165  ! Not known -> throw exception
166  else
167  call raise_exception("Reaction origin not known, got '"//int_to_str(reac_origin)//&
168  "'."//new_line("A")//"Reaction source is: "//src,&
169  "calculate_reaction_rate", 280011)
170  end if
171 
172  ! Cut the rate here and at the end already to avoid overflows
173  if(rat_calc.gt.rate_max_cutoff) rat_calc=rate_max_cutoff
174 
175  ! Save the result somewhere
176  rrate_array(idx)%cached_p = rat_calc
177 
178  ! Apply screening corrections
179  if(iscreen .eqv. .true.) rat_calc=rat_calc*dexp(hv(idx))
180 
181  ! Take care of double counting factor
182  rat_calc = rat_calc * rrate_array(idx)%one_over_n_fac
183 
184  ! For electron captures the amount of electrons, i.e., the electron density
185  ! has to be known.
186  elnd = rho * ye
187  if (trim(adjustl(src)) .eq. 'ec') rat_calc = rat_calc * elnd
188 
189  ! Apply partition functions for inverse rates and multiply density
190  select case (rrate_array(idx)%group)
191  case(1:3,11)
192  if (rrate_array(idx)%is_reverse) then
193  rat_calc = rat_calc * (pf(rrate_array(idx)%parts(2))*pf(rrate_array(idx)%parts(3))* &
194  pf(rrate_array(idx)%parts(4))*pf(rrate_array(idx)%parts(5)))/ &
195  pf(rrate_array(idx)%parts(1))
196  end if
197  case(4:7)
198  rat_calc = rat_calc * rho
199  if (rrate_array(idx)%is_reverse) then
200  rat_calc = rat_calc * (pf(rrate_array(idx)%parts(3))*pf(rrate_array(idx)%parts(4)) * &
201  pf(rrate_array(idx)%parts(5))*pf(rrate_array(idx)%parts(6))) / &
202  (pf(rrate_array(idx)%parts(1))*pf(rrate_array(idx)%parts(2)))
203  end if
204  case(8:9)
205  rat_calc = rat_calc * rho**2
206  if (rrate_array(idx)%is_reverse) then
207  rat_calc = rat_calc * (pf(rrate_array(idx)%parts(4))*pf(rrate_array(idx)%parts(5)) &
208  / (pf(rrate_array(idx)%parts(1))*pf(rrate_array(idx)%parts(2)) &
209  *pf(rrate_array(idx)%parts(3))))
210  end if
211  case(10)
212  rat_calc = rat_calc * rho**3
213  if (rrate_array(idx)%is_reverse) then
214  rat_calc = rat_calc * (pf(rrate_array(idx)%parts(5))*pf(rrate_array(idx)%parts(6))) &
215  / (pf(rrate_array(idx)%parts(1))*pf(rrate_array(idx)%parts(2)) &
216  *pf(rrate_array(idx)%parts(3))*pf(rrate_array(idx)%parts(4)))
217  end if
218  case default
219  ! Throw exception
220  call raise_exception("Got unknown reaclib chapter ("// &
221  int_to_str(rrate_array(idx)%group)//"). ", &
222  "calculate_reaction_rate",280009)
223  end select
224 
225  ! Finally check overflows or too low rates
226  ! to prevent bad rate fits producing NaN errors
227  if(rat_calc.gt.rate_max_cutoff) rat_calc=rate_max_cutoff
228 
229  ! Cut the rate if it is too low
230  if(rat_calc.lt.rate_min_cutoff) rat_calc=0.d0
231 
232  ! Cache the rate
233  rrate_array(idx)%cached = rat_calc
234 
235 end subroutine calculate_reaction_rate
236 
237 
238 
239 !>
240 !! This subroutine calculates the change in abundances (dYdt) due to
241 !! reaction rates at given temperature (temp) and density (rho).
242 !!
243 !! The underlying differential equation is given by:
244 !!
245 !! \f[
246 !! \mathrm{dYdt}_i = \underbrace{\sum _j N_j ^i \lambda _j Y_j}_\text{Decays and photodisintegrations} +
247 !! \underbrace{\sum _{j,k} \frac{N^i _{j,k}}{1+\delta _{jk}}\rho N_{\mathrm{A}} \langle \sigma v
248 !! \rangle _{j,k}Y_jY_k}_\text{two-body reactions}+\underbrace{\sum _{j,k,l}\frac{N^i_{j,k,l}}
249 !! {1+\Delta_{jkl}}\rho ^2N_{\mathrm{A}}^2\langle \sigma v\rangle _{j,k,l} Y_j Y_k Y_l}_\text{three-body reactions}
250 !! \f]
251 !!
252 !! where the amount of synthesized and destroyed nuclei N_j is stored in
253 !! global_class::rrate\%ch_amount, the reaction rates come from various sources,
254 !! but mostly from reaclib (see \ref network_init_module::network_init, nucstuff_class::calc_t9_pow).
255 !! The individual terms in the equation above are treated with the help of the reaclib chapters,
256 !! the first term is given by chapter 1-3, the second one by 4-7, the third one 8-9
257 !! (see also [Reaclib chapters](https://reaclib.jinaweb.org/help.php?topic=reaclib_format&intCurrentNum=0)).
258 !! <table>
259 !! <caption id="multi_row">Reaclib chapters</caption>
260 !! <tr><th> Chapter <th> Equation
261 !! <tr><td> 1 <td> \f$ e_1 \rightarrow e_2 \f$
262 !! <tr><td> 2 <td> \f$ e_1 \rightarrow e_2 + e_3 \f$
263 !! <tr><td> 3 <td> \f$ e_1 \rightarrow e_2 + e_3 + e_4 \f$
264 !! <tr><td> 4 <td> \f$ e_1 + e_2 \rightarrow e_3 \f$
265 !! <tr><td> 5 <td> \f$ e_1 + e_2 \rightarrow e_3 + e_4 \f$
266 !! <tr><td> 6 <td> \f$ e_1 + e_2 \rightarrow e_3 + e_4 + e_5 \f$
267 !! <tr><td> 7 <td> \f$ e_1 + e_2 \rightarrow e_3 + e_4 + e_5 +e_6\f$
268 !! <tr><td> 8 <td> \f$ e_1 + e_2 + e_3 \rightarrow e_4 (+ e_5 + e_6) \f$
269 !! </table>
270 !!
271 !! @note When single_zone_vars::evolution_mode is equal to EM_NSE,
272 !! this subroutine will ignore strong reactions and only
273 !! calculate the contribution of weak reactions.
274 !!
275 !! @note This routine can be used to calculate the jacobian of the original Reaclib format
276 !! without chapter 9-11 as well as the modern format with chapter 9-11.
277 !!
278 !! @see jacobi_init,
279 !! [Hix & Thielemann 1999](https://ui.adsabs.harvard.edu/abs/1999JCoAM.109..321H/abstract),
280 !! [Winteler 2013](https://edoc.unibas.ch/29895/),
281 !! [Lippuner & Roberts 2017](https://ui.adsabs.harvard.edu/abs/2017ApJS..233...18L/abstract)
282 !!
283 !! \b Edited:
284 !! - 12.01.14
285 !! - 26.07.22, MR: Cleaned up the subroutine
286 !! - 06.02.23, MR: Implemented parameter freeze_rate_temp.
287 !! .
288 subroutine abchange (time, itemp, rho, Ye, rkm, Y, dYdt, evolution_mode)
289  use global_class, only: nreac, rrate, net_names
291  implicit none
292 
293  real(r_kind),intent(in) :: time !< time [s]
294  real(r_kind),intent(in) :: itemp !< temperature in units of 10**9 K
295  real(r_kind),intent(in) :: rho !< baryon density [g/cm^3]
296  real(r_kind),intent(in) :: ye !< electron fraction
297  real(r_kind),intent(in) :: rkm !< current radius im km
298  real(r_kind),dimension(:),intent(in) :: y !< isotope abundances
299  real(r_kind),dimension(:),intent(inout) :: dydt !< change in abundances due to reaction rates
300  integer,intent(in) :: evolution_mode !< state of the network
301  !
302  real(r_kind) :: rat
303  integer :: i, j
304  real(r_kind) :: infty
305  real(r_kind) :: temp
306 
307  infty = huge(infty)
308 
309  dydt = 0.d0
310 
311  ! Freeze the rates at the minimum valid temperature, 1d-2GK
312  if (itemp.le.freeze_rate_temp) then
313  temp = freeze_rate_temp
314  if (.not. freeze_rate_indicator) then
315  print *,"Freezing rates at "//num_to_str(freeze_rate_temp)//" GK"
316  freeze_rate_indicator = .true.
317  endif
318  else
319  temp = itemp
320  end if
321 
322  ! Be sure to call the reaction rate calculation at least ones to initialize
323  ! (important for fission later on)
324  call calculate_reaction_rate(time, temp, rho, ye, rkm)
325 
326  ! Loop through all reactions
327  outer: do i=1,nreac
328 
329  ! Only consider weak reactions in NSE
330  if ((evolution_mode.eq.em_nse).and.(rrate(i)%is_weak.eqv..false.)) cycle outer
331 
332  ! Calculate the reaction rate
333  call calculate_reaction_rate(time, temp, rho, ye, rkm, rrate, i, rat)
334 
335  ! Check if one can ignore the rate
336  if (skip_rate(rat, rrate(i),y)) cycle outer
337 
338  ! Ignore negligible rates
339  if (rat .lt. rate_min_cutoff) cycle outer
340 
341  ! Don't do fission
342  if ((rrate(i)%reac_type .eq. rrt_nf) .or. &
343  (rrate(i)%reac_type .eq. rrt_bf) .or. &
344  (rrate(i)%reac_type .eq. rrt_sf)) then
345  cycle outer
346  end if
347 
348  ! Create DGL
349  select case (rrate(i)%group)
350  case(1:3,11)
351  do j = 1, 5
352  if (rrate(i)%parts(j) .eq. 0) exit
353  dydt(rrate(i)%parts(j)) = dydt(rrate(i)%parts(j)) + rat * &
354  rrate(i)%ch_amount(j) * y(rrate(i)%parts(1))
355  end do
356  case(4:7)
357  do j = 1, 6
358  if (rrate(i)%parts(j) .eq. 0) exit
359  dydt(rrate(i)%parts(j)) = dydt(rrate(i)%parts(j)) + rat * &
360  rrate(i)%ch_amount(j) * y(rrate(i)%parts(1)) * &
361  y(rrate(i)%parts(2))
362  end do
363  case(8:9)
364  do j = 1, 6
365  if (rrate(i)%parts(j) .eq. 0) exit
366  dydt(rrate(i)%parts(j)) = dydt(rrate(i)%parts(j)) + rat * &
367  rrate(i)%ch_amount(j) * y(rrate(i)%parts(1)) * &
368  y(rrate(i)%parts(2)) * y(rrate(i)%parts(3))
369  end do
370  case(10)
371  do j = 1, 6
372  if (rrate(i)%parts(j) .eq. 0) exit
373  dydt(rrate(i)%parts(j)) = dydt(rrate(i)%parts(j)) + rat * &
374  rrate(i)%ch_amount(j) * y(rrate(i)%parts(1)) * &
375  y(rrate(i)%parts(2)) * y(rrate(i)%parts(3)) * &
376  y(rrate(i)%parts(4))
377  end do
378  case default
379  ! Throw exception
380  call raise_exception("Got unknown reaclib chapter ("//&
381  int_to_str(rrate(i)%group)//"). "&
382  ,"abchange",280009)
383  end select
384 
385  ! Check for infinity rates
386  if ((rat .ge. infty) .or. (rat .ne. rat)) then
387  call raise_exception("The rate: "//new_line("A")//&
388  trim(adjustl(reaction_string(rrate(i))))//&
389  new_line("A")//"was infinity or NaN.",&
390  "abchange",280003)
391  end if
392  end do outer
393 
394  ! MR: Changed that fission reactions are not taken into account in NSE
395  if ((fissflag.ne.0) .and. (evolution_mode.ne.em_nse)) then
396  do i=1,nfiss ! loop over fission reactions
397  rat = 0.d0
398  do j=1,9
399  rat = rat +fissrate(i)%param(j)*t9_pow(j)
400  end do
401 
402  ! Check overflows
403  if (rat .lt. dlog(rate_max_cutoff)) then
404  rat = dexp(rat)
405  else
406  rat = rate_max_cutoff
407  end if
408 
409  if(rat.lt.rate_min_cutoff) rat=0.d0
410 
411  if ((fissrate(i)%reac_type .eq. rrt_bf) .or. (fissrate(i)%reac_type .eq. rrt_sf)) then
412  ! Check rate for infinity or nan
413  if ((rat .ge. infty) .or. (rat .ne. rat)) then
414  call raise_exception("Fission rate (spont. and b-delayed) of "//&
415  trim(adjustl(net_names(fissrate(i)%fissparts(1))))//&
416  " was infinity or NaN.","abchange",280004)
417  end if
418  if (y(fissrate(i)%fissparts(1)) .eq. 0) then
419  do j = 1,fissrate(i)%dimens
420  ! Calculate the equation
421  dydt(fissrate(i)%fissparts(j)) = &
422  dydt(fissrate(i)%fissparts(j)) + &
423  rat * fissrate(i)%ch_amount(j) * y(fissrate(i)%fissparts(1))
424  end do
425  end if
426  else if (fissrate(i)%reac_type .eq. rrt_nf) then ! n-induced fission
427  rat = rat * rho
428  ! Avoid multiplying when it will be zero anyways, this also prevents things to get done
429  ! when a rate is possible infinity
430  ! Check rate for infinity or nan
431  if ((rat .ge. infty) .or. (rat .ne. rat)) then
432  call raise_exception("Neutron induced fission rate of "//&
433  trim(adjustl(net_names(fissrate(i)%fissparts(2))))//&
434  " was infinity or NaN.","abchange",280005)
435  end if
436  if (y(fissrate(i)%fissparts(1))*y(fissrate(i)%fissparts(2)) .eq. 0) then
437  do j = 1,fissrate(i)%dimens
438  ! Calculate the equation
439  dydt(fissrate(i)%fissparts(j)) = &
440  dydt(fissrate(i)%fissparts(j)) + &
441  rat * fissrate(i)%ch_amount(j) * y(fissrate(i)%fissparts(1)) * y(fissrate(i)%fissparts(2))
442  end do
443  end if
444  end if
445 
446  end do
447  end if
448 
449 
450  return
451 
452 end subroutine abchange
453 
454 
455 
456 !> Function to decide whether a rate can contribute or not
457 !!
458 !! This function returns true if the rate should not
459 !! be considered in the differential equation.
460 !! This can happen by a small value of the rate or
461 !! by zero abundance of the reactants.
462 !!
463 !! @author M. Reichert
464 !! @date 14.02.23
465 function skip_rate(rat, rrate_in,Y) result(res)
467  implicit none
468  real(r_kind),intent(in) :: rat
469  type(reactionrate_type),intent(in) :: rrate_in
470  real(r_kind), dimension(net_size), intent(in) :: y
471  logical :: res
472  integer :: i
473  integer :: zero_count
474 
475  res = .false.
476  ! Ignore negligible rates
477  if (rat .lt. rate_min_cutoff) res = .true.
478 
479  ! Don't do fission
480  if ((rrate_in%reac_type .eq. rrt_nf) .or. &
481  (rrate_in%reac_type .eq. rrt_bf) .or. &
482  (rrate_in%reac_type .eq. rrt_sf)) then
483  res = .true.
484  end if
485 
486  ! Check if the reaction can be skipped
487  zero_count = 0
488  do i=1,get_nr_reactants(rrate_in%group)
489  if (y(rrate_in%parts(i)) .le. 0) zero_count = zero_count+1
490  if (zero_count .gt. 1) exit
491  end do
492  if (zero_count .gt. 1) res = .true.
493 
494 
495 end function skip_rate
496 
497 
498 !>
499 !! This subroutine calculates the entries in the jacobian and the
500 !! right-hand side of the numerical integration scheme (rhs).
501 !!
502 !! The jacobian is calculated by
503 !! \f[ J = \frac{\mathrm{dYdt}}{dY}. \f]
504 !! The values are directly stored into a sparse format (see \ref pardiso_class::vals).
505 !!
506 !! @note When single_zone_vars::evolution_mode is equal to EM_NSE,
507 !! this subroutine will ignore strong reactions and only
508 !! calculate the contribution of weak reactions.
509 !!
510 !! @note This routine can be used to calculate the jacobian of the original Reaclib format
511 !! without chapter 9-11 as well as the modern format with chapter 9-11.
512 !!
513 !! @see abchange,
514 !! [Hix & Thielemann 1999](https://ui.adsabs.harvard.edu/abs/1999JCoAM.109..321H/abstract),
515 !! [Winteler 2013](https://edoc.unibas.ch/29895/),
516 !! [Lippuner & Roberts 2017](https://ui.adsabs.harvard.edu/abs/2017ApJS..233...18L/abstract)
517 !!
518 !! \b Edited:
519 !! - 26.07.22, MR: Cleaned up the subroutine
520 !! - 06.02.23, MR: Implemented parameter freeze_rate_temp.
521 !! .
522 subroutine jacobi_init (time, itemp, rho, rkm, Y, Y_p, dYdt, rhs, h, evolution_mode)
526  use pardiso_class, only: dia, pt_e, pt_b, rows
529  use screening_module, only: iscreen, hv
530  use parameter_class, only: heating_mode
531 
532  real(r_kind),intent(in) :: time !< time [s]
533  real(r_kind),intent(in) :: itemp !< initial temperature in units of 10**9 K
534  real(r_kind),intent(in) :: rho !< baryon density [g/cm^3]
535  real(r_kind),intent(in) :: rkm !< current radius im km
536  real(r_kind),dimension(:),intent(in) :: y !< current isotope abundances
537  real(r_kind),dimension(:),intent(in) :: y_p !< isotope abundances for the previous step
538  real(r_kind),dimension(:),intent(inout) :: dydt !< change in abundances due to reaction rates
539  real(r_kind),dimension(:),intent(inout) :: rhs !< right-hand side of the num. integration scheme
540  real(r_kind),intent(in) :: h !< timestep size
541  integer,intent(in) :: evolution_mode !< Evolution mode of the network
542  ! Internal variables
543  integer :: i, j !< Loop variables
544  real(r_kind) :: d !< Diagonals
545  real(r_kind) :: temp !< Temperature [GK]
546  real(r_kind) :: rat !< Reaction rate
547  real(r_kind) :: ye !< electron fraction
548  type(reactionrate_type) :: rr_tmp !< Reaction rate instance
549  character*1,dimension(6) :: descra !< Descriptor for sparse matrix multiplication
550  real(r_kind) :: infty !< Infinity to check for errors
551  integer :: fl_c !< fission loop count
552  real(r_kind) :: l_1
553 
554 
555  info_entry("jacobi_init")
556 
557  ! Initialize variable for infinity checks
558  infty = huge(infty)
559 
560  ! Descriptor for sparse matrix multiplication
561  descra = (/"G"," "," ","F"," "," "/)
562  ! The diagonal value
563  d = 1.d0/h
564 
565 !-----compute electron fraction and molar density
566  ye= sum(isotope(1:net_size)%p_nr*y(1:net_size))
567 
568  ! Reset the qdot for the nuclear heating
569  call reset_qdot(time)
570 
571  ! Check Ye
572  if (ye.ne.ye) then
573  call raise_exception('Ye is NaN','jacobi_init',280006)
574  elseif (ye.lt.0) then
575  call raise_exception('Ye is negative ('//trim(adjustl(num_to_str(ye)))//").",&
576  'jacobi_init',280007)
577  end if
578 
579  ! Check Rho * ye
580  if(dlog10(rho*ye).ne.dlog10(rho*ye)) then
581  ! Raise an exception
582  call raise_exception('log10(rho*ye) is NaN.'//new_line("A")//&
583  "Density is : "//trim(adjustl(num_to_str(rho)))//" [g/ccm]."//new_line("A")//&
584  "Ye is : "//trim(adjustl(num_to_str(ye))),&
585  'jacobi_init',280009)
586  end if
587 
588  ! Freeze the rates at the minimum valid temperature, 1d-2GK
589  if (itemp.le.freeze_rate_temp) then
590  temp = freeze_rate_temp
591  if (.not. freeze_rate_indicator) then
592  print *,"Freezing rates at "//num_to_str(freeze_rate_temp)//" GK"
593  freeze_rate_indicator = .true.
594  endif
595  else
596  temp = itemp
597  end if
598 
599  ! Initialize dydt and vals
600  vals = 0.d0
601  dydt = 0.d0
602 
603  ! switch between different solvers
604  if(solver==0) then ! implicit Euler
605  do i=1,net_size
606  vals(dia(i)) = 1.d0/h
607  end do
608  elseif(solver==1) then ! Gear's method
609  l_1 = get_l1()
610  do i=1,net_size
611  vals(dia(i)) = l_1/h
612  end do
613  endif
614 
615 
616  ! Be sure to call the reaction rate calculation at least ones to initialize
617  ! (important for fission later on)
618  call calculate_reaction_rate(time, temp, rho, ye, rkm)
619 
620  ! Loop through reactions
621  outer: do i=1,nreac
622  rr_tmp = rrate(i)
623 
624  ! Consider only weak reactions in NSE
625  if ((evolution_mode.eq.em_nse).and.(rr_tmp%is_weak.eqv..false.)) cycle outer
626 
627  ! Calculate the reaction rate
628  call calculate_reaction_rate(time, temp, rho, ye, rkm, rrate, i, rat)
629 
630  ! Check if one can ignore the rate
631  if (skip_rate(rat, rrate(i),y)) cycle outer
632 
633  ! Create the jacobian and the DGLs
634  select case (rr_tmp%group)
635  ! Chapter 1-3: one educt
636  case(1:3,11)
637  do j = 1, 5
638  if (rr_tmp%parts(j) .eq. 0) exit
639  dydt(rr_tmp%parts(j)) = dydt(rr_tmp%parts(j)) + rat * &
640  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1))
641 
642  vals(rr_tmp%cscf_ind(1,j)) = vals(rr_tmp%cscf_ind(1,j)) - rat * &
643  rr_tmp%ch_amount(j)
644  end do
645  ! Chapter 1-4: two educts
646  case(4:7)
647  do j = 1, 6
648  if (rr_tmp%parts(j) .eq. 0) exit
649  dydt(rr_tmp%parts(j)) = dydt(rr_tmp%parts(j)) + rat * &
650  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
651  y(rr_tmp%parts(2))
652 
653  vals(rr_tmp%cscf_ind(1,j)) = vals(rr_tmp%cscf_ind(1,j)) - rat * &
654  rr_tmp%ch_amount(j) * y(rr_tmp%parts(2))
655  vals(rr_tmp%cscf_ind(2,j)) = vals(rr_tmp%cscf_ind(2,j)) - rat * &
656  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1))
657  end do
658  ! Chapter 8-9: three educts
659  case(8:9)
660  do j = 1, 6
661  if (rr_tmp%parts(j) .eq. 0) exit
662  dydt(rr_tmp%parts(j)) = dydt(rr_tmp%parts(j)) + rat * &
663  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
664  y(rr_tmp%parts(2)) * y(rr_tmp%parts(3))
665 
666  vals(rr_tmp%cscf_ind(1,j)) = vals(rr_tmp%cscf_ind(1,j)) - rat * &
667  rr_tmp%ch_amount(j) * y(rr_tmp%parts(2)) * &
668  y(rr_tmp%parts(3))
669  vals(rr_tmp%cscf_ind(2,j)) = vals(rr_tmp%cscf_ind(2,j)) - rat * &
670  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
671  y(rr_tmp%parts(3))
672  vals(rr_tmp%cscf_ind(3,j)) = vals(rr_tmp%cscf_ind(3,j)) - rat * &
673  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
674  y(rr_tmp%parts(2))
675  end do
676  ! Chapter 10: four educts
677  case(10)
678  do j = 1, 6
679  if (rr_tmp%parts(j) .eq. 0) exit
680  dydt(rr_tmp%parts(j)) = dydt(rr_tmp%parts(j)) + rat * &
681  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
682  y(rr_tmp%parts(2)) * y(rr_tmp%parts(3)) * y(rr_tmp%parts(4))
683 
684  vals(rr_tmp%cscf_ind(1,j)) = vals(rr_tmp%cscf_ind(1,j)) - rat * &
685  rr_tmp%ch_amount(j) * y(rr_tmp%parts(2)) * &
686  y(rr_tmp%parts(3)) * y(rr_tmp%parts(4))
687  vals(rr_tmp%cscf_ind(2,j)) = vals(rr_tmp%cscf_ind(2,j)) - rat * &
688  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
689  y(rr_tmp%parts(3)) * y(rr_tmp%parts(4))
690  vals(rr_tmp%cscf_ind(3,j)) = vals(rr_tmp%cscf_ind(3,j)) - rat * &
691  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
692  y(rr_tmp%parts(2)) * y(rr_tmp%parts(4))
693  vals(rr_tmp%cscf_ind(4,j)) = vals(rr_tmp%cscf_ind(4,j)) - rat * &
694  rr_tmp%ch_amount(j) * y(rr_tmp%parts(1)) * &
695  y(rr_tmp%parts(2)) * y(rr_tmp%parts(3))
696  end do
697  case default
698  ! Throw exception
699  call raise_exception("Got unknown reaclib chapter ("//&
700  int_to_str(rr_tmp%group)//"). " &
701  ,"jacobi_init",280009)
702  end select
703 
704  ! Cache the rate with the densities included
705  rrate(i)%cached = rat
706 
707  ! Check for infinity rates
708  ! In jacobi init it may not occur as there are several statements setting
709  ! the rate to 1e99 if it is greater than this
710  if ((rat .gt. infty) .or. (rat .ne. rat)) then
711  if (iscreen) then
712  call raise_exception("The rate: "//new_line("A")//&
713  trim(adjustl(reaction_string(rrate(i))))//&
714  new_line("A")//"was infinity or NaN."//new_line("A")//&
715  "Logarithm of screening factor was "//num_to_str(hv(i)),&
716  "jacobi_init",280003)
717  else
718  call raise_exception("The rate: "//new_line("A")//&
719  trim(adjustl(reaction_string(rrate(i))))//&
720  new_line("A")//"was infinity or NaN.",&
721  "jacobi_init",280003)
722  end if
723  end if
724 
725  ! Call the function to calculate the qdot for heating
726  call calculate_qdot(rrate(i),y,h)
727 
728  end do outer
729 
730  !Fission reactions are not taken into account in NSE
731  if ((fissflag.ne.0) .and. (evolution_mode.ne.em_nse)) then
732  fissloop: do i=1,nfiss ! loop over fission reactions to implement correct equations for the fragments
733  rat = 0.d0
734  do j=1,9
735  rat = rat +fissrate(i)%param(j)*t9_pow(j)
736  end do
737 
738  ! Check overflows
739  if (rat .lt. dlog(rate_max_cutoff)) then
740  rat = dexp(rat)
741  else
742  ! Say something for higher verbose levels
743  if (verbose_level .ge. 2) then
744  if (fissrate(i)%fissparts(1) .ne. ineu) then
745  write(*,*)"Fission rate is overflowing. Fissioning nucleus is "//&
746  trim(adjustl(isotope(fissrate(i)%fissparts(1))%name))
747  else
748  write(*,*)"Fission rate is overflowing. Fissioning nucleus is "//&
749  trim(adjustl(isotope(fissrate(i)%fissparts(2))%name))
750  end if
751  end if
752  rat = rate_max_cutoff
753  end if
754 
755  if(rat.ge.rate_min_cutoff) then
756 
757  if ((fissrate(i)%reac_type .eq. rrt_bf) .or. (fissrate(i)%reac_type .eq. rrt_sf)) then ! Spontaneous and beta delayed fission
758  ! Check if the parent nucleus is present
759  ! If not, the reaction is not possible and may not be evaluated. Note that this
760  ! can cause problems as even for a zero value the jacobian will have an entry.
761  ! Do this also only for implicit euler as gear calls the jacobian with a delta
762  ! instead of abundances.
763  if ((y(fissrate(i)%fissparts(1)) .le. 0) .and. (solver .eq. 0)) then
764  ! Since we ordered them, the most important nuclei are at the begining of the
765  ! fissparts. We can therefore approximate the jacobian by the first few entries.
766  fl_c = min(fissrate(i)%dimens, fiss_neglect)
767  else
768  ! If the parent nucleus is present, we can calculate the full jacobian
769  fl_c = fissrate(i)%dimens
770  end if
771 
772  do j = 1, fl_c
773  dydt(fissrate(i)%fissparts(j)) = &
774  dydt(fissrate(i)%fissparts(j)) + &
775  rat * fissrate(i)%ch_amount(j) * y(fissrate(i)%fissparts(1))
776  vals(fissrate(i)%cscf_ind(1,j)) = vals(fissrate(i)%cscf_ind(1,j)) - rat * fissrate(i)%ch_amount(j)
777  end do
778 
779  else if (fissrate(i)%reac_type .eq. rrt_nf) then ! n-induced fission
780  rat = rat * rho
781  ! Also check here if the parent nucleus is present
782  ! If not, the reaction is not possible and may not be evaluated. Note that this
783  ! can cause problems as even for a zero value the jacobian will have an entry.
784  ! Therefore we set at least the first few entries.
785  if ((y(fissrate(i)%fissparts(1)) * y(fissrate(i)%fissparts(2)) .le. 0) .and. (solver .eq. 0)) then
786  ! Since we ordered them, the most important nuclei are at the begining of the
787  ! fissparts. We can therefore approximate the jacobian by the first few entries.
788  fl_c = min(fissrate(i)%dimens, fiss_neglect)
789  else
790  ! If the parent nucleus is present, we can calculate the full jacobian
791  fl_c = fissrate(i)%dimens
792  end if
793 
794  do j = 1,fl_c
795  dydt(fissrate(i)%fissparts(j)) = &
796  dydt(fissrate(i)%fissparts(j)) + &
797  rat * fissrate(i)%ch_amount(j) * y(fissrate(i)%fissparts(1)) * y(fissrate(i)%fissparts(2))
798  vals(fissrate(i)%cscf_ind(1,j)) = vals(fissrate(i)%cscf_ind(1,j)) - rat * fissrate(i)%ch_amount(j) * y(fissrate(i)%fissparts(2))
799  vals(fissrate(i)%cscf_ind(2,j)) = vals(fissrate(i)%cscf_ind(2,j)) - rat * fissrate(i)%ch_amount(j) * y(fissrate(i)%fissparts(1))
800  end do
801 
802  end if
803 
804  end if
805 
806  if(rat.lt.rate_min_cutoff) rat=0.d0
807  fissrate(i)%cached = rat
808  end do fissloop
809  end if
810 
811 
812  ! switch between different solvers
813  if(solver==0) then ! implicit Euler
814  ! additional check for input into pardiso
815  if (verbose_level .ge. 2) then
816  do i=1,net_size
817  if (dydt(i).ne.dydt(i)) then
818  call raise_exception("dYdt of "//trim(adjustl(net_names(i)))//" is NaN.",&
819  "jacobi_init",280010)
820  end if
821  end do
822  end if
823  rhs = dydt + d*(y_p - y)
824  ! computes matrix-vector product for a sparse matrix in the CSC format:
825  call mkl_dcscmv('T',net_size,net_size,1.d0,descra,vals,rows,pt_b, &
826  pt_e,y,1.d0,rhs)
827  elseif(solver==1) then ! Gear's method
828  rhs = -(y - get_predictor_y())*(l_1/h) + (dydt - get_predictor_dydt()/h)
829  endif
830  dydt = dydt + d*(y_p-y)
831 
832  info_exit("jacobi_init")
833 
834 end subroutine jacobi_init
835 
836 
837 end module jacobian_class
parameter_class::iwformat
integer iwformat
defines format of the weak rates (0 = tabulated, 1 = log<ft>)
Definition: parameter_class.f90:81
gear_module::get_predictor_dydt
real(r_kind) function, dimension(net_size), public get_predictor_dydt()
Determines the predicted dydt_next.
Definition: gear_module.f90:332
screening_module
Module to calculate electron screening.
Definition: screening_module.f90:17
pardiso_class::vals
real(r_kind), dimension(:), allocatable, public vals
contains non-zero matrix elements (of the Jacobian)
Definition: pardiso_class.f90:30
parameter_class::freeze_rate_temp
real(r_kind) freeze_rate_temp
Tmperature at which rates get frozen (for reacl. rates this should be 1d-2GK)
Definition: parameter_class.f90:84
global_class::net_names
character *5, dimension(:), allocatable, public net_names
list of isotopes contained in the network
Definition: global_class.f90:95
rrt_nf
#define rrt_nf
Definition: macros.h:78
global_class::reactionrate_type
reaction rate type
Definition: global_class.f90:44
global_class::rrate
type(reactionrate_type), dimension(:), allocatable, public rrate
array containing all reaction rates used in the network
Definition: global_class.f90:65
nuflux_class::calculate_nu_rate
subroutine, public calculate_nu_rate(rrate, rat_calc)
Calculates the cross section times the neutrino flux.
Definition: nuflux_class.f90:336
reaclib_rate_module
Module that deals with reaclib reaction rates.
Definition: reaclib_rate_module.f90:13
nuclear_heating
Takes care of the temperature and entropy updates due to the nuclear energy release.
Definition: nuclear_heating.f90:11
jacobian_class::rate_min_cutoff
real(r_kind), parameter, private rate_min_cutoff
Minimum cutoff for the reaction rates.
Definition: jacobian_class.f90:25
rrs_reacl
#define rrs_reacl
Definition: macros.h:49
error_msg_class
Error handling routines.
Definition: error_msg_class.f90:16
jacobian_class::old_dens
real(r_kind), private old_dens
Definition: jacobian_class.f90:28
benam_class::reaction_string
character(50) function, public reaction_string(reac)
Return a string to represent a given reaction.
Definition: benam_class.f90:119
fission_rate_module
Module to deal with fission reactions.
Definition: fission_rate_module.f90:16
nucstuff_class::pf
real(r_kind), dimension(:), allocatable, public pf
partition functions
Definition: nucstuff_class.f90:18
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
rrs_aext
#define rrs_aext
Definition: macros.h:56
pardiso_class::dia
integer, dimension(:), allocatable, public dia
dia(j) gives the index into vals that contains the (j,j) diagonal element of the matrix
Definition: pardiso_class.f90:34
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
jacobian_class::skip_rate
logical function skip_rate(rat, rrate_in, Y)
Function to decide whether a rate can contribute or not.
Definition: jacobian_class.f90:466
jacobian_class::old_temp
real(r_kind), private old_temp
Definition: jacobian_class.f90:28
fission_rate_module::nfiss
integer, public nfiss
Amount of fission rates.
Definition: fission_rate_module.f90:68
pardiso_class::pt_e
integer, dimension(:), allocatable, public pt_e
pt_e(j)-pt_b(j) gives the index into vals that contains the LAST non-zero element of column j of the ...
Definition: pardiso_class.f90:33
parameter_class::use_timmes_mue
logical use_timmes_mue
Use electron chemical potentials from timmes EOS for theoretical weak rates.
Definition: parameter_class.f90:96
jacobian_class::abchange
subroutine, public abchange(time, itemp, rho, Ye, rkm, Y, dYdt, evolution_mode)
This subroutine calculates the change in abundances (dYdt) due to reaction rates at given temperature...
Definition: jacobian_class.f90:289
jacobian_class::old_time
real(r_kind), private old_time
Definition: jacobian_class.f90:28
global_class::ineu
integer, public ineu
Definition: global_class.f90:94
global_class::isotope
type(isotope_type), dimension(:), allocatable, public isotope
all nuclides used in the network
Definition: global_class.f90:34
tw_rate_module::mue
real(r_kind), public mue
chemical potential of the electron
Definition: tw_rate_module.f90:62
nucstuff_class
Module with helper functions such as rate tabulation, partition functions, and theoretical weak rates...
Definition: nucstuff_class.f90:11
nuflux_class
Contains variables and parameters related to neutrino fluxes.
Definition: nuflux_class.f90:14
pardiso_class::jind
integer, dimension(:,:), allocatable, public jind
jind(i,j) contains the index of jacobian entry in vals
Definition: pardiso_class.f90:35
rrs_wext
#define rrs_wext
Definition: macros.h:55
detailed_balance::calculate_detailed_balance
subroutine, public calculate_detailed_balance(temp, rrate_array, inverse_rate, rate)
Calculate the inverse rate from the forward one via detailed balance.
Definition: detailed_balance.f90:450
tw_rate_module::weak
logical, public weak
switch for weak rates
Definition: tw_rate_module.f90:58
jacobian_class::old_ye
real(r_kind), private old_ye
Definition: jacobian_class.f90:28
detailed_balance
Module that deals with inverse reaction rates.
Definition: detailed_balance.f90:57
gear_module::get_l1
real(r_kind) function, public get_l1()
The current l_1 (in Fortran: l(2))
Definition: gear_module.f90:281
rrs_twr
#define rrs_twr
Definition: macros.h:52
global_class::net_size
integer, public net_size
total number of isotopes (network size)
Definition: global_class.f90:93
effphase_class
Calculate the effective phase space integral needed for the log(ft) weak rates.
Definition: effphase_class.f90:18
parameter_class::unit
type(unit_type), public unit
constants and unit conversion factors
Definition: parameter_class.f90:54
jacobian_class::rate_max_cutoff
real(r_kind), parameter, private rate_max_cutoff
Maximum cutoff for the reaction rates.
Definition: jacobian_class.f90:26
rrs_nu
#define rrs_nu
Definition: macros.h:51
gear_module::get_predictor_y
real(r_kind) function, dimension(net_size), public get_predictor_y()
Determines the predicted y_next.
Definition: gear_module.f90:314
fission_rate_module::fissrate
type(fissionrate_type), dimension(:), allocatable, public fissrate
Array storing fission reactions.
Definition: fission_rate_module.f90:39
jacobian_class::old_rad
real(r_kind), private old_rad
Definition: jacobian_class.f90:28
error_msg_class::num_to_str
character(:) function, allocatable, public num_to_str(num)
Converts a given real to a string with format "(1pE10.2)".
Definition: error_msg_class.f90:205
nuclear_heating::reset_qdot
subroutine reset_qdot(time)
Reset the qdot variable.
Definition: nuclear_heating.f90:155
tabulated_rate_module::tabulated
logical, public tabulated
switch for tabulated rates
Definition: tabulated_rate_module.f90:39
parameter_class::heating_mode
integer heating_mode
Mode for heating: 0 - no heating, 1 - heating using an entropy equation, 2 - heating from the energy ...
Definition: parameter_class.f90:148
pardiso_class
Contains subroutines for sparse matrix assembly and the solver core.
Definition: pardiso_class.f90:24
pardiso_class::rows
integer, dimension(:), allocatable, public rows
rows(i) is the number of the row in the matrix that contains the i-th value in vals
Definition: pardiso_class.f90:31
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
chempot
subroutine chempot(temp, den, ye, etaele, etapos)
Given a temperature temp [K], density den [g/cm**3], and a composition characterized by y_e,...
Definition: chem_pot.f90:25
screening_module::hv
real(r_kind), dimension(:), allocatable, public hv
Screening correction.
Definition: screening_module.f90:20
nuclear_heating::calculate_qdot
subroutine calculate_qdot(rrate, Y, h)
Definition: nuclear_heating.f90:201
jacobian_class::freeze_rate_indicator
logical, private freeze_rate_indicator
Indicator for debug statement.
Definition: jacobian_class.f90:27
fission_rate_module::fiss_neglect
integer, parameter, public fiss_neglect
Amount of fission fragments not to be neglected.
Definition: fission_rate_module.f90:66
jacobian_class::jacobi_init
subroutine, public jacobi_init(time, itemp, rho, rkm, Y, Y_p, dYdt, rhs, h, evolution_mode)
This subroutine calculates the entries in the jacobian and the right-hand side of the numerical integ...
Definition: jacobian_class.f90:523
nucstuff_class::get_nr_reactants
integer function get_nr_reactants(group)
Get number of reactants of the reaction based on the reaclib chapter.
Definition: nucstuff_class.f90:301
jacobian_class
Contains subroutines to assemble the system Jacobian and changes in the abundances.
Definition: jacobian_class.f90:12
nucstuff_class::t9_pow
real(r_kind), dimension(9), public t9_pow
Powers of T, used for the rates.
Definition: nucstuff_class.f90:15
screening_module::screen
subroutine, public screen(t9, rho, n, ye, mode)
This function calculates the screening coefficients hv.
Definition: screening_module.f90:78
rrs_fiss
#define rrs_fiss
Definition: macros.h:54
tabulated_rate_module
This module contains everything for the tabulated rates that can replace reaclib rates.
Definition: tabulated_rate_module.f90:28
pardiso_class::pt_b
integer, dimension(:), allocatable, public pt_b
pt_b(j) gives the index into vals that contains the FIRST non-zero element of column j of the matrix
Definition: pardiso_class.f90:32
nucstuff_class::inter_partf
subroutine, public inter_partf(temp, interpol)
Calculates partition function.
Definition: nucstuff_class.f90:132
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
global_class::nreac
integer, public nreac
total number of reactions
Definition: global_class.f90:98
reaclib_rate_module::calculate_reacl_rate
subroutine calculate_reacl_rate(rrate, rat_calc)
Calculate a reaclib rate.
Definition: reaclib_rate_module.f90:229
tw_rate_module
This module contains everything for the theoretical weak rates that are added into the rate array.
Definition: tw_rate_module.f90:23
rrt_bf
#define rrt_bf
Definition: macros.h:79
rrt_sf
#define rrt_sf
Definition: macros.h:80
nucstuff_class::calc_t9_pow
subroutine, public calc_t9_pow(t9)
A helper to compute powers of temperature used in the reaction rates.
Definition: nucstuff_class.f90:190
jacobian_class::calculate_reaction_rate
subroutine, private calculate_reaction_rate(time, temp, rho, Ye, rkm, rrate_array, idx, rat_calc)
Subroutine to calculate the reaction rates.
Definition: jacobian_class.f90:56
rrs_detb
#define rrs_detb
Definition: macros.h:53
parameter_class::nuflag
integer nuflag
defines type of neutrino reactions used
Definition: parameter_class.f90:85
screening_module::iscreen
logical, public iscreen
Flag whether screening is enabled or not.
Definition: screening_module.f90:24
rrs_tabl
#define rrs_tabl
Definition: macros.h:50
gear_module
gear_module contains adaptive high-order Gear solver
Definition: gear_module.f90:37
parameter_class
Contains all runtime parameters as well as phys and math constants.
Definition: parameter_class.f90:24
tw_rate_module::calculate_twr_rate
subroutine, public calculate_twr_rate(rrate, temp, rho, Ye, rat_calc, nuloss)
Calculate the theoretical weak rate.
Definition: tw_rate_module.f90:485
benam_class
Subroutines needed to initialise the network.
Definition: benam_class.f90:11