analysis Module Reference

Contains various routines for analysis and diagnostic output. More...

Functions/Subroutines

subroutine, public analysis_init ()
 Open files, write headers, allocate space etc. More...
 
subroutine, public output_initial_step (ctime, T9, rho_b, entropy, Rkm, Y, pf)
 Output first step. More...
 
subroutine, public output_final_step (cnt, ctime, T9, rho_b, entropy, Rkm, Y, pf)
 Output final step. More...
 
subroutine, public output_iteration (cnt, ctime, T9, rho_b, entropy, Rkm, Y, pf)
 Periodic output of analysis data for current iteration. More...
 
subroutine, private output_track_nuclei (ctime, Y)
 Output the abundances of specific nuclei. More...
 
subroutine, private output_nu_loss (ctime, temp, rho, Rkm)
 Output the energy that enters and leaves the system. More...
 
subroutine, private output_mainout (cnt, ctime, T9, rho_b, entropy, Rkm, Y)
 Output Mainout file. More...
 
subroutine, private output_snapshot (ctime, T9, rho_b, Y)
 Output Snapshot files. More...
 
subroutine output_flow (ctime, T9, rho_b, Y)
 Output flow files. More...
 
subroutine, public output_nr_diagnostic (cnt, k, nr_c, ctime, T9, stepsize, mtot, Y_p, Y)
 Output of the Newton-Raphson loop diagnostics. More...
 
subroutine, public output_final_stats (cnt, ctime)
 Print final statistics. More...
 
subroutine, private printsnap (t, T9, rho_b, Y)
 Print current snapshot. More...
 
subroutine, private calc_nseparation_energy (Y)
 Calculates average neutron separation energy. More...
 
subroutine, private calc_nuclear_heating (hdf5_mode, write_engen, write_toplist)
 : Calculate the generated energy for each class of reactions separately. More...
 
subroutine, private calc_av_timescales (ctime, T9, Y, hdf5)
 Calculate average timescales of different classes of reactions. More...
 
subroutine, public finab (Y)
 Compute final abundances and write final output. More...
 
subroutine, private finab_sort (nsize, list)
 auxiliary sorting subroutine More...
 
subroutine, public analysis_finalize ()
 Close files at the end of the calculation. More...
 

Variables

real(r_kind), dimension(:), allocatable sn
 array of n-separation energies More...
 
real(r_kindsn_ave
 average n-separation energy More...
 
integer mainout_unit
 file descriptor for the main analysis output file More...
 
integer nrdiag_unit
 diagnostic output inside the Newton-Rhapson loop More...
 
integer track_unit
 file id for tracked nuclei More...
 
integer toplist_unit
 file id for top nuclear energy contributors More...
 
integer nu_loss_gain_unit
 file id for neutrino loss/gain More...
 
integer cl_start
 
integer cl_end
 
integer cl_rate
 
integer cl_cmax
 system clock variables More...
 
integer, private tsfile
 timescale file unit More...
 
integer, private nuc_heat_file
 nuclear heating file unit More...
 
real(r_kindtsnp
 
real(r_kindt9snp
 
real(r_kindrosnp
 for snapshot printing triggers More...
 
integer snapcnt
 snapshot count More...
 
integer flowcnt
 flow printing counter More...
 
real, dimension(:), allocatable snapshot_time
 point in time for custom snapshot More...
 
integer snapshot_amount
 Amount of custom snapshots. More...
 
integer, parameter toplist_amount =10
 Amount of reactions in the toplist. More...
 

Detailed Description

Contains various routines for analysis and diagnostic output.

Function/Subroutine Documentation

◆ analysis_finalize()

subroutine, public analysis::analysis_finalize

Close files at the end of the calculation.

Author
: Moritz Reichert

Edited:

  • 01.03.17
  • 25.01.21

Definition at line 2014 of file analysis.f90.

Here is the call graph for this function:

◆ analysis_init()

subroutine, public analysis::analysis_init

Open files, write headers, allocate space etc.

Definition at line 51 of file analysis.f90.

Here is the call graph for this function:

◆ calc_av_timescales()

subroutine, private analysis::calc_av_timescales ( real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), dimension(net_size), intent(in)  Y,
logical, intent(in), optional  hdf5 
)
private

Calculate average timescales of different classes of reactions.

These timescales are calculated as in Arcones et al. 2012 (Eq. 1-6). The (p,gamma) timescale is given by e.g.,

\[ \tau_{p\gamma} = \left[ \frac{\rho Y_p}{Y_h}N_A \sum \langle \sigma \nu \rangle_{p,\gamma}(Z,A)Y(Z,A) \right]^{-1} \]

An example file looks like:

 # time[s]     Temperature [GK]     tau_ng [s]     tau_gn [s]     tau_pg [s]     tau_gp [s]     tau_np [s]     tau_pn [s]     tau_an [s]     tau_na [s]     tau_beta [s]     tau_alpha [s]     tau_nfiss [s]     tau_sfiss [s]     tau_bfiss [s]
  1.1130000000000000E+00    9.1821750000000009E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    1.2642767370327558E+01    2.9487624276191804E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00
  1.1220000000000001E+00    8.2638489999999951E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00    1.0557999180036711E+02    2.5923655028366777E+01    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00
  1.1247618491767180E+00    7.9904974735555152E+00    9.5690472538317728E-13    5.3150487750907188E-11    7.4419112944811684E-10    9.8479480155439862E-08    1.9792689873245490E-12    1.9444248037144314E-12    4.8686627517806918E-10    3.9657685448682009E-12    1.4600540103519526E+01    5.2634156341152767E+01    0.0000000000000000E+00    0.0000000000000000E+00    0.0000000000000000E+00
 ...
Parameters
[in]ctimecurrent time [s]
[in]t9Temperature [GK]
[in]hdf5Whether the output is written to hdf5 or not
[in]yabundances

Definition at line 1605 of file analysis.f90.

Here is the call graph for this function:

◆ calc_nseparation_energy()

subroutine, private analysis::calc_nseparation_energy ( real(r_kind), dimension(net_size), intent(in)  Y)
private

Calculates average neutron separation energy.

This neutron separation energy is printed in the mainout when parameter_class::calc_nsep_energy was set to "yes" and a valid file for parameter_class::nsep_energies_file.

Parameters
[in]yabundances

Definition at line 898 of file analysis.f90.

◆ calc_nuclear_heating()

subroutine, private analysis::calc_nuclear_heating ( logical, intent(in)  hdf5_mode,
logical, intent(in)  write_engen,
logical, intent(in)  write_toplist 
)
private

: Calculate the generated energy for each class of reactions separately.

This subroutine calculates the generated energy of the nuclear reactions with the help of the Q-values. This energy is written to an output only. It is not fed back to the temperature and has therefore no impact on the final result. Also, depending on the input the subroutine can calculate the top contributors to the energy generation. These top contributors can be reactions and isotopes.

See also
nuclear_heating
Author
: Moritz Reichert
Date
29.02.20

Edited:

  • 08.05.24: M.R. Moved the top list calculation from the nuclear heating to this subroutine.
Parameters
[in]hdf5_modewhether to store as hdf5 or ascii
[in]write_engenwhether to write the energy generation
[in]write_toplistwhether to write the energy toplist

Definition at line 958 of file analysis.f90.

Here is the call graph for this function:

◆ finab()

subroutine, public analysis::finab ( real(r_kind), dimension(net_size), intent(in)  Y)

Compute final abundances and write final output.

There are three files written finabsum.dat containing abundances summed over equal A, finab.dat containing all final abundances, finabelem.dat containing all abundances summed over equal Z.

Definition at line 1877 of file analysis.f90.

Here is the call graph for this function:

◆ finab_sort()

subroutine, private analysis::finab_sort ( integer, intent(in)  nsize,
integer, dimension(nsize), intent(out)  list 
)
private

auxiliary sorting subroutine

Definition at line 1944 of file analysis.f90.

◆ output_final_stats()

subroutine, public analysis::output_final_stats ( integer, intent(in)  cnt,
real(r_kind), intent(in)  ctime 
)

Print final statistics.

An example looks like:

 Final time reached.
 Final time:  2.000000000000E+17
 Total number of iterations:       5334
 Elapsed time [s]:  5.41572E+02
 

Edited:

  • 2023-02-06, M.R. took care of wrapping of the simulation time that could lead to negative simulation times.

Definition at line 819 of file analysis.f90.

◆ output_final_step()

subroutine, public analysis::output_final_step ( integer, intent(in)  cnt,
real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  rho_b,
real(r_kind), intent(in)  entropy,
real(r_kind), intent(in)  Rkm,
real(r_kind), dimension(net_size), intent(in)  Y,
real(r_kind), dimension(0:net_size), intent(inout)  pf 
)

Output final step.

This routine calls output_iteration at the last step

See also
output_final_step

Edited: OK 26.08.2017

Parameters
[in]cntcurrent iteration counter
[in]ctimeactual time [s]
[in]t9initial temperature [GK]
[in]rho_binitial density [gcc]
[in]entropyentropy [kB/nucleon]
[in]rkmRadius [km]
[in]yarray of abundances (Y_i)
[in,out]pfpartition functions

Definition at line 257 of file analysis.f90.

Here is the call graph for this function:

◆ output_flow()

subroutine analysis::output_flow ( real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  rho_b,
real(r_kind), dimension(net_size), intent(in)  Y 
)

Output flow files.

Edited:

  • 19.02.20, M. Jacobi
    Parameters
    [in]ctimecurrent time
    [in]t9temperature [GK]
    [in]rho_bdensity [gcc]
    [in]yarray of abundances Y_i

Definition at line 715 of file analysis.f90.

Here is the call graph for this function:

◆ output_initial_step()

subroutine, public analysis::output_initial_step ( real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  rho_b,
real(r_kind), intent(in)  entropy,
real(r_kind), intent(in)  Rkm,
real(r_kind), dimension(net_size), intent(in)  Y,
real(r_kind), dimension(0:net_size), intent(inout)  pf 
)

Output first step.

This routine calls output_iteration at the first step

See also
output_final_step
Parameters
[in]ctimeactual time [s]
[in]t9initial temperature [GK]
[in]rho_binitial density [gcc]
[in]entropyentropy [kB/nucleon]
[in]rkmRadius [km]
[in]yarray of abundances (Y_i)
[in,out]pfpartition functions

Definition at line 232 of file analysis.f90.

Here is the call graph for this function:

◆ output_iteration()

subroutine, public analysis::output_iteration ( integer, intent(in)  cnt,
real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  rho_b,
real(r_kind), intent(in)  entropy,
real(r_kind), intent(in)  Rkm,
real(r_kind), dimension(net_size), intent(in)  Y,
real(r_kind), dimension(0:net_size), intent(inout)  pf 
)

Periodic output of analysis data for current iteration.

Prints various outputs depending on the input parameter.

Edited:

  • MR : 19.01.21
Parameters
[in]cntcurrent iteration counter
[in]ctimeactual time [s]
[in]t9temperature [GK]
[in]rho_bdensity [gcc]
[in]entropyentropy [kB/nucleon]
[in]rkmlength scale [km]
[in]yarray of abundances (Y_i)
[in,out]pfpartition functions

Definition at line 308 of file analysis.f90.

Here is the call graph for this function:

◆ output_mainout()

subroutine, private analysis::output_mainout ( integer, intent(in)  cnt,
real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  rho_b,
real(r_kind), intent(in)  entropy,
real(r_kind), intent(in)  Rkm,
real(r_kind), dimension(net_size), intent(in)  Y 
)
private

Output Mainout file.

This file contains all basic quantities such as neutron abundance Yn, time, temperature, density, Abar, and much more. An example file looks like:

 # 1:iteration 2:time[s], 3:T[GK], 4:rho[g/cm3], 5:Ye
 # 6:R[km], 7:Y_n, 8:Y_p, 9:Y_alpha, 10:Y_lights
 # 11:Y_heavies 12:<Z> 13: 14:entropy [kB/baryon] (15:Sn [MeV])
    0  0.0000000000000000E+00   1.0964999999999998E+01   8.7095999999999795E+12   3.4880000000001680E-02   4.9272999999999975E+01   8.7430471311642388E-01   1.8154340816658842E-15   1.8313910002116333E-13   8.4293473893924100E-09   1.6154109228777289E-03   3.9820982195819934E-02   1.1416565996507526E+00   9.4638587929828290E-03
   10  4.0940000000000001E-09   1.0965038071994945E+01   8.7093701186135752E+12   3.4880006806212963E-02   4.9273176232580205E+01   8.7430472419630612E-01   1.8157922458135375E-15   1.8317495847108614E-13   8.4302150496944692E-09   1.6154086944791908E-03   3.9820989563731306E-02   1.1416565881127740E+00   9.4639764072160116E-03
 ...
Parameters
[in]cntcurrent iteration counter
[in]ctimecurrent time
[in]t9temperature [GK]
[in]rho_bdensity [gcc]
[in]entropyentropy [kB/nucleon]
[in]rkmlength scale [km]
[in]yarray of abundances (Y_i)

Definition at line 625 of file analysis.f90.

Here is the call graph for this function:

◆ output_nr_diagnostic()

subroutine, public analysis::output_nr_diagnostic ( integer, intent(in)  cnt,
integer, intent(in)  k,
integer, intent(in)  nr_c,
real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  stepsize,
real(r_kind), intent(in)  mtot,
real(r_kind), dimension(net_size)  Y_p,
real(r_kind), dimension(net_size)  Y 
)

Output of the Newton-Raphson loop diagnostics.

The diagnostic output contains NR iterations, timesteps, the nucleus that restricts the timestep and more. An example file looks like:

 # Newton-Raphson diagnostic output
 # 1 : global iteration count (cnt)
 # 2 : global time [s]
 # 3 : temperature T9 [GK]
 # 4 : adapt stepsize loop counter (k)
 # 5 : NR loop counter (nr_count)
 # 6 : global timestep [s]
 # 7 : mass conservation error
 # 8 : maximal abundance change (eps)
 # 9 : most rapidly evolving isotope (epsl)
 # 10: abundance of the isotope epsl, y(epsl)
       0   5.20740000000E-22   7.42450000000E+00    0    1   5.20740000000E-22   9.32587340685E-15   2.22044604925E-16 cl42   2.43899441583E-08
       0   5.20740000000E-22   7.42450000000E+00    0    2   5.20740000000E-22   9.32587340685E-15   2.22044604925E-16  s40   2.73320077046E-08
       1   1.56220000000E-21   7.42450000000E+00    0    1   1.04146000000E-21   9.32587340685E-15   2.22044604925E-16  he4   3.13811866442E-03
       1   1.56220000000E-21   7.42450000000E+00    0    2   1.04146000000E-21   9.32587340685E-15   2.22044604925E-16 mg30   1.57736344914E-10
 ...
Parameters
[in]cntglobal iteration counter
[in]kcounter in adapt_stepsize loop
[in]nr_ccounter in the NR loop
[in]ctimeglobal current time
[in]t9current temperature [GK]
[in]stepsizecurrent step size
[in]mtottotal mass
yold/new abundances

Definition at line 753 of file analysis.f90.

◆ output_nu_loss()

subroutine, private analysis::output_nu_loss ( real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  temp,
real(r_kind), intent(in)  rho,
real(r_kind), intent(in)  Rkm 
)
private

Output the energy that enters and leaves the system.

Outputs the energy that enters and leaves the system when nuclear_heating is turned on. This output is controlled by the parameter nu_loss_every . The output is written to the file "nu_loss_gain_file". An example of the file could look like:

 # File containing the neutrino loss/gain for the nuclear heating.
 # Negative values mean that energy is added to the system.
 # Neutrino energies are given in MeV/baryon/s.
 #           time[s]                 T[GK]            rho[g/cm3]                 R[km]              nu_total  ...
         1.10385E+00           1.00000E+01           4.89334E+07           3.55626E+02           0.00000E+00  ...
         1.10385E+00           1.00000E+01           4.89334E+07           3.55626E+02          -5.05524E+00  ...
         1.10385E+00           1.00000E+01           4.89334E+07           3.55626E+02          -5.05524E+00  ...
         1.10385E+00           1.00000E+01           4.89334E+07           3.55626E+02          -5.05524E+00  ...
 ...
Author
Moritz Reichert
Date
12.04.2023
Parameters
[in]ctimeactual time (s)
[in]temptemperature (GK)
[in]rhodensity (g/cm3)
[in]rkmradius (km)

Definition at line 587 of file analysis.f90.

◆ output_snapshot()

subroutine, private analysis::output_snapshot ( real(r_kind), intent(in)  ctime,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  rho_b,
real(r_kind), dimension(net_size), intent(in)  Y 
)
private

Output Snapshot files.

Snapshots store the abundances and mass fractions of all nuclei at certain times. An example file looks like:

 time    temp    dens
 9.77198412010000E-02   9.99927332947922E+00   3.88380373937259E+06
  nin     zin       y       x
 1    0     5.72194135572689E-01   5.72194135572689E-01
 0    1     3.92194484636783E-01   3.92194484636783E-01
 1    1     7.83033243870819E-05   1.56606648774164E-04
 ...

Edited:

  • 03.04.18, M. Jacobi
Parameters
[in]ctimecurrent time
[in]t9temperature [GK]
[in]rho_bdensity [gcc]
[in]yarray of abundances Y_i

Definition at line 695 of file analysis.f90.

Here is the call graph for this function:

◆ output_track_nuclei()

subroutine, private analysis::output_track_nuclei ( real(r_kind), intent(in)  ctime,
real(r_kind), dimension(net_size), intent(in)  Y 
)
private

Output the abundances of specific nuclei.

First column is always the time, followed by the abundances of nuclei given in "track_nuclei_file". An example of the file looks like:

 # time[s]                    Y(     n )                  Y(   o24 )                  Y(   f24 )
  0.0000000000000000E+00      0.0000000000000000E+00      2.0833333333333332E-02      0.0000000000000000E+00
  1.9999999999999999E-20      8.5150206007805894E-19      2.0833333333333332E-02      1.8661570495808601E-21
  5.9999999999999994E-20      2.5545061802341771E-18      2.0833333333333332E-02      5.5984711487425806E-21
  1.3999999999999998E-19      5.9605144205464133E-18      2.0833333333333332E-02      1.3063099347066021E-20
 ...
Author
: Moritz Reichert

Edited:

  • 09.06.17
Parameters
[in]ctimeActual time
[in]yarray of abundances (Y_i)

Definition at line 547 of file analysis.f90.

◆ printsnap()

subroutine, private analysis::printsnap ( real(r_kind), intent(in)  t,
real(r_kind), intent(in)  T9,
real(r_kind), intent(in)  rho_b,
real(r_kind), dimension(net_size), intent(in)  Y 
)
private

Print current snapshot.

Snapshots store the abundances and mass fractions of all nuclei at certain times. An example file looks like:

 time    temp    dens
 9.77198412010000E-02   9.99927332947922E+00   3.88380373937259E+06
  nin     zin       y       x
 1    0     5.72194135572689E-01   5.72194135572689E-01
 0    1     3.92194484636783E-01   3.92194484636783E-01
 1    1     7.83033243870819E-05   1.56606648774164E-04
 ...

Definition at line 858 of file analysis.f90.

Here is the call graph for this function:

Variable Documentation

◆ cl_cmax

integer analysis::cl_cmax

system clock variables

Definition at line 24 of file analysis.f90.

◆ cl_end

integer analysis::cl_end

Definition at line 24 of file analysis.f90.

◆ cl_rate

integer analysis::cl_rate

Definition at line 24 of file analysis.f90.

◆ cl_start

integer analysis::cl_start

Definition at line 24 of file analysis.f90.

◆ flowcnt

integer analysis::flowcnt

flow printing counter

Definition at line 29 of file analysis.f90.

◆ mainout_unit

integer analysis::mainout_unit

file descriptor for the main analysis output file

Definition at line 19 of file analysis.f90.

◆ nrdiag_unit

integer analysis::nrdiag_unit

diagnostic output inside the Newton-Rhapson loop

Definition at line 20 of file analysis.f90.

◆ nu_loss_gain_unit

integer analysis::nu_loss_gain_unit

file id for neutrino loss/gain

Definition at line 23 of file analysis.f90.

◆ nuc_heat_file

integer, private analysis::nuc_heat_file
private

nuclear heating file unit

Definition at line 26 of file analysis.f90.

◆ rosnp

real(r_kind) analysis::rosnp

for snapshot printing triggers

Definition at line 27 of file analysis.f90.

◆ sn

real(r_kind), dimension(:), allocatable analysis::sn

array of n-separation energies

Definition at line 17 of file analysis.f90.

◆ sn_ave

real(r_kind) analysis::sn_ave

average n-separation energy

Definition at line 18 of file analysis.f90.

◆ snapcnt

integer analysis::snapcnt

snapshot count

Definition at line 28 of file analysis.f90.

◆ snapshot_amount

integer analysis::snapshot_amount

Amount of custom snapshots.

Definition at line 31 of file analysis.f90.

◆ snapshot_time

real, dimension(:), allocatable analysis::snapshot_time

point in time for custom snapshot

Definition at line 30 of file analysis.f90.

◆ t9snp

real(r_kind) analysis::t9snp

Definition at line 27 of file analysis.f90.

◆ toplist_amount

integer, parameter analysis::toplist_amount =10

Amount of reactions in the toplist.

Definition at line 32 of file analysis.f90.

◆ toplist_unit

integer analysis::toplist_unit

file id for top nuclear energy contributors

Definition at line 22 of file analysis.f90.

◆ track_unit

integer analysis::track_unit

file id for tracked nuclei

Definition at line 21 of file analysis.f90.

◆ tsfile

integer, private analysis::tsfile
private

timescale file unit

Definition at line 25 of file analysis.f90.

◆ tsnp

real(r_kind) analysis::tsnp

Definition at line 27 of file analysis.f90.