Go to the documentation of this file.
190 character(max_fname_len)::
le
192 character(max_fname_len)::
enue
194 character(max_fname_len)::
lx
196 character(max_fname_len)::
enux
236 unit%pi = 3.14159265358979323846d0
237 unit%mass_n = 939.56533d0
238 unit%mass_p = 938.271998d0
239 unit%mass_u = 931.494013d0
240 unit%mass_e = 0.510998910d0
241 unit%me = 9.1093826d-28
242 unit%n_a = 6.02214179d23
243 unit%hbc = 197.327053d0
244 unit%k_b = 1.380662d-23
245 unit%k_mev = 8.617343d-11
246 unit%conv_ev = 1.602189246d-19
247 unit%kerg = 1.3806504d-16
248 unit%clight = 2.99792458d10
249 unit%h = 6.62606876d-34
250 unit%hbar_mev= 6.582122d-22
251 unit%h_mevs = 4.135667273d-21
252 unit%hix = 1.036427d-18
253 unit%amu = 1.66053873d-24
254 unit%grav = 6.67384d-8
255 unit%msol = 1.9891d33
256 unit%ergtomev= 0.62415d6
274 character(*),
intent(in) :: parfile
276 character(1000) :: line
277 character(param_name_len) :: param_name
278 character(2000) :: param_value
279 character(2),
parameter :: blanks =
" "//achar(9)
280 integer :: parfile_unit, istat, ieq, i1,i2,ln
286 read (parfile_unit,
'(A)',iostat=istat) line
287 if (istat .ne. 0)
exit
288 i1= verify(line,blanks)
290 i2= verify(line,blanks,back=.true.)
292 if(line(1:1).eq.
'#') cycle
296 trim(adjustl(
int_to_str(ln)))//
" :"//new_line(
"A")//&
297 trim(adjustl(line)) ,
"read_param",340003)
299 i2= verify(line(1:ieq-1),blanks,back=.true.)
302 trim(adjustl(
int_to_str(ln)))//
" :"//new_line(
"A")//&
303 trim(adjustl(line)) ,
"read_param",340003)
305 param_name= line(1:i2)
306 i2= verify(line,blanks,back=.true.)
307 i1= ieq-1 + verify(line(ieq:i2),blanks//
"=")
308 param_value= line(i1:i2)
335 character(*),
intent(in) :: param_name
336 character(*),
intent(in) :: param_value
338 character(9999) :: all_possible_par
339 character(*),
parameter :: integer_params = &
341 ":snapshot_every" // &
343 ":mainout_every" // &
345 ":timescales_every" // &
348 ":termination_criterion" // &
350 ":expansiontype" // &
351 ":h_snapshot_every" // &
352 ":track_nuclei_every" // &
354 ":adapt_stepsize_maxcount" // &
355 ":extrapolation_width" // &
357 ":nse_calc_every" // &
359 ":top_engen_every" // &
360 ":h_mainout_every" // &
361 ":h_track_nuclei_every"//&
362 ":h_timescales_every" // &
364 ":h_engen_every" // &
365 ":gear_nr_maxcount" // &
368 ":fission_frag_beta_delayed"//&
369 ":fission_frag_n_induced"//&
370 ":fission_frag_spontaneous"//&
371 ":fission_frag_missing"//&
372 ":fission_format_spontaneous"//&
373 ":fission_format_beta_delayed"//&
374 ":fission_format_n_induced"//&
376 ":gear_nr_mincount" // &
377 ":alpha_decay_zmin" // &
378 ":alpha_decay_zmax" // &
381 ":nu_loss_every" // &
382 ":h_nu_loss_every" // &
385 character(*),
parameter :: real_params = &
386 ":temp_reload_exp_weak_rates" // &
393 ":nse_descend_t9start" // &
400 ":gear_timestep_max"// &
401 ":heating_T9_tol"// &
402 ":timestep_factor"// &
405 ":timestep_hydro_factor"// &
409 ":initial_stepsize"// &
413 ":freeze_rate_temp"// &
415 ":nse_delt_t9min" // &
417 character(*),
parameter :: logical_params = &
418 ":read_initial_composition" // &
421 ":gear_ignore_adapt_stepsize" // &
422 ":calc_nsep_energy" // &
423 ":timestep_traj_limit" // &
424 ":custom_snapshots" // &
425 ":h_custom_snapshots" // &
426 ":h_engen_detailed" // &
427 ":use_detailed_balance" // &
428 ":use_timmes_mue" // &
429 ":use_detailed_balance_q_reac" // &
430 ":use_tabulated_rates" // &
431 ":use_beta_decay_file" //&
432 ":use_alpha_decay_file" // &
433 ":alpha_decay_ignore_all"//&
434 ":use_neutrino_loss_file" // &
435 ":use_thermal_nu_loss"//&
436 ":use_prepared_network"
437 character(*),
parameter :: string_params = &
438 ":trajectory_file" // &
441 ":isotopes_file" // &
444 ":fission_rates_spontaneous" // &
445 ":fission_rates_beta_delayed" // &
446 ":fission_rates_n_induced" // &
447 ":weak_rates_file" // &
448 ":chem_pot_file" // &
449 ":nsep_energies_file" // &
450 ":alpha_decay_src_ignore" // &
451 ":nunucleo_rates_file" // &
452 ":nuchannel_file" // &
453 ":nfission_file" // &
454 ":bfission_file" // &
455 ":sfission_file" // &
456 ":trajectory_mode" // &
457 ":trajectory_format" // &
458 ":track_nuclei_file" // &
460 ":snapshot_file" // &
461 ":beta_decay_file" // &
462 ":neutrino_mode" // &
476 ":alpha_decay_file" // &
477 ":detailed_balance_src_ignore" // &
478 ":detailed_balance_src_q_reac" // &
479 ":detailed_balance_src_q_winvn" // &
480 ":tabulated_rates_file" // &
481 ":tabulated_temperature_file" // &
482 ":beta_decay_src_ignore" // &
483 ":neutrino_loss_file" // &
484 ":prepared_network_path"
486 logical :: lparam_value
488 real(r_kind) :: score
489 character(999) :: cl_par
490 character(2000) :: str_value
491 character(500) :: h_err_msg
494 i2= index(param_value,
"#")
495 if ((param_value(1:1).eq.
"'") .or.(param_value(1:1).eq.
'"')) &
497 str_value= trim(param_value(2:len_trim(param_value)-1))
499 str_value= trim(param_value(1:i2-1))
501 str_value= trim(param_value)
504 if(len_trim(str_value).ge.5)
then
505 lparam_value= (str_value(1:5).eq.
"'yes'") &
506 .or.(str_value(1:5).eq.
'"yes"')
507 elseif(len_trim(str_value).ge.3)
then
508 lparam_value= (str_value(1:3).eq.
"yes")
510 lparam_value= .false.
514 if(param_name.eq.
"out_every")
then
516 elseif(param_name.eq.
"snapshot_every")
then
518 elseif(param_name.eq.
"h_snapshot_every")
then
520 elseif(param_name.eq.
"h_mainout_every")
then
522 elseif(param_name.eq.
"flow_every")
then
524 elseif(param_name.eq.
"h_flow_every")
then
526 elseif(param_name.eq.
"timescales_every")
then
528 elseif(param_name.eq.
"h_timescales_every")
then
530 elseif(param_name.eq.
"engen_every")
then
532 elseif(param_name.eq.
"h_engen_every")
then
534 elseif(param_name.eq.
"nrdiag_every")
then
536 elseif(param_name.eq.
"mainout_every")
then
538 elseif(param_name.eq.
"iwformat")
then
540 elseif(param_name.eq.
"iwinterp")
then
542 elseif(param_name.eq.
"nuflag")
then
544 elseif(param_name.eq.
"fissflag")
then
546 elseif(param_name.eq.
"termination_criterion")
then
548 elseif(param_name.eq.
"expansiontype")
then
550 elseif(param_name.eq.
"nr_maxcount")
then
552 elseif(param_name.eq.
"nr_mincount")
then
554 elseif(param_name.eq.
"adapt_stepsize_maxcount")
then
556 elseif(param_name.eq.
"track_nuclei_every")
then
558 elseif(param_name.eq.
"h_track_nuclei_every")
then
560 elseif(param_name.eq.
"top_engen_every")
then
562 elseif(param_name.eq.
"extrapolation_width")
then
564 elseif(param_name.eq.
"solver")
then
566 elseif(param_name.eq.
"heating_mode")
then
568 elseif(param_name.eq.
"fission_frag_beta_delayed")
then
570 elseif(param_name.eq.
"fission_frag_missing")
then
572 elseif(param_name.eq.
"fission_frag_n_induced")
then
574 elseif(param_name.eq.
"fission_frag_spontaneous")
then
576 elseif(param_name.eq.
"fission_format_spontaneous")
then
578 elseif(param_name.eq.
"fission_format_beta_delayed")
then
580 elseif(param_name.eq.
"fission_format_n_induced")
then
582 elseif(param_name.eq.
"screening_mode")
then
584 elseif(param_name.eq.
"interp_mode")
then
586 elseif(param_name.eq.
"nse_calc_every")
then
588 elseif(param_name.eq.
"gear_nr_maxcount")
then
590 elseif(param_name.eq.
"gear_nr_mincount")
then
592 elseif(param_name.eq.
"alpha_decay_zmin")
then
594 elseif(param_name.eq.
"alpha_decay_zmax")
then
596 elseif(param_name.eq.
"nse_max_it")
then
598 elseif(param_name.eq.
"nse_solver")
then
600 elseif(param_name.eq.
"nu_loss_every")
then
602 elseif(param_name.eq.
"h_nu_loss_every")
then
606 elseif(param_name.eq.
"temp_reload_exp_weak_rates")
then
608 elseif(param_name.eq.
"engen")
then
610 elseif(param_name.eq.
"initemp_cold")
then
612 elseif(param_name.eq.
"initemp_hot")
then
614 elseif(param_name.eq.
"nsetemp_cold")
then
616 elseif(param_name.eq.
"nse_nr_tol")
then
618 elseif(param_name.eq.
"nse_delt_t9min")
then
620 elseif(param_name.eq.
"nsetemp_hot")
then
622 elseif(param_name.eq.
"heating_frac")
then
624 elseif(param_name.eq.
"heating_density")
then
626 elseif(param_name.eq.
"nse_descend_t9start")
then
628 elseif(param_name.eq.
"initial_stepsize")
then
630 elseif(param_name.eq.
"final_time")
then
632 elseif(param_name.eq.
"final_temp")
then
634 elseif(param_name.eq.
"final_dens")
then
636 elseif(param_name.eq.
"t_analytic")
then
638 elseif(param_name.eq.
"gear_eps")
then
640 elseif(param_name.eq.
"gear_escale")
then
642 elseif(param_name.eq.
"gear_cFactor")
then
644 elseif(param_name.eq.
"gear_nr_eps")
then
646 elseif(param_name.eq.
"gear_timestep_max")
then
648 elseif(param_name.eq.
"heating_T9_tol")
then
650 elseif(param_name.eq.
"timestep_max")
then
652 elseif(param_name.eq.
"timestep_factor")
then
654 elseif(param_name.eq.
"timestep_hydro_factor")
then
656 elseif(param_name.eq.
"timestep_Ymin")
then
658 elseif(param_name.eq.
"nr_tol")
then
660 elseif(param_name.eq.
"freeze_rate_temp")
then
662 elseif(param_name.eq.
"nu_max_time")
then
664 elseif(param_name.eq.
"nu_min_T")
then
666 elseif(param_name.eq.
"nu_min_L")
then
669 elseif(param_name.eq.
"read_initial_composition")
then
671 elseif(param_name.eq.
"calc_nsep_energy")
then
673 elseif(param_name.eq.
"h_engen_detailed")
then
675 elseif(param_name.eq.
"timestep_traj_limit")
then
677 elseif(param_name.eq.
"custom_snapshots")
then
679 elseif(param_name.eq.
"h_custom_snapshots")
then
681 elseif(param_name.eq.
"use_htpf")
then
683 elseif(param_name.eq.
"h_finab")
then
685 elseif(param_name.eq.
"use_timmes_mue")
then
687 elseif(param_name.eq.
"use_tabulated_rates")
then
689 elseif(param_name.eq.
"use_beta_decay_file")
then
691 elseif(param_name.eq.
"use_prepared_network")
then
693 elseif(param_name.eq.
"use_alpha_decay_file")
then
695 elseif(param_name.eq.
"use_detailed_balance")
then
697 elseif(param_name.eq.
"use_detailed_balance_q_reac")
then
699 elseif(param_name.eq.
"use_thermal_nu_loss")
then
701 elseif(param_name.eq.
"use_neutrino_loss_file")
then
703 elseif(param_name.eq.
"gear_ignore_adapt_stepsize")
then
705 elseif(param_name.eq.
"alpha_decay_ignore_all")
then
708 elseif(param_name.eq.
"trajectory_mode")
then
710 elseif(param_name.eq.
"trajectory_file")
then
712 elseif(param_name.eq.
"T9_analytic")
then
714 elseif(param_name.eq.
"rho_analytic")
then
716 elseif(param_name.eq.
"Rkm_analytic")
then
718 elseif(param_name.eq.
"Ye_analytic")
then
720 elseif(param_name.eq.
"alpha_decay_file")
then
722 elseif(param_name.eq.
"beta_decay_file")
then
724 elseif(param_name.eq.
"seed_file")
then
726 elseif(param_name.eq.
"seed_format")
then
728 elseif(param_name.eq.
"snapshot_file")
then
730 elseif(param_name.eq.
"net_source")
then
732 elseif(param_name.eq.
"isotopes_file")
then
734 elseif(param_name.eq.
"prepared_network_path")
then
736 elseif(param_name.eq.
"htpf_file")
then
738 elseif(param_name.eq.
"reaclib_file")
then
740 elseif(param_name.eq.
"fission_rates_beta_delayed")
then
742 elseif(param_name.eq.
"fission_rates_spontaneous")
then
744 elseif(param_name.eq.
"fission_rates_n_induced")
then
746 elseif(param_name.eq.
"weak_rates_file")
then
748 elseif(param_name.eq.
"tabulated_rates_file")
then
750 elseif(param_name.eq.
"tabulated_temperature_file")
then
752 elseif(param_name.eq.
"chem_pot_file")
then
754 elseif(param_name.eq.
"nsep_energies_file")
then
756 elseif(param_name.eq.
"nuchannel_file")
then
758 elseif(param_name.eq.
"nurates_file")
then
760 elseif(param_name.eq.
"nunucleo_rates_file")
then
762 elseif(param_name.eq.
"nfission_file")
then
764 elseif(param_name.eq.
"bfission_file")
then
766 elseif(param_name.eq.
"sfission_file")
then
768 elseif(param_name.eq.
"trajectory_format")
then
770 elseif(param_name.eq.
"track_nuclei_file")
then
772 elseif(param_name.eq.
"neutrino_mode")
then
774 elseif(param_name.eq.
"Le")
then
776 elseif(param_name.eq.
"Lebar")
then
777 lebar = trim(str_value)
778 elseif(param_name.eq.
"Enue")
then
779 enue = trim(str_value)
780 elseif(param_name.eq.
"Enuebar")
then
782 elseif(param_name.eq.
"Lx")
then
784 elseif(param_name.eq.
"Lxbar")
then
785 lxbar = trim(str_value)
786 elseif(param_name.eq.
"Enux")
then
787 enux = trim(str_value)
788 elseif(param_name.eq.
"Enuxbar")
then
790 elseif(param_name.eq.
"beta_decay_src_ignore")
then
792 elseif(param_name.eq.
"alpha_decay_src_ignore")
then
794 elseif(param_name.eq.
"detailed_balance_src_ignore")
then
796 elseif(param_name.eq.
"detailed_balance_src_q_reac")
then
798 elseif(param_name.eq.
"detailed_balance_src_q_winvn")
then
800 elseif(param_name.eq.
"neutrino_loss_file")
then
805 all_possible_par = integer_params//real_params//logical_params//string_params
811 if (score .lt. max(len_trim(adjustl(param_name)),&
812 len_trim(adjustl(cl_par)))/2)
then
814 h_err_msg = new_line(
'A')//
"Did you mean '"//trim(adjustl(cl_par))//
"'?"
820 call raise_exception(
'Unknown parameter: '//trim(adjustl(param_name))//
"."&
821 //trim(adjustl(h_err_msg)),
"set_param",340004)
836 character(len=*),
intent(in) :: input_string
837 character(len=*),
intent(in) :: param_name
845 if (rstat .ne. 0)
then
846 call raise_exception(
'Could not parse parameter "'//trim(adjustl(param_name))//&
847 '". '//new_line(
"A")//
'The value "'//&
848 trim(adjustl(input_string))//&
849 '" is not valid for this parameter. '//new_line(
"A")//&
850 'This parameter assumes an integer.', &
851 "read_integer_param",&
865 character(len=*),
intent(in) :: input_string
866 character(len=*),
intent(in) :: param_name
874 if (rstat .ne. 0)
then
875 call raise_exception(
'Could not parse parameter "'//trim(adjustl(param_name))//&
876 '". '//new_line(
"A")//
'The value "'//&
877 trim(adjustl(input_string))//&
878 '" is not valid for this parameter. '//new_line(
"A")//&
879 'This parameter assumes a float.', &
895 character(len=100) :: win_path
900 call get_environment_variable(
'WinNet_path', win_path, status)
903 if (status == 0)
then
906 if (verbose_level .ge. 1)
then
907 write(*,*)
'Environment variable "WinNet_path" is not set. Default parameters may not work!'
911 win_path = trim(win_path)//
"/data/"
958 htpf_file = trim(adjustl(win_path))//
"datafile2.txt"
971 net_source = trim(adjustl(win_path))//
"sunet_complete"
998 reaclib_file = trim(adjustl(win_path))//
"Reaclib_18_9_20"
1018 snapshot_file = trim(adjustl(win_path))//
"snapshot_freq.dat"
1054 weak_rates_file = trim(adjustl(win_path))//
"theoretical_weak_rates.dat"
1069 character(3) :: yesno
1071 if (verbose_level .ge. 2)
then
1082 write(ofile,
'(3A)')
'bfission_file = "', trim(
bfission_file),
'"'
1084 write(ofile,
'(3A)')
'chem_pot_file = "', trim(
chem_pot_file),
'"'
1089 write(ofile,
'(A,I5)')
'engen_every = ' ,
engen_every
1090 write(ofile,
'(3A)')
'Enue ="' , trim(
enue),
'"'
1091 write(ofile,
'(3A)')
'Enuebar ="' , trim(
enuebar),
'"'
1092 write(ofile,
'(3A)')
'Enux ="' , trim(
enux),
'"'
1093 write(ofile,
'(3A)')
'Enuxbar ="' , trim(
enuxbar),
'"'
1096 write(ofile,
'(A,es14.7)')
'final_dens =' ,
final_dens
1097 write(ofile,
'(A,es14.7)')
'final_temp =' ,
final_temp
1098 write(ofile,
'(A,es14.7)')
'final_time =' ,
final_time
1099 write(ofile,
'(A,I1)')
'fissflag = ' ,
fissflag
1110 write(ofile,
'(A,I5)')
'flow_every = ' ,
flow_every
1112 write(ofile,
'(A,es14.7)')
'gear_cFactor =' ,
gear_cfactor
1113 write(ofile,
'(A,es14.7)')
'gear_eps =' ,
gear_eps
1114 write(ofile,
'(A,es14.7)')
'gear_escale =' ,
gear_escale
1116 write(ofile,
'(A,es14.7)')
'gear_nr_eps =' ,
gear_nr_eps
1123 write(ofile,
'(2A)')
'h_finab = ' , yesno(
h_finab)
1131 write(ofile,
'(A,es14.7)')
'heating_frac =' ,
heating_frac
1134 write(ofile,
'(3A)')
'htpf_file = "', trim(
htpf_file),
'"'
1135 write(ofile,
'(A,es14.7)')
'initemp_cold =' ,
initemp_cold
1136 write(ofile,
'(A,es14.7)')
'initemp_hot =' ,
initemp_hot
1138 write(ofile,
'(3A)')
'isotopes_file = "', trim(
isotopes_file),
'"'
1139 write(ofile,
'(A,I1)')
'interp_mode = ' ,
interp_mode
1140 write(ofile,
'(A,I1)')
'iwformat = ' ,
iwformat
1141 write(ofile,
'(A,I1)')
'iwinterp = ' ,
iwinterp
1142 write(ofile,
'(3A)')
'Le ="' , trim(
le),
'"'
1143 write(ofile,
'(3A)')
'Lebar ="' , trim(
lebar),
'"'
1144 write(ofile,
'(3A)')
'Lx ="' , trim(
lx),
'"'
1145 write(ofile,
'(3A)')
'Lxbar ="' , trim(
lxbar),
'"'
1147 write(ofile,
'(3A)')
'net_source = "', trim(
net_source),
'"'
1148 write(ofile,
'(3A)')
'nfission_file = "', trim(
nfission_file),
'"'
1150 write(ofile,
'(3A)')
'neutrino_mode = ' , trim(
neutrino_mode)
1151 write(ofile,
'(A,I5)')
'nr_maxcount = ' ,
nr_maxcount
1152 write(ofile,
'(A,I5)')
'nr_mincount = ' ,
nr_mincount
1153 write(ofile,
'(A,es14.7)')
'nr_tol =' ,
nr_tol
1158 write(ofile,
'(A,I5)')
'nse_max_it = ' ,
nse_max_it
1159 write(ofile,
'(A,es14.7)')
'nse_nr_tol =' ,
nse_nr_tol
1160 write(ofile,
'(A,I5)')
'nse_solver = ' ,
nse_solver
1162 write(ofile,
'(A,es14.7)')
'nsetemp_cold =' ,
nsetemp_cold
1163 write(ofile,
'(A,es14.7)')
'nsetemp_hot =' ,
nsetemp_hot
1164 write(ofile,
'(A,I1)')
'nuflag = ' ,
nuflag
1165 write(ofile,
'(3A)')
'nuchannel_file = "', trim(
nuchannel_file),
'"'
1167 write(ofile,
'(A,es14.7)')
'nu_max_time = ' ,
nu_max_time
1168 write(ofile,
'(A,es14.7)')
'nu_min_L = ' ,
nu_min_l
1169 write(ofile,
'(A,es14.7)')
'nu_min_T = ' ,
nu_min_t
1171 write(ofile,
'(3A)')
'nurates_file = "', trim(
nurates_file),
'"'
1172 write(ofile,
'(A,I5)')
'out_every = ' ,
out_every
1174 write(ofile,
'(3A)')
'reaclib_file = "', trim(
reaclib_file),
'"'
1176 write(ofile,
'(3A)')
'rho_analytic = "', trim(
rho_analytic),
'"'
1177 write(ofile,
'(3A)')
'Rkm_analytic = "', trim(
rkm_analytic),
'"'
1179 write(ofile,
'(3A)')
'seed_file = "', trim(
seed_file),
'"'
1180 write(ofile,
'(3A)')
'seed_format = "', trim(
seed_format),
'"'
1181 write(ofile,
'(3A)')
'sfission_file = "', trim(
sfission_file),
'"'
1183 write(ofile,
'(3A)')
'snapshot_file = "', trim(
snapshot_file),
'"'
1184 write(ofile,
'(A,I1)')
'solver = ' ,
solver
1185 write(ofile,
'(A,es14.7)')
't_analytic =' ,
t_analytic
1186 write(ofile,
'(3A)')
'T9_analytic = "', trim(
t9_analytic),
'"'
1192 write(ofile,
'(A,es14.7)')
'timestep_max =' ,
timestep_max
1207 write(ofile,
'(2A)')
'use_htpf = ' , yesno(
use_htpf)
1214 write(ofile,
'(3A)')
'Ye_analytic = "', trim(
ye_analytic),
'"'
1240 ' GK) should be smaller than "nsetemp_hot" ('//&
1242 "check_param", 340006)
1248 ' GK) should be smaller than "initemp_hot" ('//&
1250 "check_param",340007)
1255 ') should be smaller than "nr_maxcount" ('//&
1257 "check_param",340008)
1262 ') should be smaller than "gear_nr_maxcount" ('//&
1264 "check_param",340008)
1269 call raise_exception(
'The parameter "termination_criterion" is set to "0" (after end of trajectory)'//&
1270 'but the trajectory mode is set to "analytic".',&
1271 "check_param",340009)
1304 character(*),
intent(in) :: possible_pars
1306 character(*),
intent(in) :: input_par
1307 character(*),
intent(out) :: cl_par
1308 real(r_kind),
intent(out) :: score
1309 character(999) :: helper_char
1310 character(999) :: ms_par
1311 real(r_kind) :: cl_dist
1312 real(r_kind) :: h_dist
1321 do k=2,len(possible_pars)
1324 if (possible_pars(k:k) .ne.
":")
then
1325 helper_char = trim(adjustl(helper_char))//possible_pars(k:k)
1328 if ((possible_pars(k:k) .eq.
":") .or. (k .eq. len(possible_pars)))
then
1332 if (h_dist .lt. cl_dist)
then
1334 ms_par = trim(adjustl(helper_char))
1344 cl_par = trim(adjustl(ms_par))
1359 character(*),
intent(in) :: par1
1360 character(*),
intent(in) :: par2
1362 character(1) :: upper1
1363 character(1) :: upper2
1368 real(
r_kind),
dimension(:,:),
allocatable :: d
1374 allocate(d(0:m,0:n),stat=stat)
1376 "LevenshteinDistance",320001)
1392 if (par1(i:i) .eq. par2(j:j))
then
1396 h = iachar(par1(i:i))
1397 if (h>= iachar(
"a") .and. h<=iachar(
"z") )
then
1398 upper1 = achar(iachar(par1(i:i))-32)
1402 h = iachar(par2(j:j))
1403 if (h>= iachar(
"a") .and. h<=iachar(
"z") )
then
1404 upper2 = achar(iachar(par2(j:j))-32)
1410 if (upper2 .eq. upper1)
then
1417 d(i,j) = min(d(i-1,j)+1, d(i, j-1) + 1, d(i-1, j-1) + scost)
1444 integer :: int_helper
1445 logical :: log_helper
1458 read(file_id) int_helper
1459 if (int_helper .ne.
nuflag)
then
1460 call raise_exception(
"The prepared network file does not match the nuflag of the current run. "// &
1462 "Please check the prepared network file.",&
1463 "read_sanity_check_prepared_network",340010)
1465 read(file_id) int_helper
1467 call raise_exception(
"The prepared network file does not match the fissflag of the current run. "// &
1469 "Please check the prepared network file.",&
1470 "read_sanity_check_prepared_network",340010)
1472 read(file_id) int_helper
1474 call raise_exception(
"The prepared network file does not match the iwformat of the current run. "// &
1476 "Please check the prepared network file.",&
1477 "read_sanity_check_prepared_network",340010)
1479 read(file_id) int_helper
1481 call raise_exception(
"The prepared network file does not match the iwinterp of the current run. "// &
1483 "Please check the prepared network file.",&
1484 "read_sanity_check_prepared_network",340010)
1486 read(file_id) log_helper
1488 call raise_exception(
"The prepared network file does not match the use_alpha_decay_file of the current run. "// &
1489 "Please check the prepared network file.",&
1490 "read_sanity_check_prepared_network",340010)
1492 read(file_id) log_helper
1494 call raise_exception(
"The prepared network file does not match the use_beta_decay_file of the current run. "// &
1495 "Please check the prepared network file.",&
1496 "read_sanity_check_prepared_network",340010)
1498 read(file_id) log_helper
1500 call raise_exception(
"The prepared network file does not match the use_tabulated_rates of the current run. "// &
1501 "Please check the prepared network file.",&
1502 "read_sanity_check_prepared_network",340010)
1504 read(file_id) log_helper
1506 call raise_exception(
"The prepared network file does not match the use_detailed_balance of the current run. "// &
1507 "Please check the prepared network file.",&
1508 "read_sanity_check_prepared_network",340010)
1510 read(file_id) log_helper
1512 call raise_exception(
"The prepared network file does not match the use_neutrino_loss_file of the current run. "// &
1513 "Please check the prepared network file.",&
1514 "read_sanity_check_prepared_network",340010)
1516 read(file_id) log_helper
1517 if (log_helper .neqv.
use_htpf)
then
1518 call raise_exception(
"The prepared network file does not match the use_htpf of the current run. "// &
1519 "Please check the prepared network file.",&
1520 "read_sanity_check_prepared_network",340010)
1522 read(file_id) log_helper
1524 call raise_exception(
"The prepared network file does not match the use_timmes_mue of the current run. "// &
1525 "Please check the prepared network file.",&
1526 "read_sanity_check_prepared_network",340010)
1545 character(len=*),
intent(in) :: path
1547 character(3) :: yesno
1552 write(ofile,
'(A)')
'Folder containing network and reaction data in unformatted binary format.'
1553 write(ofile,
'(A)')
''
1554 write(ofile,
'(A)')
''
1555 write(ofile,
'(A)')
'The following list contains relevant parameters that were used to create the network data:'
1556 write(ofile,
'(A)')
'=========================================================================================='
1557 write(ofile,
'(A)')
''
1560 write(ofile,
'(3A)')
'isotopes_file = "', trim(
isotopes_file),
'"'
1561 write(ofile,
'(3A)')
'net_source = "', trim(
net_source),
'"'
1562 write(ofile,
'(3A)')
'reaclib_file = "', trim(
reaclib_file),
'"'
1563 write(ofile,
'(A)')
''
1575 write(ofile,
'(A)')
''
1584 write(ofile,
'(A)')
''
1595 write(ofile,
'(A)')
''
1599 write(ofile,
'(A,I1)')
'iwformat = ' ,
iwformat
1601 write(ofile,
'(A,I1)')
'iwinterp = ' ,
iwinterp
1603 write(ofile,
'(3A)')
'chem_pot_file = "', trim(
chem_pot_file),
'"'
1606 write(ofile,
'(A)')
''
1615 write(ofile,
'(A)')
''
1618 write(ofile,
'(2A)')
'use_htpf = ' , yesno(
use_htpf)
1620 write(ofile,
'(3A)')
'htpf_file = "', trim(
htpf_file),
'"'
1622 write(ofile,
'(A)')
''
1625 write(ofile,
'(A,I1)')
'nuflag = ' ,
nuflag
1626 if ((
nuflag) .gt. 0)
then
1629 write(ofile,
'(3A)')
'nuchannel_file = "', trim(
nuchannel_file),
'"'
1630 write(ofile,
'(3A)')
'nurates_file = "', trim(
nurates_file),
'"'
1633 write(ofile,
'(A)')
''
1636 write(ofile,
'(A,I1)')
'fissflag = ' ,
fissflag
1645 write(ofile,
'(3A)')
'nfission_file = "', trim(
nfission_file),
'"'
1648 write(ofile,
'(3A)')
'bfission_file = "', trim(
bfission_file),
'"'
1649 write(ofile,
'(3A)')
'sfission_file = "', trim(
sfission_file),
'"'
1652 write(ofile,
'(A)')
''
1676 character(len=*),
intent(in) :: path
1706 character(3) :: quote
1707 logical,
intent(in) :: claim
integer h_track_nuclei_every
frequency of track nuclei output in hdf5 format
character(max_fname_len) sfission_file
Fission table for spontaneous fission.
integer iwformat
defines format of the weak rates (0 = tabulated, 1 = log<ft>)
integer engen_every
Energy generation output frequency.
character(max_fname_len) lxbar
Muon and Tauon antineutrino luminosities [erg/s].
character(max_fname_len) bfission_file
Fission table for beta-delayed fission.
real(r_kind) nse_descend_t9start
high initial temperature in GK for winnse_descend subroutine
real(r_kind), dimension(:), allocatable weights
– parameters for efficient numerical integration of effphase in the interval [1,infinity]
integer out_every
– runtime parameters set when reading parameter file
logical use_prepared_network
Use a prepared folder with all necessary data in binary format.
integer track_nuclei_every
frequency of track nuclei output
real(r_kind) freeze_rate_temp
Tmperature at which rates get frozen (for reacl. rates this should be 1d-2GK)
real(r_kind) timestep_ymin
Lower limit of the abundance to contribute to the timestep calculation, default value is 1....
integer nse_calc_every
Compute NSE abundances every x step.
subroutine output_param
Output parameters to a file.
character(max_fname_len) enuebar
average electron-antineutrino energies [MeV]
real(r_kind) gear_eps
Abundance accuracy for gear solver.
logical weightscalculated
switch to calculated weights and nodes for [1,infinity]
real(r_kind) function levenshteindistance(par1, par2)
Calculates the Levenshtein distance between two strings.
character(max_fname_len) beta_decay_file
File for reading in beta decays in different format.
integer h_timescales_every
timescales output frequency in hdf5 format
logical use_detailed_balance
Calculate the inverse reactions via detailed balance rather than using them form file.
real(r_kind) timestep_factor
Factor for the change of the timestep (see nu in Winteler 2012 Eq. 2.49). Default value is 1....
integer gear_nr_maxcount
Maximum newton-raphson iterations for gear solver.
character(max_fname_len) beta_decay_src_ignore
Source flag(s) to ignore within the beta decay file.
constants and unit conversion factors
real(r_kind) engen_alpha
energy generation from alpha-decays [MeV/s]
integer flow_every
flow output frequency
integer fission_format_spontaneous
Format of spontaneous fission rates (0: Off, 1: Reaclib, 2: Halflifes)
real(r_kind) timestep_max
Maximum factor for the change of the timestep. The new timestep is only allowed to be timestep_max * ...
integer alpha_decay_zmin
Minimum Z for additional alpha decay rates.
character(max_fname_len) tabulated_temperature_file
file containing grid of tabulated temperature file ("default" for default grid)
integer nse_solver
Solver for calculating NSE. 0: Newton-Raphson, 1: Powell's hybrid method.
real(r_kind) gear_nr_eps
Convergence criterion for the newton-raphson of the gear solver.
integer h_flow_every
flow output frequency in hdf5 format
integer expansiontype
defines prescription used for parametrized expansion after the last timestep of the hydro input
real(r_kind), dimension(:), allocatable matcc
matrices for Clenshaw-Curtis integration
integer termination_criterion
condition to terminate the simulation ([0]=trajectory_file, 1=final_time, 2=final_temp,...
subroutine check_param
Check for consistency of parameter.
character(3) function yesno(claim)
Converts .TRUE.->"yes", .FALSE. -> "no".
real(r_kind) gear_escale
Normalization cutoff for gear solver, similar to timestep_Ymin for Euler.
subroutine, public unit_define()
Declares values for the elements in unit_type.
subroutine read_param(parfile)
This function reads the parameter file.
logical use_neutrino_loss_file
Use a file with Qnu values?
character(:) function, allocatable, public int_to_str(num)
Converts a given integer to a string.
integer screening_mode
Mode for coulomb corrections: 0 - no screening, 1 - screening using the prescription of Kravchuk & Ya...
real(r_kind) nsetemp_cold
T [GK] for the nse->network switch.
integer timescales_every
timescales output frequency
real(r_kind) gear_cfactor
Conservative timestep factor for gear solver [0.1, ... , 0.4].
subroutine output_param_prepared_network(path)
Output relevant parameters to a file in the prepared network path.
logical use_beta_decay_file
switch for using different format for beta decays
real(r_kind) final_dens
termination density [g/cm3]
integer nr_maxcount
– Newton-Raphson iterative loop parameters
integer, parameter, public param_name_len
– hardcoded parameters
subroutine, public raise_exception(msg, sub, error_code)
Raise a exception with a given error message.
real(r_kind) initial_stepsize
this value is used as a stepsize at initial step
integer nr_mincount
Minimum iterations in NR.
logical timestep_traj_limit
Should the timestep be limited by the timestep of the trajectory.
character(max_fname_len) nsep_energies_file
neutron separation energies
real(r_kind) timestep_hydro_factor
Factor for the maximum change of the hydrodynamic quantities (density and temperature)
integer top_engen_every
frequency of energy generators toplist
real(r_kind) nu_min_t
Neutrino temperature cutoff for neutrino reactions [MeV].
character(max_fname_len) enux
average Muon and Tauon neutrino energies [MeV]
logical use_timmes_mue
Use electron chemical potentials from timmes EOS for theoretical weak rates.
character(max_fname_len) neutrino_mode
Similar to trajectory mode.
integer gear_nr_mincount
Minimum newton-raphson iterations for gear solver.
logical gear_ignore_adapt_stepsize
Flag whether gear should ignore the adapt stepsize loop.
integer, parameter, public max_fname_len
maximum length of filenames
character(max_fname_len) trajectory_file
name of trajectory data file
logical use_alpha_decay_file
Switch for using additional alpha decay rates.
real(r_kind) nu_min_l
Neutrino luminosity cutoff for neutrino reactions [erg/g/s].
logical h_finab
Store the finab in hdf5 format rather than in ascii format.
character(max_fname_len) rho_analytic
analytic density [g/cm3]
integer iwinterp
defines the interpolation for the weak rates (0 = bilinear, 1 = bicubic)
character(max_fname_len) fission_rates_spontaneous
reaction library for spontaneous fission rates
logical use_htpf
Use high temperature partition functions or not.
character(max_fname_len) rkm_analytic
analytic radial scale [km]
character(max_fname_len) alpha_decay_file
File with additional alpha decays.
real(r_kind) heating_density
Density at which nuclear heating will be switched on (-1) to always include heating.
real(r_kind), dimension(:), allocatable xnodes
corresponding nodes "
integer fissflag
defines type of fission fragment distribution used
real(r_kind) heating_t9_tol
Convergence parameter for the temperature in the heating mode.
logical, public data_creation_mode
Flag for rate creation mode.
integer alpha_decay_zmax
Maximum Z for additional alpha decay rates.
integer h_nu_loss_every
Output neutrino loss and gain in hdf5 format.
character(max_fname_len) trajectory_format
Format to read the trajectory.
character(max_fname_len) detailed_balance_src_ignore
Source flag(s) to ignore within calculated detailed balance.
subroutine output_binary_parameter_data(path)
Output the parameter data to a binary file.
logical h_engen_detailed
Output the energy per parent nucleus and reaction type.
logical use_tabulated_rates
switch for using tabulated rates (e.g. talysNGrates.dat)
character(max_fname_len) isotopes_file
properties of all isotopes in the network: masses, partition functions etc. (winvn)
logical read_initial_composition
specify whether initial distribution of abundances should be read from file
real(r_kind) t_analytic
for parameteric trajectories: initial time
character(max_fname_len) detailed_balance_src_q_reac
Source flag(s) to use q-value from rate file for inverse reaction.
subroutine search_close_parameter(possible_pars, input_par, score, cl_par)
Search for similar existing parameters.
integer function read_integer_param(input_string, param_name)
Converts a string to an integer.
integer ncc
nr of points for Clenshaw-Curtis integration
character(max_fname_len) htpf_file
high-temperature partition functions (htpf.dat)
character(max_fname_len) nuchannel_file
Contains neutrino channel information as in Sieverding et al. 2018.
integer solver
solver flag (0 - implicit Euler, 1 - Gear's method, ...), is integer as it is faster than comparing s...
integer interp_mode
Mode for interpolation of temperature and density.
character(max_fname_len) seed_file
name of file with initial seeds for trajectory run
character(max_fname_len) le
electron-neutrino luminosities [erg/s]
character(max_fname_len) track_nuclei_file
File of nuclei to track. Gives an output similar to mainout.dat.
type(unit_type), public unit
constants and unit conversion factors
real(r_kind) heating_frac
use this fraction of nuclear-generated energy for heating
character(max_fname_len) nunucleo_rates_file
neutrino reaction rates on nucleons
integer adapt_stepsize_maxcount
max. iterations in adapting the stepsize
Provide some basic file-handling routines.
integer fission_frag_n_induced
Fragment distribution of n-induced fission rates in case of custom fragments (fissflag=4)
character *20 trajectory_mode
determines how trajectory is calculated (from_file|analytic|expand)
character(:) function, allocatable, public num_to_str(num)
Converts a given real to a string with format "(1pE10.2)".
integer fission_frag_spontaneous
Fragment distribution of spontaneous fission rates in case of custom fragments (fissflag=4)
integer heating_mode
Mode for heating: 0 - no heating, 1 - heating using an entropy equation, 2 - heating from the energy ...
integer nrdiag_every
frequency of NR loop diagnostic messages (wrt iteration counter)
character(max_fname_len) weak_rates_file
weak rates library (twr.dat)
character(max_fname_len) nfission_file
Fission table for neutron-induced fission.
character(max_fname_len) tabulated_rates_file
tabulated rates library (e.g. talysNGrates.dat)
integer h_mainout_every
HDF5 output frequency of the mainout.
integer fission_format_beta_delayed
Format of beta-delayed fission rates (0: Off, 1: Reaclib, 2: Halflifes, 3: Probability)
real(r_kind) engen
total energy generation [MeV/s]
character(max_fname_len) reaclib_file
reaction rate library (reaclib)
logical h_custom_snapshots
Same, but in hdf5 format.
character(max_fname_len) detailed_balance_src_q_winvn
Source flag(s) to use q-value from winvn file for inverse reaction.
subroutine read_sanity_check_prepared_network
Read important parameters from a binary file and check for consistency.
character(max_fname_len) seed_format
Seed format.
real(r_kind) nsetemp_hot
T [GK] for the nse<-network switch.
real(r_kind) nr_tol
exit NR if tolerance less than this value
logical use_thermal_nu_loss
Whether to include thermal neutrino loss or not.
character(max_fname_len) neutrino_loss_file
Path to a file containing Qnu values.
real(r_kind) final_time
termination time in seconds
integer nu_loss_every
Output neutrino loss and gain.
character(max_fname_len) fission_rates_n_induced
reaction library for neutron induced fission rates
real(r_kind) final_temp
termination temperature [GK]
real(r_kind) gear_timestep_max
For gear solver.
subroutine set_param(param_name, param_value)
Sets a global parameter param_name to the value, given by its string representation param_value.
character(max_fname_len) snapshot_file
File that contains days, where a snapshot should be made.
integer function, public open_infile(file_name)
Same for reading (input file)
integer function, public open_outfile(file_name)
Shorthand for opening a new file for writing (output file)
logical use_detailed_balance_q_reac
Use Q-value from reaclib for the calculation of detailed balance.
integer h_snapshot_every
snapshot output frequency in hdf5 format
real(r_kind) nu_max_time
Maximum time for neutrino reactions to react.
character(max_fname_len) t9_analytic
analytic temperature [T9]
integer fission_format_n_induced
Format of neutron-induced fission rates (0: Off, 1: Reaclib)
real(r_kind), dimension(:), allocatable dcc
character(max_fname_len) enue
average electron-neutrino energies [MeV]
real(r_kind) temp_reload_exp_weak_rates
temperature below which one should not use theoretical weak rates so they are replaced with exp....
real(r_kind) nse_delt_t9min
Minimum temperature [GK] when descending to desired temperature in NSE.
real(r_kind) engen_fiss
energy generation from fission [MeV/s]
character(max_fname_len) alpha_decay_src_ignore
Source flag(s) to ignore within the alpha decay rates.
character(max_fname_len) net_source
list of isotopes included in the network (sunet)
integer function, public open_unformatted_outfile(file_name)
Shorthand for opening a new unformatted file for writing (output file)
integer mainout_every
frequency of mainout output
logical alpha_decay_ignore_all
Flag whether rates should actually get replaced or only added.
character(len= *), parameter, private par_binary_name
other static variables
character(max_fname_len) lebar
electron-antineutrino luminosities [erg/s]
real(r_kind) nse_nr_tol
Tolerance for the NR loop in the NSE calculation.
integer function open_unformatted_infile(file_name)
Open an unformatted file for reading.
real(r_kind) function read_float_param(input_string, param_name)
Converts a string to an float.
logical custom_snapshots
If true, a file must be provided with numbers in days. Snapshots will be created for these points in ...
integer nuflag
defines type of neutrino reactions used
subroutine set_default_param
Sets default parameters Parameters are sorted in alphabetical order.
integer fission_frag_missing
Fragment distribution in case of missing fragments in case of custom fragments (fissflag=4)
character(max_fname_len) chem_pot_file
tabulated chemical potential of electron gas
character(max_fname_len) nurates_file
Neutrino reactions on heavy nuclei as in Sieverding et al. 2018.
real(r_kind), dimension(:,:), allocatable mcc
character(max_fname_len) prepared_network_path
Prepared network folder.
integer h_engen_every
Energy generation output frequency in hdf5 format.
character(max_fname_len) ye_analytic
analytic electron fraction
real(r_kind) initemp_cold
T [GK] lowest allowed temperature to start the calculation from.
integer extrapolation_width
how many points from the end of trajectory to use when computing residual expansion
character(max_fname_len) enuxbar
average Muon and Tauon antineutrino energies [MeV]
character(max_fname_len) lx
Muon and Tauon neutrino luminosities [erg/s].
integer snapshot_every
snapshot output frequency
real(r_kind) engen_beta
energy generation from beta-decays [MeV/s]
logical calc_nsep_energy
calculate neutron separation energy?
real(r_kind) function pi()
Further information: http://netlib.org/quadpack/index.html https://orion.math.iastate....
character(max_fname_len) fission_rates_beta_delayed
reaction library for beta delayed fission rates
integer nse_max_it
Maximum amount of NSE iterations.
Contains all runtime parameters as well as phys and math constants.
integer fission_frag_beta_delayed
Fragment distribution of beta-delayed fission rates in case of custom fragments (fissflag=4)
real(r_kind) initemp_hot
T [GK] for the starting point of the trajectory: =0: from the beginning; >0: from the last T>initemp.