diff --git a/src/initialize.F90 b/src/initialize.F90 index ced55d5757..c2d5e31860 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -19,7 +19,7 @@ module initialize use global use hdf5_interface, only: file_open, read_attribute, file_close, & hdf5_bank_t, hdf5_integer8_t - use input_xml, only: read_input_xml, read_plots_xml + use input_xml, only: read_input_xml use material_header, only: Material use message_passing use mgxs_data, only: read_mgxs, create_macro_xs @@ -82,18 +82,12 @@ contains ! Read command line arguments call read_command_line() - ! Read XML input files - call read_input_xml() - - ! Initialize random number generator -- this has to be done after the input - ! files have been read in case the user specified a seed for the random - ! number generator - + ! Initialize random number generator -- if the user specifies a seed, it + ! will be re-initialized later call initialize_prng() - ! Read plots.xml if it exists -- this has to be done separate from the other - ! XML files because we need the PRNG to be initialized first - if (run_mode == MODE_PLOTTING) call read_plots_xml() + ! Read XML input files + call read_input_xml() ! Initialize distribcell_filters call prepare_distribcell() diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 0c3cc08c30..e7ccc1f7cf 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -24,7 +24,7 @@ module input_xml use multipole, only: multipole_read use output, only: write_message, title, header use plot_header - use random_lcg, only: prn, seed + use random_lcg, only: prn, seed, initialize_prng use surface_header use set_header, only: SetChar use stl_vector, only: VectorInt, VectorReal, VectorChar @@ -81,6 +81,9 @@ contains ! Normalize atom/weight percents if (run_mode /= MODE_PLOTTING) call normalize_ao() + ! Read plots.xml if it exists + if (run_mode == MODE_PLOTTING) call read_plots_xml() + end subroutine read_input_xml subroutine finalize_geometry(material_temps, nuc_temps, sab_temps) @@ -306,7 +309,10 @@ contains end if ! Copy random number seed if specified - if (check_for_node(root, "seed")) call get_node_value(root, "seed", seed) + if (check_for_node(root, "seed")) then + call get_node_value(root, "seed", seed) + call initialize_prng() + end if ! Number of bins for logarithmic grid if (check_for_node(root, "log_grid_bins")) then