network_init_module.f90
Go to the documentation of this file.
1 !> @file network_init_module.f90
2 !!
3 !! The error file code for this file is ***W30***.
4 !!
5 !! @brief \ref network_init_module contains \ref network_init and
6 !! supplementary functions to set up and initialize the network
7 !! @author Christian Winteler
8 !!
9 !! \b Created: 23.02.09
10 !! \b Edited:
11 !! - 15.06.17
12 !! - MR 11.01.20 - introduced error_msg_class
13 !! - MR 24.01.21 - splitted things to new rate modules
14 !! .
15 
16 
17 !> Module to prepare the reaction network
18 !!
19 !! This module contains subroutines that call other modules initialization.
20 !! In addition it reads reaction rates and many other things.
21 #include "macros.h"
25  implicit none
26 
27  !
28  ! Public and private fields and methods of the module
29  !
30  public:: &
32  private:: &
34 
35 contains
36 
37 
38 !>
39 !! Main initialising subroutine. calls reading subroutines and fills the
40 !! reactionrate array.
41 !!
42 !! Reads included nuclei, Reaclib, theoretical weak rates,
43 !! neutrino rates, tabulated rates, fission rates (and more)
44 !! and prepares in this way the reaction rates
45 !! \ref global_class::rrate.
46 !!
47 !! @returns \ref global_class::rrate
48 !!
49 !! \b Edited:
50 !! - 14.04.15
51 !! - OK 15.06.17, made into a module
52 !! .
53 subroutine network_init()
54 
61  use parameter_class, only: net_source
67  use format_class, only: load_format
68  use nucstuff_class, only: init_nucstuff
70 
71  !
72  integer :: alloc_stat !< Allocation state
73  integer :: fisscount !< Number of fission reactions
74 !===========================procedure division==================================
75  info_entry("network_init")
76 
77  !-- loads custom formats my_format(:)
78  call load_format()
79  !-- returns nuclide data in isotope(:)
81  !-- returns Amin and Amax for each isotopic chain in minmax
82  call get_minmax()
83  !-- Initialize nucstuff
84  call init_nucstuff()
85 
86  !-- Count the total amount of rates
87  nreac = 0
88 
89  !-- Count and read reaclib rates
90  call init_reaclib_rates()
91  !-- Count and read alpha decay rates
93  !-- Count and read tabulated rates
95  !-- Count and read neutrino rates
96  call init_nuflux()
97  !-- Count and read external beta decays
98  call init_ext_beta_rates()
99  !-- Count and read fission rates
100  call init_fission_rates()
101  !-- Count and read theoretical weak rates
103  !-- Initialize inverse reactions
104  call init_inverse_rates()
105 
106 
107  ! MR: Note that the following order is important.
108  ! For example, TWR have to be merged before neutrino rates!
109  ! Otherwise the results change. (Tested with Example_CCSN_wind_bliss)
110  ! Furthermore, inverse rates have to be merged at the very end as
111  ! they rely on already computed forward rates in the calculation
112  ! of the Jacobian.
113  !
114  !-- Merge reaclib rates into rrate
116  !-- Merge alpha decays
118  !-- Merge external beta decays
120  !-- Merge tabulated rates into rrate
122  !-- Merge theoretical weak rates into rrate
124  !-- Merge neutrino reactions into rrate
126  !-- Merge fission rates into rrate
127  call merge_fission_rates(rrate,nreac,fisscount)
128  !-- Merge inverse rates (detailed balance) into rrate
130 
131  ! Tell how many rates there are
132  if (verbose_level.ge.1) then
133  call write_data_to_std_out("Total reactions after merge",int_to_str(nreac+fisscount))
134  endif
135 
136  ! Initialize screening
137  call init_screening(nreac)
138 
139  if (verbose_level.gt.2) then
140  !----- print list of reactions - debug_all-reactions.txt and debug_weak-reactions.txt
141  call print_reactions()
142  !----- print reactions for debugging - debug-react.dat
143  call print_debug()
144  end if
145 
146 
147  info_exit("network_init")
148 
149 end subroutine network_init
150 
151 
152 !>
153 !! All the necessary initializations and settings before the main loop
154 !!
155 !! To initialize it calls the init subroutines from other modules,
156 !! e.g., \ref readini::readini_init, \ref analysis::analysis_init.
157 !! It also prepares the first time depending on \ref parameter_class::initemp
158 !! and it fills the abundance array \ref single_zone_vars::y and
159 !! \ref single_zone_vars::y_p.
160 !!
161 !! \b Edited:
162 !! - OK 15.06.2017
163 !! - OK 27.08.2017
164 !! .
172 use global_class, only: net_size, ineu, ipro
173 use flow_module, only: flow_init
178 use analysis
181 use nucstuff_class
182 use pardiso_class
185 use nuclear_heating
187 use readini
188 use parser_module
189 use gear_module, only: init_gear_solver
190 implicit none
191 integer :: i
192 real(r_kind) :: t_i
193 real(r_kind) :: t9_i
194 real(r_kind) :: rho_i
195 real(r_kind) :: rkm_i
196 real(r_kind) :: ye_i
197 integer :: alloc_stat
198 real(r_kind) :: dummy_hot, dummy_cold,dummy_temp !< Helper variables
199  !< to get temperature starting point
200 integer :: dummy_index_cold,dummy_index_hot !< Helper variables
201  !< to get temperature starting point
202 ! Variables used for the Expansion/EOS----
203 type(timmes_eos_state) :: inistate
204 integer :: eos_status
205 logical :: init,converged
206 
207  ! define units
208  call unit_define()
209 
210  ! initializations
211  evolution_mode= em_init
212  net_size= 0
214  ! initialise Clenshaw-Curtis integration method
215  !call init_cc(ncc)
216 
217  ! initialise mergesort module
218  call mergesort_init()
219 
220  ! initialise network, returns net_size (and network data in modules)
221  call network_init()
222 
223  ! initialise readini module (for opening debug files)
224  call readini_init()
225 
226  ! initialise analysis module
227  call analysis_init()
228 
229 
230  ! sparse prepares the usage of Compressed Sparse Column Format
231  call sparse()
232 
233  ! initialise flow subroutine, has to get called after sparse!
234  if (flow_every.gt.0) then
235  call flow_init()
236 #ifdef USE_HDF5
237  elseif (h_flow_every .gt. 0) then
238  call flow_init()
239 #endif
240  end if
241 
242  ! allocate arrays
243  allocate(y_p(net_size),stat=alloc_stat)
244  if ( alloc_stat /= 0) call raise_exception('Allocating "Y_p" failed.',&
245  "prepare_simulation",300001)
246  allocate(y(net_size),stat=alloc_stat)
247  if ( alloc_stat /= 0) call raise_exception('Allocating "Y" failed.',&
248  "prepare_simulation",300001)
249  allocate(dydt(net_size),stat=alloc_stat)
250  if ( alloc_stat /= 0) call raise_exception('Allocating "dYdt" failed.',&
251  "prepare_simulation",300001)
252  allocate(f(net_size),stat=alloc_stat)
253  if ( alloc_stat /= 0) call raise_exception('Allocating "f" failed.',&
254  "prepare_simulation",300001)
255 
256  ! read nuclear data needed for nse subroutine
257  call nse_init()
258 
259 
260  if (trim(trajectory_mode).EQ.'from_file') then
261  !-- 'initemp_hot' parameter controls the starting point of the trajectory:
262  ! 0: start from the beginning;
263  ! >0: start from the last T peak, at which the T exceeded initemp
264 
265  !-- 'initemp_cold' controls the minimum allowed temperature in case the
266  ! trajectory is too cold. If this is the case, the trajectory will start at the
267  ! peak temperature that obeys T>initemp_cold and T<initemp_hot.
268  init_index= 1
269  dummy_index_cold= 1
270  dummy_index_hot= 1
271  dummy_temp= -99
272  if (initemp_hot.gt.0d0) then
273  dummy_hot = log(initemp_hot)
274  dummy_cold= log(initemp_cold)
275 
276  do i=1,zsteps
277  ! Find peak temperature
278  if ((ztemp(i) .gt. dummy_temp) .and. (ztemp(i) .gt. dummy_cold)) then
279  dummy_temp= ztemp(i)
280  dummy_index_cold= i
281  end if
282 
283  if (ztemp(i).gt.dummy_hot) dummy_index_hot= i
284  end do
285 
286  ! If there is a high temperature (initemp_hot) included, use the init index
287  ! at this point in temperature, otherwise use maximum of trajectory
288  if ((dummy_index_hot .eq. 1) .and. (ztemp(1) .lt. dummy_hot)) then
289  init_index = dummy_index_cold
290  else
291  init_index = dummy_index_hot
292  end if
293 
294 
295  if(init_index.eq.zsteps) then
296  call raise_exception('Temperature of the trajectory is too high (>initemp_hot).'//new_line("A")//&
297  'The last temperature of the trajectory is '&
298  //trim(adjustl(num_to_str(dexp(ztemp(zsteps)))))//" GK."//&
299  new_line("A")//"Initemp is "&
300  //trim(adjustl(num_to_str(initemp_hot)))//" GK. "//&
301  "Check the trajectory and units.",&
302  "prepare_simulation",300003)
303  endif
304  endif
305  t_i= ztime(init_index)
306  t9_i= dexp(ztemp(init_index))
307  rho_i= dexp(zdens(init_index))
308  rkm_i= dexp(zrad(init_index))
309  ye_i= zye(init_index)
310 
311  ! Check if the temperature is very far from what is expected
312  ! and if initemp_hot is the temperature to start with.
313  if (t9_i .gt. initemp_hot) then
314  ! Is the temperature of the grid point of the trajectory
315  ! within 0.0001 of the desired temperature?
316  if (abs(t9_i-initemp_hot) .gt. 1d-9) then
317  ! Get the correct time
318  call inverse_interp1d(zsteps,ztemp,initemp_hot*(1+1d-9),ztime,t_i)
319  ! Get the correct temperature, density, radius, ye
320  call interp1d (zsteps,ztime,t_i,ztemp,t9_i)
321  call interp1d (zsteps,ztime,t_i,zdens,rho_i)
322  call interp1d (zsteps,ztime,t_i,zrad,rkm_i,itype=itype_linear)
323  call interp1d (zsteps,ztime,t_i,zye,ye_i,.true.,itype=itype_linear)
324  end if
325  end if
326 
327  if (verbose_level.ge.1) then
328  call write_data_to_std_out("Thermodynamic trajectory","from file")
329  call write_data_to_std_out("Starting index",int_to_str(init_index))
330  end if
331  else if (trim(trajectory_mode).EQ.'analytic') then
332 
333  ! Find the time of T=T_init
335 
336  ! For, e.g., constant temperature the above NR won't work
337  if (converged) then
338  ! take the later value in case it is too hot at the initial one
339  t_i = max(t_i,t_analytic)
340  else
341  ! if the convergence failed, just start at the initial time
342  t_i= t_analytic
343  end if
344 
345  ! get the density, temperature and radius at the initial time
346  t9_i = parse_string(t9_analytic,t_i)
347  rho_i= parse_string(rho_analytic,t_i)
348  rkm_i= parse_string(rkm_analytic,t_i)
349  ye_i = parse_string(ye_analytic,t_i)
350 
351  if (verbose_level.ge.1) then
352  call write_data_to_std_out("Thermodynamic trajectory","analytic")
353  end if
354  else
355  call raise_exception("Unknown trajectory_mode '"//trim(adjustl(trajectory_mode))//"'.",&
356  "prepare_simulation",300004)
357  end if
358 
359  ! initialise expansion module (for opening debug files)
360  call expansion_init()
361 
362  ! start timing
363  call system_clock(cl_start,cl_rate,cl_cmax)
364 
365  time= t_i
366  time_p= t_i
367  t9= t9_i
368  t9_p= t9_i
369  rhob= rho_i
370  rhob_p= rho_i
371  rkm= rkm_i
372  rkm_p= rkm_i
373  ye= ye_i
374  ye_p= ye_i
375 
376  ! check whether we start in NSE conditions; if not read seeds from progenitor
377  if (read_initial_composition) then
378  if (verbose_level.ge.1) call write_data_to_std_out("Initial abundance source","File")
379  call read_seed(y)
380  ! Recalculate the Ye
381  ye = sum(isotope(1:net_size)%p_nr*y(1:net_size))
382  ye_p= ye
383  evolution_mode= em_nethot
384  if (t9.gt.nsetemp_cold) evolution_mode= em_nse
385  else
386  if (verbose_level.ge.1) call write_data_to_std_out("Initial abundance source","NSE")
387  y(1:net_size)= 0.d0
388  y(ineu)= 1.d0-ye ! abundance of neutrons
389  y(ipro)= ye ! abundance of protons
390  if (t9.gt.nsetemp_cold) then
391  evolution_mode= em_nse
392  if (verbose_level.ge.1) then
393  call write_data_to_std_out("Evolution mode","NSE")
394  endif
395  call winnse_guess(t9, rhob, ye, y(ineu), y(ipro), y)
396  do i=1,net_size
397  if(y(i).lt.1.d-25) y(i)=0.d0
398  enddo
399  endif
400  endif
401  y_p(1:net_size)= y(1:net_size)
402 
403  ! initialize evolution mode
404  init= .true.
405  call switch_evolution_mode (init)
406 
407  ! get initial entropy -> needed for expansion with timmes_eos
408  inistate%abar = sum(y(1:net_size)*isotope(1:net_size)%mass) &
409  / sum(y(1:net_size))
410  call timmes_eos(ink,t9*1.d9,rhob,ye,inistate,eos_status)
411  if(eos_status.ne.0) call raise_exception("Error when calling the EOS. Called with:"//&
412  new_line("A")//&
413  "T : "//num_to_str(t9)//" GK"//new_line("A")//&
414  "Rho : "//num_to_str(rhob)//" g/ccm"//new_line("A")//&
415  "Ye : "//num_to_str(ye)//new_line("A")//&
416  "Abar: "//num_to_str(inistate%abar),&
417  "prepare_simulation",300005)
418 
419  ent = inistate%s
420  ent_p= ent
421  if (verbose_level.ge.1)call write_data_to_std_out("Initial entropy",num_to_str(ent),"[kB/nuc]")
422  ! initialize nuclear heating module
423  if (heating_mode .ne. 0) then
424  call nuclear_heating_init (t9, rhob, ye, y, ent)
425  ! Initialize thermal neutrinos as well
426  call thermal_neutrino_init()
427  endif
428 
429  ! initialise Gear's method if used
430  if(solver==1) call init_gear_solver(y,t_i,initial_stepsize)
431 
432 
433 end subroutine prepare_simulation
434 
435 
436 !>
437 !! Create a folder with binary files that contain all necessary reaction data
438 !!
439 !! This routine creates binary files in the exact format that WinNet needs to
440 !! initialize the rate arrays. The reading of these files can be done much faster
441 !! then reading the original files. The files are stored in the folder specified
442 !! by the path argument. The folder is created if it does not exist.
443 !! Using these files is specifically useful when running many trajectories.
444 !!
445 !! @author M. Reichert
446 !! @date 21.07.23
447 subroutine create_rate_folder(path)
448  use global_class, only: net_size
458  implicit none
459  character(len=*), intent(in) :: path
460  character(max_fname_len) :: path_dir
461 
462  ! define units
463  call unit_define()
464 
465  net_size= 0
466 
467  ! initialise mergesort module
468  call mergesort_init()
469  ! initialise network, returns net_size (and network data in modules)
470  call network_init()
471  ! Make sure the path ends with a slash
472  path_dir = trim(path)//"/"
473  ! Create folder
474  call system('mkdir -p '//trim(adjustl(path_dir)))
475 
476  ! Output weak rates
477  call output_binary_parameter_data(trim(adjustl(path_dir)))
478  call output_binary_network_data(trim(adjustl(path_dir)))
479  call output_binary_weak_reaction_data(trim(adjustl(path_dir)))
480  call output_binary_reaclib_reaction_data(trim(adjustl(path_dir)))
481  call output_binary_fission_reaction_data(trim(adjustl(path_dir)))
482  call output_binary_neutrino_reaction_data(trim(adjustl(path_dir)))
483  call output_binary_tabulated_reaction_data(trim(adjustl(path_dir)))
484 
485  ! Give information
486  call output_param_prepared_network(trim(adjustl(path_dir)))
487 
488 end subroutine create_rate_folder
489 
490 
491 
492 !>
493 !! Switches between NSE and network modes (EM_NSE / EM_NETHOT / EM_NETCOLD)
494 !!
495 !! The following conditions are included to switch the evolution mode:
496 !!
497 !! <table>
498 !! <caption id="multi_row">Evolution mode switches</caption>
499 !! <tr><th> Evolution mode <th> Condition
500 !! <tr><td> EM_NSE <td> \f$T_9\f$ > parameter_class::nsetemp_hot
501 !! <tr><td> EM_NETHOT <td> parameter_class::temp_reload_exp_weak_rates < \f$T_9\f$ < parameter_class::nsetemp_cold
502 !! <tr><td> EM_NETCOLD <td> \f$T_9\f$ < parameter_class::temp_reload_exp_weak_rates
503 !! <tr><td> EM_TERMINATE <td> Depends on termination criterion, see parameter_class::termination_criterion
504 !! </table>
505 !!
506 !! The following figure illustrates the different regions for an example trajectory:
507 !! @image html temperature_regimes.png width=400px
508 !!
509 !! @note This subroutine also changes the timestep at the transition from NSE
510 !! to the network. For the gear solver, gear_module::set_timestep
511 !! has to be called.
512 !!
513 !! @todo At this point it could be useful to check here the difference
514 !! between the saved value of dYdt from the network and the dYdt
515 !! calculated by the nse abchange function, right after the network->nse
516 !! switch
517 !!
518 !! @see single_zone_vars::evolution_mode
519 !!
520 !! \b Edited:
521 !! - 17.12.16
522 !! .
523 subroutine switch_evolution_mode (init)
531 use gear_module, only: init_gear_solver
534 implicit none
535 logical, intent(inout):: init !< Flag that indicates a necessary initialization
536 
537  if (evolution_mode.eq.em_init) then
538  ! initalize at the very beginning
539  if (t9.gt.nsetemp_hot) then
540  evolution_mode= em_nse
542  y(ineu), y(ipro), y)
543  call write_data_to_std_out("Starting evolution mode","NSE")
544  ! print *, "Evolution: starting in NSE mode"
545  else
546  evolution_mode= em_nethot
547  call write_data_to_std_out("Starting evolution mode","Network")
548  ! print *, "Evolution: starting in network mode"
549  endif
550  elseif (t9.gt.nsetemp_hot .and. evolution_mode.ne.em_nse) then
551  ! network --> NSE
552  evolution_mode= em_nse
553  print *, "Evolution mode: switching to nse"
555  y(ineu), y(ipro), y)
556  init = .true. ! reset to correctly compute the timestep below
558  elseif (t9.lt.nsetemp_cold .and. evolution_mode.eq.em_nse) then
559  ! NSE --> network
560  evolution_mode= em_nethot
562  y(ineu), y(ipro), y)
563  ! winnse_descend modifies abundances Y;
564  ! need to copy abundances to previous timelevel, because otherwise
565  ! they will be overwritten in the beginning of adapt_stepsize in
566  ! advance_next_step() subroutine;
567  y_p(1:net_size)= y(1:net_size)
568  ! initialise Gear's method if used
569  init = .true. ! reset to correctly compute the timestep below
571  print *,"Evolution mode: switching to network"
572  end if
573 
574  ! Check if heating has to be enabled
575  if ((.not. heating_switch) .and. (rhob .le. heating_density) .and. &
576  (heating_mode .ne. 0)) then
577  heating_switch = .true.
578  ! Pretty output
579  if (.not. init) then
580  print *,"Evolution mode: switching on heating"
581  end if
582  end if
583 
584  !-- Problem: beta decay reaction rates are not reliable at T9 < 1.d-2
585  if (weak.and.(evolution_mode.eq.em_nethot).and. &
586  (t9.le.temp_reload_exp_weak_rates)) then
587  ! try 1: replace theoretical weak rates with experimental ones
588  call reload_exp_weak_rates() !TODO: fix and expand this subroutine
589  iwformat = 0
590  weak = .false.
591  evolution_mode = em_netcold
592  print *,"Evolution mode: switching to cold network (only experimental rates)"
593  end if
594 
595  !-- Determine if simulation should terminate
596  select case (termination_criterion)
597  case(0) ! when trajectory ends
598  if (time.ge.ztime(zsteps)) evolution_mode= em_terminate
599  case(1) ! after a given final time
600  if (time.ge.final_time) evolution_mode= em_terminate
601  case(2) ! when a lower temperature is hit
602  if (t9.le.final_temp) evolution_mode= em_terminate
603  case(3) ! below a certain density threshold
604  if (rhob.le.final_dens) evolution_mode= em_terminate
605  case(4) ! after freeze-out
606  if (y_p(ineu)/sum(y_p(ihe4+1:net_size)).le.1.0d0) then
607  evolution_mode= em_terminate
608  endif
609  case default
610  call raise_exception('Invalid termination_criterion ('//trim(adjustl(int_to_str(termination_criterion)))//&
611  ').',"prepare_simulation", 300006)
612  end select
613 
614 end subroutine switch_evolution_mode
615 
616 
617 
618 
619 
620 
621 
622 
623 !>
624 !! Print an overview of the reactions involved in the calculation.
625 !!
626 !! An example file (_debug_all-reactions.txt_ ) looks like:
627 !! \file{...
628 !! O N E P A R T I C L E R E A C T I O N S
629 !! 1 n ---> p Q= 0.782 MEV ffn
630 !! Reaction type: weak
631 !! 2 n ---> p Q= 0.000 MEV nen
632 !! Reaction type: neutrino
633 !! 3 p ---> n Q= -0.782 MEV ffn
634 !! Reaction type: weak
635 !! ...}
636 !!
637 !! Furthermore, a file ( _debug_weak-reactions.txt_ ) containing all
638 !! weak reactions is created that looks like:
639 !! \file{
640 !! OVERVIEW OF ALL WEAK-REACTIONS IN THE NETWORK
641 !! 1 n ---> p Q= 0.782 MEV ffn
642 !! 2 n ---> p Q= 0.000 MEV nen
643 !! 3 p ---> n Q= -0.782 MEV ffn
644 !! 4 p ---> n Q= 0.000 MEV nebp }
645 !!
646 !! @note Fission reactions do not obey the default reaclib format and are not
647 !! visualized correct.
648 !!
649 !! \b Edited:
650 !! - MR: 21.01.21 - included interface (get_net_name) to net_names instead of accessing it directly
651 subroutine print_reactions()
652 
653  use global_class, only: nreac, rrate, net_names
654  use benam_class, only: get_net_name
656  implicit none
657 
658  integer :: reactions,weak_unit
659  integer :: i,i1,i2,i3,cnt,wcnt
660  !character(31) :: rateSortKey
661 
662  reactions= open_outfile('debug_all-reactions.txt')
663  weak_unit= open_outfile('debug_weak-reactions.txt')
664  ! write(reactions,'(i1,4/)')1
665  write(reactions,'(t11,a41)') &
666  'OVERVIEW OF ALL REACTIONS IN THE NETWORK'
667  ! write(weak_unit,'(i1,4/)')1
668  write(weak_unit,'(t11,a46)') &
669  'OVERVIEW OF ALL WEAK-REACTIONS IN THE NETWORK'
670  i1=1
671  i2=1
672  i3=1
673  cnt=1
674  wcnt=1
675  do i=1,nreac
676 
677  select case(rrate(i)%group)
678  case(1)
679  if(i1.eq.1) then
680  write(reactions,'(5/,t11,a)')&
681  'O N E P A R T I C L E R E A C T I O N S'
682  i1=0
683  cnt=1
684  wcnt=1
685  end if
686  write(reactions,100)cnt,net_names(rrate(i)%parts(1)), &
687  get_net_name(rrate(i)%parts(2)), &
688  rrate(i)%q_value,rrate(i)%source
689  cnt = cnt+1
690  if(rrate(i)%is_weak) then
691  write(weak_unit,100)wcnt,net_names(rrate(i)%parts(1)), &
692  get_net_name(rrate(i)%parts(2)), &
693  rrate(i)%q_value,rrate(i)%source
694  wcnt = wcnt+1
695  end if
696  case(2)
697  write(reactions,200)cnt,net_names(rrate(i)%parts(1)), &
698  get_net_name(rrate(i)%parts(2)), &
699  get_net_name(rrate(i)%parts(3)), &
700  rrate(i)%q_value,rrate(i)%source
701  cnt = cnt+1
702  if(rrate(i)%is_weak) then
703  write(weak_unit,200)wcnt,get_net_name(rrate(i)%parts(1)), &
704  get_net_name(rrate(i)%parts(2)), &
705  get_net_name(rrate(i)%parts(3)), &
706  rrate(i)%q_value,rrate(i)%source
707  wcnt = wcnt+1
708  end if
709  case(3)
710  if (rrate(i)%parts(5).eq.0) then
711  write(reactions,300)cnt,get_net_name(rrate(i)%parts(1)), &
712  get_net_name(rrate(i)%parts(2)), &
713  get_net_name(rrate(i)%parts(3)), &
714  get_net_name(rrate(i)%parts(4)), &
715  rrate(i)%q_value,rrate(i)%source
716  else
717  write(reactions,310)cnt,get_net_name(rrate(i)%parts(1)), &
718  get_net_name(rrate(i)%parts(2)), &
719  get_net_name(rrate(i)%parts(3)), &
720  get_net_name(rrate(i)%parts(4)), &
721  get_net_name(rrate(i)%parts(5)), &
722  rrate(i)%q_value,rrate(i)%source
723  end if
724  cnt = cnt+1
725  if(rrate(i)%is_weak) then
726  if (rrate(i)%parts(5).eq.0) then
727  write(weak_unit,300)wcnt,get_net_name(rrate(i)%parts(1)), &
728  get_net_name(rrate(i)%parts(2)), &
729  get_net_name(rrate(i)%parts(3)), &
730  get_net_name(rrate(i)%parts(4)), &
731  rrate(i)%q_value,rrate(i)%source
732  else
733  write(weak_unit,310)cnt,get_net_name(rrate(i)%parts(1)), &
734  get_net_name(rrate(i)%parts(2)), &
735  get_net_name(rrate(i)%parts(3)), &
736  get_net_name(rrate(i)%parts(4)), &
737  get_net_name(rrate(i)%parts(5)), &
738  rrate(i)%q_value,rrate(i)%source
739  end if
740  wcnt = wcnt+1
741  end if
742  case(4)
743  if(i2.eq.1) then
744  write(reactions,'(5/,t11,a)') &
745  'T W O P A R T I C L E R E A C T I O N S'
746  i2=0
747  cnt=1
748  end if
749  write(reactions,400)cnt,get_net_name(rrate(i)%parts(1)), &
750  get_net_name(rrate(i)%parts(2)), &
751  get_net_name(rrate(i)%parts(3)), &
752  rrate(i)%q_value,rrate(i)%source
753  !write(reactions,*) rateSortKey(rrate(i)%group,rrate(i)%parts)
754  cnt = cnt+1
755  case(5)
756  write(reactions,500)cnt,get_net_name(rrate(i)%parts(1)), &
757  get_net_name(rrate(i)%parts(2)), &
758  get_net_name(rrate(i)%parts(3)), &
759  get_net_name(rrate(i)%parts(4)), &
760  rrate(i)%q_value,rrate(i)%source
761  cnt = cnt+1
762  case(6)
763  write(reactions,600)cnt,get_net_name(rrate(i)%parts(1)), &
764  get_net_name(rrate(i)%parts(2)), &
765  get_net_name(rrate(i)%parts(3)), &
766  get_net_name(rrate(i)%parts(4)), &
767  get_net_name(rrate(i)%parts(5)), &
768  rrate(i)%q_value,rrate(i)%source
769  cnt = cnt+1
770  case(7)
771  write(reactions,700)cnt,get_net_name(rrate(i)%parts(1)), &
772  get_net_name(rrate(i)%parts(2)), &
773  get_net_name(rrate(i)%parts(3)), &
774  get_net_name(rrate(i)%parts(4)), &
775  get_net_name(rrate(i)%parts(5)), &
776  get_net_name(rrate(i)%parts(6)), &
777  rrate(i)%q_value,rrate(i)%source
778  cnt = cnt+1
779  case(8)
780  if(i3.eq.1) then
781  write(reactions,'(5/,t11,a)') &
782  'T H R E E P A R T I C L E R E A C T I O N S'
783  i3=0
784  cnt=1
785  end if
786  if (rrate(i)%parts(6).ne.0) then
787  write(reactions,830)cnt,get_net_name(rrate(i)%parts(1)), &
788  get_net_name(rrate(i)%parts(2)), &
789  get_net_name(rrate(i)%parts(3)), &
790  get_net_name(rrate(i)%parts(4)), &
791  get_net_name(rrate(i)%parts(5)), &
792  get_net_name(rrate(i)%parts(6)), &
793  rrate(i)%q_value,rrate(i)%source
794  else if(rrate(i)%parts(5).ne.0) then
795  write(reactions,820)cnt,get_net_name(rrate(i)%parts(1)), &
796  get_net_name(rrate(i)%parts(2)), &
797  get_net_name(rrate(i)%parts(3)), &
798  get_net_name(rrate(i)%parts(4)), &
799  get_net_name(rrate(i)%parts(5)), &
800  rrate(i)%q_value,rrate(i)%source
801  else
802  write(reactions,810)cnt,get_net_name(rrate(i)%parts(1)), &
803  get_net_name(rrate(i)%parts(2)), &
804  get_net_name(rrate(i)%parts(3)), &
805  get_net_name(rrate(i)%parts(4)), &
806  rrate(i)%q_value,rrate(i)%source
807  end if
808  cnt = cnt+1
809  end select
810 
811  ! Write the type of reaction to the debug file
812  if ( rrate(i)%reac_type == rrt_sf) then
813  write(reactions,840) "spontaneous fission"
814  else if ( rrate(i)%reac_type == rrt_bf ) then
815  write(reactions,840) "beta-delayed fission"
816  else if ( rrate(i)%reac_type == rrt_nf ) then
817  write(reactions,840) "neutron-induced fission"
818  else if ( rrate(i)%reac_type == rrt_ng ) then
819  write(reactions,840) "n-gamma"
820  else if ( rrate(i)%reac_type == rrt_ag ) then
821  write(reactions,840) "alpha-gamma"
822  else if ( rrate(i)%reac_type == rrt_pg ) then
823  write(reactions,840) "p-gamma"
824  else if ( rrate(i)%reac_type == rrt_gn ) then
825  write(reactions,840) "gamma-n"
826  else if ( rrate(i)%reac_type == rrt_ga ) then
827  write(reactions,840) "gamma-alpha"
828  else if ( rrate(i)%reac_type == rrt_gp ) then
829  write(reactions,840) "gamma-p"
830  else if ( rrate(i)%reac_type == rrt_pn ) then
831  write(reactions,840) "p-n"
832  else if ( rrate(i)%reac_type == rrt_np ) then
833  write(reactions,840) "n-p"
834  else if ( rrate(i)%reac_type == rrt_an ) then
835  write(reactions,840) "alpha-n"
836  else if ( rrate(i)%reac_type == rrt_na ) then
837  write(reactions,840) "n-alpha"
838  else if ( rrate(i)%reac_type == rrt_ap ) then
839  write(reactions,840) "alpha-p"
840  else if ( rrate(i)%reac_type == rrt_pa ) then
841  write(reactions,840) "p-alpha"
842  else if ( rrate(i)%reac_type == rrt_nu ) then
843  write(reactions,840) "neutrino"
844  else if ( rrate(i)%reac_type == rrt_o ) then
845  write(reactions,840) "other"
846  else if ( rrate(i)%reac_type == rrt_betm ) then
847  write(reactions,840) "beta minus"
848  else if ( rrate(i)%reac_type == rrt_betp ) then
849  write(reactions,840) "beta plus"
850  else if ( rrate(i)%reac_type == rrt_alpd ) then
851  write(reactions,840) "alpha decay"
852  else if ( rrate(i)%reac_type == rrt_pemi ) then
853  write(reactions,840) "p emission"
854  else if ( rrate(i)%reac_type == rrt_nemi ) then
855  write(reactions,840) "n emission"
856  else if ( rrate(i)%reac_type == rrt_ec ) then
857  write(reactions,840) "Electron capture"
858  else
859  write(reactions,840) "unknown"
860  end if
861 
862 
863  end do
864  call close_io_file(reactions,'debug_all-reactions.txt')
865  call close_io_file(weak_unit,'debug_weak-reactions.txt')
866  return
867 
868 100 format (i6,t12,a5,t18,'--->',t22,a5,t57,'Q=',t59,f7.3,t67,'MEV',t74,a4)
869 200 format (i6,t12,a5,t18,'--->',t22,a5,t27,'+',t28,a5,t57, &
870  'Q=',t59,f7.3,t67,'MEV',t74,a4)
871 300 format (i6,t12,a5,t18,'--->',t22,a5,t27,'+',t28,a5,t33,'+',t34,a5,t57, &
872  'Q=',t59,f7.3,t67,'MEV',t74,a4)
873 310 format (i6,t12,a5,t18,'--->',t22,a5,t27,'+',t28,a5,t33,'+',t34,a5, &
874  t39,'+',t40,a5,t57,'Q=',t59,f7.3,t67,'MEV',t74,a4)
875 400 format (i6,t12,a5,t17,'+',t18,a5,t24,'--->',t28,a5,t57, &
876  'Q=',t59,f7.3,t67,'MEV',t74,a4)
877 500 format (i6,t12,a5,t17,'+',t18,a5,t24,'--->',t28,a5,t33,'+',t34,a5,t57, &
878  'Q=',t59,f7.3,t67,'MEV',t74,a4)
879 600 format (i6,t12,a5,t17,'+',t18,a5,t24,'--->',t28,a5,t33,'+',t34,a5, &
880  t39,'+',t40,a5,t57,'Q=',t59,f7.3,t67,'MEV',t74,a4)
881 700 format (i6,t12,a5,t17,'+',t18,a5,t24,'--->',t28,a5,t33,'+',t34,a5, &
882  t39,'+',t40,a5,t45,'+',t46,a5,t57,'Q=',t59,f7.3,t67,'MEV',t74,a4)
883 810 format (i6,t12,a5,t17,'+',t18,a5,t23,'+',t24,a5,t30,'--->',t34,a5, &
884  t57,'Q=',t59,f7.3,t67,'MEV',t74,a4)
885 820 format (i6,t12,a5,t17,'+',t18,a5,t23,'+',t24,a5,t30,'--->',t34,a5, &
886  t39,'+',t40,a,t57,'Q=',t59,f7.3,t67,'MEV',t74,a4)
887 830 format (i6,t12,a5,t17,'+',t18,a5,t23,'+',t24,a5,t30,'--->',t34,a5, &
888  t39,'+',t40,a,t45,'+',t46,a,t57,'Q=',t59,f7.3,t67,'MEV',t74,a4)
889 840 format ('Reaction type: ',a)
890 
891 end subroutine print_reactions
892 
893 
894 
895 
896 
897 !> Print a debug file of the reaction
898 !!
899 !! In contrast to \ref print_reactions, this subroutine prints additional flags
900 !! of a reaction. The structure of a file looks like:
901 !!
902 !! <table>
903 !! <caption id="multi_row">File structure</caption>
904 !! <tr><td> Reaclib chapter <td> isotope names <td> Q-Value <td> Source label
905 !! <tr><td> Amount destroyed/synthesized <td> double counting factor
906 !! <tr><td>"is_weak" <td> "is_resonant" <td> "is_reverse"
907 !! </table>
908 !! An example of the file (_debug_reac.dat_) looks like:
909 !! \file{...
910 !! 5 n na32 p ne32 -16.606 rath
911 !! -1 -1 1 1 0 0 1.000
912 !! F F T
913 !! 5 p na32 n mg32 18.317 rath
914 !! -1 -1 1 1 0 0 1.000
915 !! F F F
916 !! ...}
917 !!
918 subroutine print_debug()
919 
920  use global_class, only: nreac, rrate
922  implicit none
923 
924  integer :: ofile
925  integer :: i
926  character*5,dimension(6) :: rnam
927 
928  ofile= open_outfile('debug_reac.dat')
929  do i =1,nreac
930  call getnames(i,rnam)
931  write(ofile,111)rrate(i)%group,rnam(1:6),rrate(i)%q_value,rrate(i)%source
932  write(ofile,222)rrate(i)%ch_amount(1:6),rrate(i)%one_over_n_fac
933  write(ofile,333)rrate(i)%is_weak,rrate(i)%is_resonant,rrate(i)%is_reverse
934  end do
935  call close_io_file(ofile,'debug_reac.dat')
936  return
937 
938 111 format(i1,t3,6a5,t35,f7.3,t44,a4)
939 222 format(6(i2,1x),t22,f7.3)
940 333 format(3l5)
941 
942 end subroutine print_debug
943 
944 
945 !> Get the names of a certain reaction
946 !!
947 !! @returns all nuclei names that participate in a reaction with index ind
948 subroutine getnames(ind,names)
949  use global_class, only: net_names, rrate
950  implicit none
951 
952  integer, intent(in) :: ind !< Index of the reaction
953  character*5,dimension(6),intent(out) :: names !< Names of the participating isotopes
954  integer :: i !< Loop variable
955 
956  do i =1,6
957  if(rrate(ind)%parts(i).lt.1) then
958  names(i) = ' '
959  else
960  names(i) = net_names(rrate(ind)%parts(i))
961  end if
962  end do
963  return
964 
965 end subroutine getnames
966 
967 
968 end module network_init_module
969 !----------------------------------------------------------------------------
single_zone_vars::y
real(r_kind), dimension(:), allocatable y
Definition: single_zone_vars.f90:21
ls_timmes_eos_module::ink
integer, parameter ink
Definition: ls_timmes_eos_module.f:14
parameter_class::iwformat
integer iwformat
defines format of the weak rates (0 = tabulated, 1 = log<ft>)
Definition: parameter_class.f90:81
beta_decay_rate_module::merge_beta_decays
subroutine, public merge_beta_decays(rrate_array, rrate_length)
Merge external beta decays into the larger rate array.
Definition: beta_decay_rate_module.f90:124
winnse_module
Module to calculate NSE.
Definition: winnse_module.f90:34
screening_module
Module to calculate electron screening.
Definition: screening_module.f90:17
nuflux_class::init_nuflux
subroutine, public init_nuflux()
Initialize nuflux module.
Definition: nuflux_class.f90:126
global_class::heating_switch
logical, public heating_switch
Variables related to nuclear heating.
Definition: global_class.f90:41
parameter_class::nse_descend_t9start
real(r_kind) nse_descend_t9start
high initial temperature in GK for winnse_descend subroutine
Definition: parameter_class.f90:125
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
winnse_module::winnse_guess
subroutine, public winnse_guess(t9, rho, ye, yn_guess, yp_guess, ysol)
Calculate NSE composition with an initial guess.
Definition: winnse_module.f90:116
global_class::ipro
integer, public ipro
index of alphas, neutrons and protons
Definition: global_class.f90:94
ls_timmes_eos_module
Definition: ls_timmes_eos_module.f:2
global_class::rrate
type(reactionrate_type), dimension(:), allocatable, public rrate
array containing all reaction rates used in the network
Definition: global_class.f90:65
gear_module::init_gear_solver
subroutine, public init_gear_solver(Y, t_init, h_init)
Initialize iteration variables.
Definition: gear_module.f90:131
analysis::cl_cmax
integer cl_cmax
system clock variables
Definition: analysis.f90:24
inter_module
Module inter_module with interpolation routines.
Definition: inter_module.f90:13
inter_module::inverse_interp1d
subroutine, public inverse_interp1d(n, xp, xb, yp, res, flin, itype)
The inverse of the 1D interpolation function.
Definition: inter_module.f90:931
network_init_module::print_debug
subroutine, private print_debug()
Print a debug file of the reaction.
Definition: network_init_module.f90:919
nuflux_class::merge_neutrino_rates
subroutine, public merge_neutrino_rates(rrate_array, rrate_length)
Routine to merge neutrino rates into rrate array.
Definition: nuflux_class.f90:1346
analysis::cl_start
integer cl_start
Definition: analysis.f90:24
nucstuff_class::init_nucstuff
subroutine init_nucstuff()
Initialize nucstuff class.
Definition: nucstuff_class.f90:40
single_zone_vars::rhob
real(r_kind) rhob
Definition: single_zone_vars.f90:17
reaclib_rate_module::merge_reaclib_rates
subroutine, public merge_reaclib_rates(rrate_array, rrate_length)
Merge the reaclib rates into a larger array.
Definition: reaclib_rate_module.f90:270
fission_rate_module::init_fission_rates
subroutine, public init_fission_rates()
Initialize the fission reactions.
Definition: fission_rate_module.f90:99
reaclib_rate_module
Module that deals with reaclib reaction rates.
Definition: reaclib_rate_module.f90:13
mergesort_module::mergesort_init
subroutine, public mergesort_init()
Initialize the mergesort module and open files for debugging.
Definition: mergesort_module.f90:48
detailed_balance::init_inverse_rates
subroutine, public init_inverse_rates()
Initialize everything for the inverse rates.
Definition: detailed_balance.f90:95
parameter_class::flow_every
integer flow_every
flow output frequency
Definition: parameter_class.f90:64
format_class::load_format
subroutine load_format()
Definition: format_class.f90:24
single_zone_vars::t9
real(r_kind) t9
Definition: single_zone_vars.f90:15
rrt_an
#define rrt_an
Definition: macros.h:72
nuclear_heating
Takes care of the temperature and entropy updates due to the nuclear energy release.
Definition: nuclear_heating.f90:11
single_zone_vars::rkm
real(r_kind) rkm
Definition: single_zone_vars.f90:18
expansion_module::expansion_init
subroutine expansion_init()
Initialize the expansion module and open files for debugging.
Definition: expansion_module.f90:60
single_zone_vars::ent
real(r_kind) ent
Definition: single_zone_vars.f90:20
nuclear_heating::nuclear_heating_init
subroutine, public nuclear_heating_init(T9, rho, Ye, Y, entropy)
Nuclear heating initialization routine.
Definition: nuclear_heating.f90:51
parameter_class::h_flow_every
integer h_flow_every
flow output frequency in hdf5 format
Definition: parameter_class.f90:65
error_msg_class
Error handling routines.
Definition: error_msg_class.f90:16
global_class::ihe4
integer, public ihe4
Definition: global_class.f90:94
expansion_module
Subroutines to handle parametric evolution of hydrodynamic quantities after the final timestep of the...
Definition: expansion_module.f90:16
rrt_ec
#define rrt_ec
Definition: macros.h:61
alpha_decay_rate_module::merge_alpha_decays
subroutine, public merge_alpha_decays(rrate_array, rrate_length)
Merge alpha decays into the larger rate array.
Definition: alpha_decay_rate_module.f90:204
parameter_class::termination_criterion
integer termination_criterion
condition to terminate the simulation ([0]=trajectory_file, 1=final_time, 2=final_temp,...
Definition: parameter_class.f90:127
rrt_np
#define rrt_np
Definition: macros.h:73
parameter_class::unit_define
subroutine, public unit_define()
Declares values for the elements in unit_type.
Definition: parameter_class.f90:233
fission_rate_module
Module to deal with fission reactions.
Definition: fission_rate_module.f90:16
rrt_gp
#define rrt_gp
Definition: macros.h:70
beta_decay_rate_module
This module contains subroutines to include external beta decays.
Definition: beta_decay_rate_module.f90:27
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
parameter_class::nsetemp_cold
real(r_kind) nsetemp_cold
T [GK] for the nse->network switch.
Definition: parameter_class.f90:119
single_zone_vars::evolution_mode
integer evolution_mode
NSE, network hot/cold, etc.
Definition: single_zone_vars.f90:23
alpha_decay_rate_module
This module contains subroutines to add alpha decays.
Definition: alpha_decay_rate_module.f90:19
parameter_class::output_param_prepared_network
subroutine output_param_prepared_network(path)
Output relevant parameters to a file in the prepared network path.
Definition: parameter_class.f90:1524
ls_timmes_eos_module::timmes_eos
subroutine timmes_eos(var, vin, d, Ye, state, status)
Definition: ls_timmes_eos_module.f:49
parameter_class::final_dens
real(r_kind) final_dens
termination density [g/cm3]
Definition: parameter_class.f90:131
nuflux_class::output_binary_neutrino_reaction_data
subroutine, public output_binary_neutrino_reaction_data(path)
Write the reactions to a file in binary format.
Definition: nuflux_class.f90:774
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::initial_stepsize
real(r_kind) initial_stepsize
this value is used as a stepsize at initial step
Definition: parameter_class.f90:128
winnse_module::nse_init
subroutine, public nse_init()
Allocates and initialises various arrays needed for the nse calculation.
Definition: winnse_module.f90:75
reaclib_rate_module::init_reaclib_rates
subroutine, public init_reaclib_rates()
Count and read reaclib reactions.
Definition: reaclib_rate_module.f90:45
single_zone_vars::rkm_p
real(r_kind) rkm_p
Radius of the outflow [km].
Definition: single_zone_vars.f90:18
network_init_module::switch_evolution_mode
subroutine, public switch_evolution_mode(init)
Switches between NSE and network modes (EM_NSE / EM_NETHOT / EM_NETCOLD)
Definition: network_init_module.f90:524
readini
Subroutines for initialization and parameter parsing.
Definition: readini.f90:15
network_init_module
Module to prepare the reaction network.
Definition: network_init_module.f90:22
tw_rate_module::reload_exp_weak_rates
subroutine, public reload_exp_weak_rates()
This routine is used to replace theoretical weak rates with experimental ones it's called when T9 < p...
Definition: tw_rate_module.f90:1117
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
global_class::ineu
integer, public ineu
Definition: global_class.f90:94
rrt_pn
#define rrt_pn
Definition: macros.h:74
parameter_class::rho_analytic
character(max_fname_len) rho_analytic
analytic density [g/cm3]
Definition: parameter_class.f90:187
global_class::isotope
type(isotope_type), dimension(:), allocatable, public isotope
all nuclides used in the network
Definition: global_class.f90:34
network_init_module::create_rate_folder
subroutine create_rate_folder(path)
Create a folder with binary files that contain all necessary reaction data.
Definition: network_init_module.f90:448
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
benam_class::output_binary_network_data
subroutine, public output_binary_network_data(path)
Save the general network information to a binary file.
Definition: benam_class.f90:499
single_zone_vars::time_p
real(r_kind) time_p
Time.
Definition: single_zone_vars.f90:13
hydro_trajectory::ztime
real(r_kind), dimension(:), allocatable, public ztime
time information from trajectory
Definition: hydro_trajectory.f90:19
rrt_ga
#define rrt_ga
Definition: macros.h:68
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
rrt_pemi
#define rrt_pemi
Definition: macros.h:63
rrt_alpd
#define rrt_alpd
Definition: macros.h:62
parameter_class::rkm_analytic
character(max_fname_len) rkm_analytic
analytic radial scale [km]
Definition: parameter_class.f90:188
rrt_betp
#define rrt_betp
Definition: macros.h:60
inter_module::interp1d
subroutine, public interp1d(n, xp, xb, yp, res, flin, itype)
Interface for 1D interpolation routines.
Definition: inter_module.f90:99
parameter_class::heating_density
real(r_kind) heating_density
Density at which nuclear heating will be switched on (-1) to always include heating.
Definition: parameter_class.f90:124
network_init_module::print_reactions
subroutine, private print_reactions()
Print an overview of the reactions involved in the calculation.
Definition: network_init_module.f90:652
rrt_na
#define rrt_na
Definition: macros.h:71
tabulated_rate_module::init_tabulated_rates
subroutine, public init_tabulated_rates()
Initialize tabulated rates.
Definition: tabulated_rate_module.f90:78
rrt_pg
#define rrt_pg
Definition: macros.h:69
tw_rate_module::weak
logical, public weak
switch for weak rates
Definition: tw_rate_module.f90:58
single_zone_vars::ent_p
real(r_kind) ent_p
Entropy [kB/baryon].
Definition: single_zone_vars.f90:20
detailed_balance::merge_inverse_rates
subroutine, public merge_inverse_rates(rrate_array, rrate_length)
Delete and create new inverse rates.
Definition: detailed_balance.f90:137
rrt_ap
#define rrt_ap
Definition: macros.h:76
single_zone_vars::f
real(r_kind), dimension(:), allocatable f
Definition: single_zone_vars.f90:22
parameter_class::output_binary_parameter_data
subroutine output_binary_parameter_data(path)
Output the parameter data to a binary file.
Definition: parameter_class.f90:1655
parser_module
Subroutines for equation parsing in case of an analytic trajectory or luminosity mode.
Definition: parser_module.f90:22
hydro_trajectory::zrad
real(r_kind), dimension(:), allocatable, public zrad
radii from trajectory
Definition: hydro_trajectory.f90:23
parameter_class::read_initial_composition
logical read_initial_composition
specify whether initial distribution of abundances should be read from file
Definition: parameter_class.f90:91
parameter_class::t_analytic
real(r_kind) t_analytic
for parameteric trajectories: initial time
Definition: parameter_class.f90:126
parser_module::find_start_value
subroutine, public find_start_value(input_string, eq_value, initial_guess, converged, result)
Finds a value of the variable for a given y-value.
Definition: parser_module.f90:856
thermal_neutrino_module
The thermal_neutrino_module serves as interface to the neutrino emission routines from the sneut5....
Definition: thermal_neutrino_module.f90:19
screening_module::init_screening
subroutine, public init_screening(nreac)
Initialize the screening module.
Definition: screening_module.f90:43
detailed_balance
Module that deals with inverse reaction rates.
Definition: detailed_balance.f90:57
readini::read_seed
subroutine, public read_seed(iniab)
Reads in seed abundances from file parameter_class::seed_file.
Definition: readini.f90:308
parameter_class::solver
integer solver
solver flag (0 - implicit Euler, 1 - Gear's method, ...), is integer as it is faster than comparing s...
Definition: parameter_class.f90:147
readini::readini_init
subroutine, public readini_init()
Initialize the readini module and open files.
Definition: readini.f90:46
parser_module::parse_string
real(r_kind) function, public parse_string(input_string, var_value)
Takes a string and evaluates the expression.
Definition: parser_module.f90:807
winnse_module::winnse_descend
subroutine, public winnse_descend(t9strt, t9fnl, rho, ye, yni, ypi, ysol)
This routine descends from an initially high temperature, at which the NSE abudances can be accuratel...
Definition: winnse_module.f90:177
global_class::net_size
integer, public net_size
total number of isotopes (network size)
Definition: global_class.f90:93
beta_decay_rate_module::init_ext_beta_rates
subroutine, public init_ext_beta_rates()
Initialize external beta decay rates.
Definition: beta_decay_rate_module.f90:74
analysis::analysis_init
subroutine, public analysis_init()
Open files, write headers, allocate space etc.
Definition: analysis.f90:52
file_handling_class
Provide some basic file-handling routines.
Definition: file_handling_class.f90:18
network_init_module::prepare_simulation
subroutine, public prepare_simulation
All the necessary initializations and settings before the main loop.
Definition: network_init_module.f90:166
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
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
analysis
Contains various routines for analysis and diagnostic output.
Definition: analysis.f90:9
hydro_trajectory::init_index
integer init_index
Initial index in the trajectory.
Definition: hydro_trajectory.f90:18
single_zone_vars::time
real(r_kind) time
Definition: single_zone_vars.f90:13
network_init_module::network_init
subroutine, private network_init()
Main initialising subroutine. calls reading subroutines and fills the reactionrate array.
Definition: network_init_module.f90:54
pardiso_class
Contains subroutines for sparse matrix assembly and the solver core.
Definition: pardiso_class.f90:24
flow_module::flow_init
subroutine, public flow_init()
Initialise flow subroutine.
Definition: flow_module.f90:50
single_zone_vars::stepsize
real(r_kind) stepsize
Stepsize.
Definition: single_zone_vars.f90:14
fission_rate_module::output_binary_fission_reaction_data
subroutine, public output_binary_fission_reaction_data(path)
Save the fission data to a unformatted binary file.
Definition: fission_rate_module.f90:316
r_kind
#define r_kind
Definition: macros.h:46
rrt_gn
#define rrt_gn
Definition: macros.h:66
parameter_class::nsetemp_hot
real(r_kind) nsetemp_hot
T [GK] for the nse<-network switch.
Definition: parameter_class.f90:120
flow_module
Provides subroutines to calculate reaction flows.
Definition: flow_module.f90:18
hydro_trajectory::zsteps
integer zsteps
number of timesteps in the hydro trajectory
Definition: hydro_trajectory.f90:17
rrt_pa
#define rrt_pa
Definition: macros.h:75
hydro_trajectory
Contains arrays representing thermodynamic conditions from hydro trajectory file.
Definition: hydro_trajectory.f90:14
hydro_trajectory::zdens
real(r_kind), dimension(:), allocatable, public zdens
density information from trajectory
Definition: hydro_trajectory.f90:21
benam_class::get_nuclear_properties
subroutine, public get_nuclear_properties()
Reads nuclear properties (name,a,n,z,spin,mass excess,partition functions) from file 'winvn' and htpf...
Definition: benam_class.f90:642
reaclib_rate_module::output_binary_reaclib_reaction_data
subroutine output_binary_reaclib_reaction_data(path)
Save the complete rrate array to a binary file.
Definition: reaclib_rate_module.f90:194
network_init_module::getnames
subroutine, private getnames(ind, names)
Get the names of a certain reaction.
Definition: network_init_module.f90:949
single_zone_vars::dydt
real(r_kind), dimension(:), allocatable dydt
Time derivative of the abundances.
Definition: single_zone_vars.f90:22
benam_class::get_minmax
subroutine, public get_minmax()
Returns Amin and Amax for each isotopic chain in minmax.
Definition: benam_class.f90:916
rrt_betm
#define rrt_betm
Definition: macros.h:59
single_zone_vars::y_p
real(r_kind), dimension(:), allocatable y_p
Abundances.
Definition: single_zone_vars.f90:21
rrt_o
#define rrt_o
Definition: macros.h:81
parameter_class::final_time
real(r_kind) final_time
termination time in seconds
Definition: parameter_class.f90:129
tw_rate_module::init_theoretical_weak_rates
subroutine, public init_theoretical_weak_rates()
Initialize theoretical weak rates.
Definition: tw_rate_module.f90:91
parameter_class::final_temp
real(r_kind) final_temp
termination temperature [GK]
Definition: parameter_class.f90:130
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
file_handling_class::open_outfile
integer function, public open_outfile(file_name)
Shorthand for opening a new file for writing (output file)
Definition: file_handling_class.f90:108
hydro_trajectory::zye
real(r_kind), dimension(:), allocatable, public zye
electron fraction information from trajectory
Definition: hydro_trajectory.f90:22
global_class
Contains types and objects shared between multiple modules.
Definition: global_class.f90:19
rrt_nemi
#define rrt_nemi
Definition: macros.h:64
benam_class::get_net_name
character(:) function, allocatable, public get_net_name(index, trimmed)
Getter of net_names, translating indices to a nucleus name.
Definition: benam_class.f90:280
parameter_class::t9_analytic
character(max_fname_len) t9_analytic
analytic temperature [T9]
Definition: parameter_class.f90:186
single_zone_vars::ye
real(r_kind) ye
Definition: single_zone_vars.f90:19
global_class::nreac
integer, public nreac
total number of reactions
Definition: global_class.f90:98
parameter_class::temp_reload_exp_weak_rates
real(r_kind) temp_reload_exp_weak_rates
temperature below which one should not use theoretical weak rates so they are replaced with exp....
Definition: parameter_class.f90:83
tw_rate_module::merge_theoretical_weak_rates
subroutine merge_theoretical_weak_rates(rrate_array, rrate_length)
Merge theoretical weak rates into larger rate array.
Definition: tw_rate_module.f90:209
fission_rate_module::merge_fission_rates
subroutine, public merge_fission_rates(rrate_array, rrate_length, fiss_count)
Merge fission rates with larger array.
Definition: fission_rate_module.f90:388
rrt_ag
#define rrt_ag
Definition: macros.h:67
parameter_class::net_source
character(max_fname_len) net_source
list of isotopes included in the network (sunet)
Definition: parameter_class.f90:155
file_handling_class::close_io_file
subroutine, public close_io_file(unit_no, file_name)
Close an external file.
Definition: file_handling_class.f90:144
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
ls_timmes_eos_module::timmes_eos_state
Definition: ls_timmes_eos_module.f:23
rrt_sf
#define rrt_sf
Definition: macros.h:80
format_class
Define custom format statements used to read in major data files.
Definition: format_class.f90:16
tw_rate_module::output_binary_weak_reaction_data
subroutine, public output_binary_weak_reaction_data(path)
Save the theoretical weak rates to a unformatted binary file.
Definition: tw_rate_module.f90:391
alpha_decay_rate_module::init_alpha_decay_rates
subroutine, public init_alpha_decay_rates()
Initialize alpha decay rates.
Definition: alpha_decay_rate_module.f90:54
hydro_trajectory::ztemp
real(r_kind), dimension(:), allocatable, public ztemp
temperature information from trajectory
Definition: hydro_trajectory.f90:20
rrt_ng
#define rrt_ng
Definition: macros.h:65
analysis::cl_rate
integer cl_rate
Definition: analysis.f90:24
mergesort_module
Module mergesort_module for merging arrays of rates.
Definition: mergesort_module.f90:16
single_zone_vars
Simulation variables for a single zone model.
Definition: single_zone_vars.f90:11
parameter_class::ye_analytic
character(max_fname_len) ye_analytic
analytic electron fraction
Definition: parameter_class.f90:189
parameter_class::initemp_cold
real(r_kind) initemp_cold
T [GK] lowest allowed temperature to start the calculation from.
Definition: parameter_class.f90:113
single_zone_vars::rhob_p
real(r_kind) rhob_p
Density [g/cm^3].
Definition: single_zone_vars.f90:17
gear_module
gear_module contains adaptive high-order Gear solver
Definition: gear_module.f90:37
pardiso_class::sparse
subroutine, public sparse
Determines the position of jacobian entries in the cscf value array.
Definition: pardiso_class.f90:79
single_zone_vars::t9_p
real(r_kind) t9_p
Temperature [GK].
Definition: single_zone_vars.f90:15
thermal_neutrino_module::thermal_neutrino_init
subroutine, public thermal_neutrino_init()
Initializes the thermal_neutrino_module.
Definition: thermal_neutrino_module.f90:48
rrt_nu
#define rrt_nu
Definition: macros.h:77
parameter_class
Contains all runtime parameters as well as phys and math constants.
Definition: parameter_class.f90:24
benam_class
Subroutines needed to initialise the network.
Definition: benam_class.f90:11
single_zone_vars::ye_p
real(r_kind) ye_p
Electron fraction [mol/g].
Definition: single_zone_vars.f90:19
parameter_class::initemp_hot
real(r_kind) initemp_hot
T [GK] for the starting point of the trajectory: =0: from the beginning; >0: from the last T>initemp.
Definition: parameter_class.f90:114