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
233 unit%pi = 3.14159265358979323846d0
234 unit%mass_n = 939.56533d0
235 unit%mass_p = 938.271998d0
236 unit%mass_u = 931.494013d0
237 unit%mass_e = 0.510998910d0
238 unit%me = 9.1093826d-28
239 unit%n_a = 6.02214179d23
240 unit%hbc = 197.327053d0
241 unit%k_b = 1.380662d-23
242 unit%k_mev = 8.617343d-11
243 unit%conv_ev = 1.602189246d-19
244 unit%kerg = 1.3806504d-16
245 unit%clight = 2.99792458d10
246 unit%h = 6.62606876d-34
247 unit%hbar_mev= 6.582122d-22
248 unit%h_mevs = 4.135667273d-21
249 unit%hix = 1.036427d-18
250 unit%amu = 1.66053873d-24
251 unit%grav = 6.67384d-8
252 unit%msol = 1.9891d33
253 unit%ergtomev= 0.62415d6
271 character(*),
intent(in) :: parfile
273 character(1000) :: line
274 character(param_name_len) :: param_name
275 character(2000) :: param_value
276 character(2),
parameter :: blanks =
" "//achar(9)
277 integer :: parfile_unit, istat, ieq, i1,i2,ln
283 read (parfile_unit,
'(A)',iostat=istat) line
284 if (istat .ne. 0)
exit
285 i1= verify(line,blanks)
287 i2= verify(line,blanks,back=.true.)
289 if(line(1:1).eq.
'#') cycle
293 trim(adjustl(
int_to_str(ln)))//
" :"//new_line(
"A")//&
294 trim(adjustl(line)) ,
"read_param",340003)
296 i2= verify(line(1:ieq-1),blanks,back=.true.)
299 trim(adjustl(
int_to_str(ln)))//
" :"//new_line(
"A")//&
300 trim(adjustl(line)) ,
"read_param",340003)
302 param_name= line(1:i2)
303 i2= verify(line,blanks,back=.true.)
304 i1= ieq-1 + verify(line(ieq:i2),blanks//
"=")
305 param_value= line(i1:i2)
332 character(*),
intent(in) :: param_name
333 character(*),
intent(in) :: param_value
335 character(9999) :: all_possible_par
336 character(*),
parameter :: integer_params = &
338 ":snapshot_every" // &
340 ":mainout_every" // &
342 ":timescales_every" // &
345 ":termination_criterion" // &
347 ":expansiontype" // &
348 ":h_snapshot_every" // &
349 ":track_nuclei_every" // &
351 ":adapt_stepsize_maxcount" // &
352 ":extrapolation_width" // &
354 ":nse_calc_every" // &
356 ":top_engen_every" // &
357 ":h_mainout_every" // &
358 ":h_track_nuclei_every"//&
359 ":h_timescales_every" // &
361 ":h_engen_every" // &
362 ":gear_nr_maxcount" // &
365 ":fission_frag_beta_delayed"//&
366 ":fission_frag_n_induced"//&
367 ":fission_frag_spontaneous"//&
368 ":fission_frag_missing"//&
369 ":fission_format_spontaneous"//&
370 ":fission_format_beta_delayed"//&
371 ":fission_format_n_induced"//&
373 ":gear_nr_mincount" // &
374 ":alpha_decay_zmin" // &
375 ":alpha_decay_zmax" // &
378 ":nu_loss_every" // &
379 ":h_nu_loss_every" // &
382 character(*),
parameter :: real_params = &
383 ":temp_reload_exp_weak_rates" // &
390 ":nse_descend_t9start" // &
397 ":gear_timestep_max"// &
398 ":heating_T9_tol"// &
399 ":timestep_factor"// &
402 ":timestep_hydro_factor"// &
406 ":initial_stepsize"// &
407 ":freeze_rate_temp"// &
409 ":nse_delt_t9min" // &
411 character(*),
parameter :: logical_params = &
412 ":read_initial_composition" // &
415 ":gear_ignore_adapt_stepsize" // &
416 ":calc_nsep_energy" // &
417 ":timestep_traj_limit" // &
418 ":custom_snapshots" // &
419 ":h_custom_snapshots" // &
420 ":h_engen_detailed" // &
421 ":use_detailed_balance" // &
422 ":use_timmes_mue" // &
423 ":use_detailed_balance_q_reac" // &
424 ":use_tabulated_rates" // &
425 ":use_beta_decay_file" //&
426 ":use_alpha_decay_file" // &
427 ":alpha_decay_ignore_all"//&
428 ":use_neutrino_loss_file" // &
429 ":use_thermal_nu_loss"//&
430 ":use_prepared_network"
431 character(*),
parameter :: string_params = &
432 ":trajectory_file" // &
435 ":isotopes_file" // &
438 ":fission_rates_spontaneous" // &
439 ":fission_rates_beta_delayed" // &
440 ":fission_rates_n_induced" // &
441 ":weak_rates_file" // &
442 ":chem_pot_file" // &
443 ":nsep_energies_file" // &
444 ":alpha_decay_src_ignore" // &
445 ":nunucleo_rates_file" // &
446 ":nuchannel_file" // &
447 ":nfission_file" // &
448 ":bfission_file" // &
449 ":sfission_file" // &
450 ":trajectory_mode" // &
451 ":trajectory_format" // &
452 ":track_nuclei_file" // &
454 ":snapshot_file" // &
455 ":beta_decay_file" // &
456 ":neutrino_mode" // &
470 ":alpha_decay_file" // &
471 ":detailed_balance_src_ignore" // &
472 ":detailed_balance_src_q_reac" // &
473 ":detailed_balance_src_q_winvn" // &
474 ":tabulated_rates_file" // &
475 ":tabulated_temperature_file" // &
476 ":beta_decay_src_ignore" // &
477 ":neutrino_loss_file" // &
478 ":prepared_network_path"
480 logical :: lparam_value
482 real(r_kind) :: score
483 character(999) :: cl_par
484 character(2000) :: str_value
485 character(500) :: h_err_msg
488 i2= index(param_value,
"#")
489 if ((param_value(1:1).eq.
"'") .or.(param_value(1:1).eq.
'"')) &
491 str_value= trim(param_value(2:len_trim(param_value)-1))
493 str_value= trim(param_value(1:i2-1))
495 str_value= trim(param_value)
498 if(len_trim(str_value).ge.5)
then
499 lparam_value= (str_value(1:5).eq.
"'yes'") &
500 .or.(str_value(1:5).eq.
'"yes"')
501 elseif(len_trim(str_value).ge.3)
then
502 lparam_value= (str_value(1:3).eq.
"yes")
504 lparam_value= .false.
508 if(param_name.eq.
"out_every")
then
510 elseif(param_name.eq.
"snapshot_every")
then
512 elseif(param_name.eq.
"h_snapshot_every")
then
514 elseif(param_name.eq.
"h_mainout_every")
then
516 elseif(param_name.eq.
"flow_every")
then
518 elseif(param_name.eq.
"h_flow_every")
then
520 elseif(param_name.eq.
"timescales_every")
then
522 elseif(param_name.eq.
"h_timescales_every")
then
524 elseif(param_name.eq.
"engen_every")
then
526 elseif(param_name.eq.
"h_engen_every")
then
528 elseif(param_name.eq.
"nrdiag_every")
then
530 elseif(param_name.eq.
"mainout_every")
then
532 elseif(param_name.eq.
"iwformat")
then
534 elseif(param_name.eq.
"iwinterp")
then
536 elseif(param_name.eq.
"nuflag")
then
538 elseif(param_name.eq.
"fissflag")
then
540 elseif(param_name.eq.
"termination_criterion")
then
542 elseif(param_name.eq.
"expansiontype")
then
544 elseif(param_name.eq.
"nr_maxcount")
then
546 elseif(param_name.eq.
"nr_mincount")
then
548 elseif(param_name.eq.
"adapt_stepsize_maxcount")
then
550 elseif(param_name.eq.
"track_nuclei_every")
then
552 elseif(param_name.eq.
"h_track_nuclei_every")
then
554 elseif(param_name.eq.
"top_engen_every")
then
556 elseif(param_name.eq.
"extrapolation_width")
then
558 elseif(param_name.eq.
"solver")
then
560 elseif(param_name.eq.
"heating_mode")
then
562 elseif(param_name.eq.
"fission_frag_beta_delayed")
then
564 elseif(param_name.eq.
"fission_frag_missing")
then
566 elseif(param_name.eq.
"fission_frag_n_induced")
then
568 elseif(param_name.eq.
"fission_frag_spontaneous")
then
570 elseif(param_name.eq.
"fission_format_spontaneous")
then
572 elseif(param_name.eq.
"fission_format_beta_delayed")
then
574 elseif(param_name.eq.
"fission_format_n_induced")
then
576 elseif(param_name.eq.
"screening_mode")
then
578 elseif(param_name.eq.
"interp_mode")
then
580 elseif(param_name.eq.
"nse_calc_every")
then
582 elseif(param_name.eq.
"gear_nr_maxcount")
then
584 elseif(param_name.eq.
"gear_nr_mincount")
then
586 elseif(param_name.eq.
"alpha_decay_zmin")
then
588 elseif(param_name.eq.
"alpha_decay_zmax")
then
590 elseif(param_name.eq.
"nse_max_it")
then
592 elseif(param_name.eq.
"nse_solver")
then
594 elseif(param_name.eq.
"nu_loss_every")
then
596 elseif(param_name.eq.
"h_nu_loss_every")
then
600 elseif(param_name.eq.
"temp_reload_exp_weak_rates")
then
602 elseif(param_name.eq.
"engen")
then
604 elseif(param_name.eq.
"initemp_cold")
then
606 elseif(param_name.eq.
"initemp_hot")
then
608 elseif(param_name.eq.
"nsetemp_cold")
then
610 elseif(param_name.eq.
"nse_nr_tol")
then
612 elseif(param_name.eq.
"nse_delt_t9min")
then
614 elseif(param_name.eq.
"nsetemp_hot")
then
616 elseif(param_name.eq.
"heating_frac")
then
618 elseif(param_name.eq.
"heating_density")
then
620 elseif(param_name.eq.
"nse_descend_t9start")
then
622 elseif(param_name.eq.
"initial_stepsize")
then
624 elseif(param_name.eq.
"final_time")
then
626 elseif(param_name.eq.
"final_temp")
then
628 elseif(param_name.eq.
"final_dens")
then
630 elseif(param_name.eq.
"t_analytic")
then
632 elseif(param_name.eq.
"gear_eps")
then
634 elseif(param_name.eq.
"gear_escale")
then
636 elseif(param_name.eq.
"gear_cFactor")
then
638 elseif(param_name.eq.
"gear_nr_eps")
then
640 elseif(param_name.eq.
"gear_timestep_max")
then
642 elseif(param_name.eq.
"heating_T9_tol")
then
644 elseif(param_name.eq.
"timestep_max")
then
646 elseif(param_name.eq.
"timestep_factor")
then
648 elseif(param_name.eq.
"timestep_hydro_factor")
then
650 elseif(param_name.eq.
"timestep_Ymin")
then
652 elseif(param_name.eq.
"nr_tol")
then
654 elseif(param_name.eq.
"freeze_rate_temp")
then
657 elseif(param_name.eq.
"read_initial_composition")
then
659 elseif(param_name.eq.
"calc_nsep_energy")
then
661 elseif(param_name.eq.
"h_engen_detailed")
then
663 elseif(param_name.eq.
"timestep_traj_limit")
then
665 elseif(param_name.eq.
"custom_snapshots")
then
667 elseif(param_name.eq.
"h_custom_snapshots")
then
669 elseif(param_name.eq.
"use_htpf")
then
671 elseif(param_name.eq.
"h_finab")
then
673 elseif(param_name.eq.
"use_timmes_mue")
then
675 elseif(param_name.eq.
"use_tabulated_rates")
then
677 elseif(param_name.eq.
"use_beta_decay_file")
then
679 elseif(param_name.eq.
"use_prepared_network")
then
681 elseif(param_name.eq.
"use_alpha_decay_file")
then
683 elseif(param_name.eq.
"use_detailed_balance")
then
685 elseif(param_name.eq.
"use_detailed_balance_q_reac")
then
687 elseif(param_name.eq.
"use_thermal_nu_loss")
then
689 elseif(param_name.eq.
"use_neutrino_loss_file")
then
691 elseif(param_name.eq.
"gear_ignore_adapt_stepsize")
then
693 elseif(param_name.eq.
"alpha_decay_ignore_all")
then
696 elseif(param_name.eq.
"trajectory_mode")
then
698 elseif(param_name.eq.
"trajectory_file")
then
700 elseif(param_name.eq.
"T9_analytic")
then
702 elseif(param_name.eq.
"rho_analytic")
then
704 elseif(param_name.eq.
"Rkm_analytic")
then
706 elseif(param_name.eq.
"Ye_analytic")
then
708 elseif(param_name.eq.
"alpha_decay_file")
then
710 elseif(param_name.eq.
"beta_decay_file")
then
712 elseif(param_name.eq.
"seed_file")
then
714 elseif(param_name.eq.
"seed_format")
then
716 elseif(param_name.eq.
"snapshot_file")
then
718 elseif(param_name.eq.
"net_source")
then
720 elseif(param_name.eq.
"isotopes_file")
then
722 elseif(param_name.eq.
"prepared_network_path")
then
724 elseif(param_name.eq.
"htpf_file")
then
726 elseif(param_name.eq.
"reaclib_file")
then
728 elseif(param_name.eq.
"fission_rates_beta_delayed")
then
730 elseif(param_name.eq.
"fission_rates_spontaneous")
then
732 elseif(param_name.eq.
"fission_rates_n_induced")
then
734 elseif(param_name.eq.
"weak_rates_file")
then
736 elseif(param_name.eq.
"tabulated_rates_file")
then
738 elseif(param_name.eq.
"tabulated_temperature_file")
then
740 elseif(param_name.eq.
"chem_pot_file")
then
742 elseif(param_name.eq.
"nsep_energies_file")
then
744 elseif(param_name.eq.
"nuchannel_file")
then
746 elseif(param_name.eq.
"nurates_file")
then
748 elseif(param_name.eq.
"nunucleo_rates_file")
then
750 elseif(param_name.eq.
"nfission_file")
then
752 elseif(param_name.eq.
"bfission_file")
then
754 elseif(param_name.eq.
"sfission_file")
then
756 elseif(param_name.eq.
"trajectory_format")
then
758 elseif(param_name.eq.
"track_nuclei_file")
then
760 elseif(param_name.eq.
"neutrino_mode")
then
762 elseif(param_name.eq.
"Le")
then
764 elseif(param_name.eq.
"Lebar")
then
765 lebar = trim(str_value)
766 elseif(param_name.eq.
"Enue")
then
767 enue = trim(str_value)
768 elseif(param_name.eq.
"Enuebar")
then
770 elseif(param_name.eq.
"Lx")
then
772 elseif(param_name.eq.
"Lxbar")
then
773 lxbar = trim(str_value)
774 elseif(param_name.eq.
"Enux")
then
775 enux = trim(str_value)
776 elseif(param_name.eq.
"Enuxbar")
then
778 elseif(param_name.eq.
"beta_decay_src_ignore")
then
780 elseif(param_name.eq.
"alpha_decay_src_ignore")
then
782 elseif(param_name.eq.
"detailed_balance_src_ignore")
then
784 elseif(param_name.eq.
"detailed_balance_src_q_reac")
then
786 elseif(param_name.eq.
"detailed_balance_src_q_winvn")
then
788 elseif(param_name.eq.
"neutrino_loss_file")
then
793 all_possible_par = integer_params//real_params//logical_params//string_params
799 if (score .lt. max(len_trim(adjustl(param_name)),&
800 len_trim(adjustl(cl_par)))/2)
then
802 h_err_msg = new_line(
'A')//
"Did you mean '"//trim(adjustl(cl_par))//
"'?"
808 call raise_exception(
'Unknown parameter: '//trim(adjustl(param_name))//
"."&
809 //trim(adjustl(h_err_msg)),
"set_param",340004)
824 character(len=*),
intent(in) :: input_string
825 character(len=*),
intent(in) :: param_name
833 if (rstat .ne. 0)
then
834 call raise_exception(
'Could not parse parameter "'//trim(adjustl(param_name))//&
835 '". '//new_line(
"A")//
'The value "'//&
836 trim(adjustl(input_string))//&
837 '" is not valid for this parameter. '//new_line(
"A")//&
838 'This parameter assumes an integer.', &
839 "read_integer_param",&
853 character(len=*),
intent(in) :: input_string
854 character(len=*),
intent(in) :: param_name
862 if (rstat .ne. 0)
then
863 call raise_exception(
'Could not parse parameter "'//trim(adjustl(param_name))//&
864 '". '//new_line(
"A")//
'The value "'//&
865 trim(adjustl(input_string))//&
866 '" is not valid for this parameter. '//new_line(
"A")//&
867 'This parameter assumes a float.', &
883 character(len=100) :: win_path
888 call get_environment_variable(
'WinNet_path', win_path, status)
891 if (status == 0)
then
894 if (verbose_level .ge. 1)
then
895 write(*,*)
'Environment variable "WinNet_path" is not set. Default parameters may not work!'
899 win_path = trim(win_path)//
"/data/"
946 htpf_file = trim(adjustl(win_path))//
"datafile2.txt"
959 net_source = trim(adjustl(win_path))//
"sunet_complete"
983 reaclib_file = trim(adjustl(win_path))//
"Reaclib_18_9_20"
1003 snapshot_file = trim(adjustl(win_path))//
"snapshot_freq.dat"
1039 weak_rates_file = trim(adjustl(win_path))//
"theoretical_weak_rates.dat"
1054 character(3) :: yesno
1056 if (verbose_level .ge. 2)
then
1067 write(ofile,
'(3A)')
'bfission_file = "', trim(
bfission_file),
'"'
1069 write(ofile,
'(3A)')
'chem_pot_file = "', trim(
chem_pot_file),
'"'
1074 write(ofile,
'(A,I5)')
'engen_every = ' ,
engen_every
1075 write(ofile,
'(3A)')
'Enue ="' , trim(
enue),
'"'
1076 write(ofile,
'(3A)')
'Enuebar ="' , trim(
enuebar),
'"'
1077 write(ofile,
'(3A)')
'Enux ="' , trim(
enux),
'"'
1078 write(ofile,
'(3A)')
'Enuxbar ="' , trim(
enuxbar),
'"'
1081 write(ofile,
'(A,es14.7)')
'final_dens =' ,
final_dens
1082 write(ofile,
'(A,es14.7)')
'final_temp =' ,
final_temp
1083 write(ofile,
'(A,es14.7)')
'final_time =' ,
final_time
1084 write(ofile,
'(A,I1)')
'fissflag = ' ,
fissflag
1095 write(ofile,
'(A,I5)')
'flow_every = ' ,
flow_every
1097 write(ofile,
'(A,es14.7)')
'gear_cFactor =' ,
gear_cfactor
1098 write(ofile,
'(A,es14.7)')
'gear_eps =' ,
gear_eps
1099 write(ofile,
'(A,es14.7)')
'gear_escale =' ,
gear_escale
1101 write(ofile,
'(A,es14.7)')
'gear_nr_eps =' ,
gear_nr_eps
1108 write(ofile,
'(2A)')
'h_finab = ' , yesno(
h_finab)
1116 write(ofile,
'(A,es14.7)')
'heating_frac =' ,
heating_frac
1119 write(ofile,
'(3A)')
'htpf_file = "', trim(
htpf_file),
'"'
1120 write(ofile,
'(A,es14.7)')
'initemp_cold =' ,
initemp_cold
1121 write(ofile,
'(A,es14.7)')
'initemp_hot =' ,
initemp_hot
1123 write(ofile,
'(3A)')
'isotopes_file = "', trim(
isotopes_file),
'"'
1124 write(ofile,
'(A,I1)')
'interp_mode = ' ,
interp_mode
1125 write(ofile,
'(A,I1)')
'iwformat = ' ,
iwformat
1126 write(ofile,
'(A,I1)')
'iwinterp = ' ,
iwinterp
1127 write(ofile,
'(3A)')
'Le ="' , trim(
le),
'"'
1128 write(ofile,
'(3A)')
'Lebar ="' , trim(
lebar),
'"'
1129 write(ofile,
'(3A)')
'Lx ="' , trim(
lx),
'"'
1130 write(ofile,
'(3A)')
'Lxbar ="' , trim(
lxbar),
'"'
1132 write(ofile,
'(3A)')
'net_source = "', trim(
net_source),
'"'
1133 write(ofile,
'(3A)')
'nfission_file = "', trim(
nfission_file),
'"'
1135 write(ofile,
'(3A)')
'neutrino_mode = ' , trim(
neutrino_mode)
1136 write(ofile,
'(A,I5)')
'nr_maxcount = ' ,
nr_maxcount
1137 write(ofile,
'(A,I5)')
'nr_mincount = ' ,
nr_mincount
1138 write(ofile,
'(A,es14.7)')
'nr_tol =' ,
nr_tol
1143 write(ofile,
'(A,I5)')
'nse_max_it = ' ,
nse_max_it
1144 write(ofile,
'(A,es14.7)')
'nse_nr_tol =' ,
nse_nr_tol
1145 write(ofile,
'(A,I5)')
'nse_solver = ' ,
nse_solver
1147 write(ofile,
'(A,es14.7)')
'nsetemp_cold =' ,
nsetemp_cold
1148 write(ofile,
'(A,es14.7)')
'nsetemp_hot =' ,
nsetemp_hot
1149 write(ofile,
'(A,I1)')
'nuflag = ' ,
nuflag
1150 write(ofile,
'(3A)')
'nuchannel_file = "', trim(
nuchannel_file),
'"'
1153 write(ofile,
'(3A)')
'nurates_file = "', trim(
nurates_file),
'"'
1154 write(ofile,
'(A,I5)')
'out_every = ' ,
out_every
1156 write(ofile,
'(3A)')
'reaclib_file = "', trim(
reaclib_file),
'"'
1158 write(ofile,
'(3A)')
'rho_analytic = "', trim(
rho_analytic),
'"'
1159 write(ofile,
'(3A)')
'Rkm_analytic = "', trim(
rkm_analytic),
'"'
1161 write(ofile,
'(3A)')
'seed_file = "', trim(
seed_file),
'"'
1162 write(ofile,
'(3A)')
'seed_format = "', trim(
seed_format),
'"'
1163 write(ofile,
'(3A)')
'sfission_file = "', trim(
sfission_file),
'"'
1165 write(ofile,
'(3A)')
'snapshot_file = "', trim(
snapshot_file),
'"'
1166 write(ofile,
'(A,I1)')
'solver = ' ,
solver
1167 write(ofile,
'(A,es14.7)')
't_analytic =' ,
t_analytic
1168 write(ofile,
'(3A)')
'T9_analytic = "', trim(
t9_analytic),
'"'
1174 write(ofile,
'(A,es14.7)')
'timestep_max =' ,
timestep_max
1189 write(ofile,
'(2A)')
'use_htpf = ' , yesno(
use_htpf)
1196 write(ofile,
'(3A)')
'Ye_analytic = "', trim(
ye_analytic),
'"'
1222 ' GK) should be smaller than "nsetemp_hot" ('//&
1224 "check_param", 340006)
1230 ' GK) should be smaller than "initemp_hot" ('//&
1232 "check_param",340007)
1237 ') should be smaller than "nr_maxcount" ('//&
1239 "check_param",340008)
1244 ') should be smaller than "gear_nr_maxcount" ('//&
1246 "check_param",340008)
1251 call raise_exception(
'The parameter "termination_criterion" is set to "0" (after end of trajectory)'//&
1252 'but the trajectory mode is set to "analytic".',&
1253 "check_param",340009)
1286 character(*),
intent(in) :: possible_pars
1288 character(*),
intent(in) :: input_par
1289 character(*),
intent(out) :: cl_par
1290 real(r_kind),
intent(out) :: score
1291 character(999) :: helper_char
1292 character(999) :: ms_par
1293 real(r_kind) :: cl_dist
1294 real(r_kind) :: h_dist
1303 do k=2,len(possible_pars)
1306 if (possible_pars(k:k) .ne.
":")
then
1307 helper_char = trim(adjustl(helper_char))//possible_pars(k:k)
1310 if ((possible_pars(k:k) .eq.
":") .or. (k .eq. len(possible_pars)))
then
1314 if (h_dist .lt. cl_dist)
then
1316 ms_par = trim(adjustl(helper_char))
1326 cl_par = trim(adjustl(ms_par))
1341 character(*),
intent(in) :: par1
1342 character(*),
intent(in) :: par2
1344 character(1) :: upper1
1345 character(1) :: upper2
1350 real(
r_kind),
dimension(:,:),
allocatable :: d
1356 allocate(d(0:m,0:n),stat=stat)
1358 "LevenshteinDistance",320001)
1374 if (par1(i:i) .eq. par2(j:j))
then
1378 h = iachar(par1(i:i))
1379 if (h>= iachar(
"a") .and. h<=iachar(
"z") )
then
1380 upper1 = achar(iachar(par1(i:i))-32)
1384 h = iachar(par2(j:j))
1385 if (h>= iachar(
"a") .and. h<=iachar(
"z") )
then
1386 upper2 = achar(iachar(par2(j:j))-32)
1392 if (upper2 .eq. upper1)
then
1399 d(i,j) = min(d(i-1,j)+1, d(i, j-1) + 1, d(i-1, j-1) + scost)
1426 integer :: int_helper
1427 logical :: log_helper
1440 read(file_id) int_helper
1441 if (int_helper .ne.
nuflag)
then
1442 call raise_exception(
"The prepared network file does not match the nuflag of the current run. "// &
1444 "Please check the prepared network file.",&
1445 "read_sanity_check_prepared_network",340010)
1447 read(file_id) int_helper
1449 call raise_exception(
"The prepared network file does not match the fissflag of the current run. "// &
1451 "Please check the prepared network file.",&
1452 "read_sanity_check_prepared_network",340010)
1454 read(file_id) int_helper
1456 call raise_exception(
"The prepared network file does not match the iwformat of the current run. "// &
1458 "Please check the prepared network file.",&
1459 "read_sanity_check_prepared_network",340010)
1461 read(file_id) int_helper
1463 call raise_exception(
"The prepared network file does not match the iwinterp of the current run. "// &
1465 "Please check the prepared network file.",&
1466 "read_sanity_check_prepared_network",340010)
1468 read(file_id) log_helper
1470 call raise_exception(
"The prepared network file does not match the use_alpha_decay_file of the current run. "// &
1471 "Please check the prepared network file.",&
1472 "read_sanity_check_prepared_network",340010)
1474 read(file_id) log_helper
1476 call raise_exception(
"The prepared network file does not match the use_beta_decay_file of the current run. "// &
1477 "Please check the prepared network file.",&
1478 "read_sanity_check_prepared_network",340010)
1480 read(file_id) log_helper
1482 call raise_exception(
"The prepared network file does not match the use_tabulated_rates 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_detailed_balance 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_neutrino_loss_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
1499 if (log_helper .neqv.
use_htpf)
then
1500 call raise_exception(
"The prepared network file does not match the use_htpf 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_timmes_mue of the current run. "// &
1507 "Please check the prepared network file.",&
1508 "read_sanity_check_prepared_network",340010)
1527 character(len=*),
intent(in) :: path
1529 character(3) :: yesno
1534 write(ofile,
'(A)')
'Folder containing network and reaction data in unformatted binary format.'
1535 write(ofile,
'(A)')
''
1536 write(ofile,
'(A)')
''
1537 write(ofile,
'(A)')
'The following list contains relevant parameters that were used to create the network data:'
1538 write(ofile,
'(A)')
'=========================================================================================='
1539 write(ofile,
'(A)')
''
1542 write(ofile,
'(3A)')
'isotopes_file = "', trim(
isotopes_file),
'"'
1543 write(ofile,
'(3A)')
'net_source = "', trim(
net_source),
'"'
1544 write(ofile,
'(3A)')
'reaclib_file = "', trim(
reaclib_file),
'"'
1545 write(ofile,
'(A)')
''
1557 write(ofile,
'(A)')
''
1566 write(ofile,
'(A)')
''
1577 write(ofile,
'(A)')
''
1581 write(ofile,
'(A,I1)')
'iwformat = ' ,
iwformat
1583 write(ofile,
'(A,I1)')
'iwinterp = ' ,
iwinterp
1585 write(ofile,
'(3A)')
'chem_pot_file = "', trim(
chem_pot_file),
'"'
1588 write(ofile,
'(A)')
''
1597 write(ofile,
'(A)')
''
1600 write(ofile,
'(2A)')
'use_htpf = ' , yesno(
use_htpf)
1602 write(ofile,
'(3A)')
'htpf_file = "', trim(
htpf_file),
'"'
1604 write(ofile,
'(A)')
''
1607 write(ofile,
'(A,I1)')
'nuflag = ' ,
nuflag
1608 if ((
nuflag) .gt. 0)
then
1611 write(ofile,
'(3A)')
'nuchannel_file = "', trim(
nuchannel_file),
'"'
1612 write(ofile,
'(3A)')
'nurates_file = "', trim(
nurates_file),
'"'
1615 write(ofile,
'(A)')
''
1618 write(ofile,
'(A,I1)')
'fissflag = ' ,
fissflag
1627 write(ofile,
'(3A)')
'nfission_file = "', trim(
nfission_file),
'"'
1630 write(ofile,
'(3A)')
'bfission_file = "', trim(
bfission_file),
'"'
1631 write(ofile,
'(3A)')
'sfission_file = "', trim(
sfission_file),
'"'
1634 write(ofile,
'(A)')
''
1658 character(len=*),
intent(in) :: path
1688 character(3) :: quote
1689 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
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.
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
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.