diff --git a/docs/source/devguide/statepoint.rst b/docs/source/devguide/statepoint.rst index 8b48e908d5..7fbfe14a15 100644 --- a/docs/source/devguide/statepoint.rst +++ b/docs/source/devguide/statepoint.rst @@ -4,6 +4,254 @@ State Point Binary File Specifications ====================================== +---------- +Revision 8 +---------- + +**integer(4) REVISION_STATEPOINT** + + Revision of the binary state point file. Any time a change is made in the + format of the state-point file, this integer is incremented. + +**integer(4) VERSION_MAJOR** + + Major version number for OpenMC + +**integer(4) VERSION_MINOR** + + Minor version number for OpenMC + +**integer(4) VERSION_RELEASE** + + Release version number for OpenMC + +**character(19) time_stamp** + + Date and time the state point was written. + +**character(255) path** + + Absolute path to directory containing input files. + +**integer(8) seed** + + Pseudo-random number generator seed. + +**integer(4) run_mode** + + run mode used. The modes are described in constants.F90. + +**integer(8) n_particles** + + Number of particles used per generation. + +**integer(4) n_batches** + + Total number of batches (active + inactive). + +**integer(4) current_batch** + + The number of batches already simulated. + +if (run_mode == MODE_EIGENVALUE) + + **integer(4) n_inactive** + + Number of inactive batches + + **integer(4) gen_per_batch** + + Number of generations per batch for criticality calculations + + *do i = 1, current_batch* + + **real(8) k_batch(i)** + + k-effective for the i-th batch + + *do i = 1, current_batch* + + **real(8) entropy(i)** + + Shannon entropy for the i-th batch + + **real(8) k_col_abs** + + Sum of product of collision/absorption estimates of k-effective + + **real(8) k_col_tra** + + Sum of product of collision/track-length estimates of k-effective + + **real(8) k_abs_tra** + + Sum of product of absorption/track-length estimates of k-effective + + **real(8) k_combined(2)** + + Mean and standard deviation of a combined estimate of k-effective + +**integer(4) n_meshes** + + Number of meshes in tallies.xml file + +*do i = 1, n_meshes* + + **integer(4) meshes(i) % id** + + Unique ID of mesh. + + **integer(4) meshes(i) % type** + + Type of mesh. + + **integer(4) meshes(i) % n_dimension** + + Number of dimensions for mesh (2 or 3). + + **integer(4) meshes(i) % dimension(:)** + + Number of mesh cells in each dimension. + + **real(8) meshes(i) % lower_left(:)** + + Coordinates of lower-left corner of mesh. + + **real(8) meshes(i) % upper_right(:)** + + Coordinates of upper-right corner of mesh. + + **real(8) meshes(i) % width(:)** + + Width of each mesh cell in each dimension. + +**integer(4) n_tallies** + +*do i = 1, n_tallies* + + **integer(4) tallies(i) % id** + + Unique ID of tally. + + **integer(4) tallies(i) % n_realizations** + + Number of realizations for the i-th tally. + + **integer(4) size(tallies(i) % scores, 1)** + + Total number of score bins for the i-th tally + + **integer(4) size(tallies(i) % scores, 2)** + + Total number of filter bins for the i-th tally + + **integer(4) tallies(i) % n_filters** + + *do j = 1, tallies(i) % n_filters* + + **integer(4) tallies(i) % filter(j) % type** + + Type of tally filter. + + **integer(4) tallies(i) % filter(j) % n_bins** + + Number of bins for filter. + + **integer(4)/real(8) tallies(i) % filter(j) % bins(:)** + + Value for each filter bin of this type. + + **integer(4) tallies(i) % n_nuclide_bins** + + Number of nuclide bins. If none are specified, this is just one. + + *do j = 1, tallies(i) % n_nuclide_bins* + + **integer(4) tallies(i) % nuclide_bins(j)** + + Values of specified nuclide bins + + **integer(4) tallies(i) % n_score_bins** + + Number of scoring bins. + + *do j = 1, tallies(i) % n_score_bins* + + **integer(4) tallies(i) % score_bins(j)** + + Values of specified scoring bins (e.g. SCORE_FLUX). + + *do j = 1, tallies(i) % n_score_bins* + + **integer(4) tallies(i) % scatt_order(j)** + + Scattering Order specified scoring bins. + + **integer(4) tallies(i) % n_score_bins** + + Number of scoring bins without accounting for those added by + the scatter-pn command. + +**integer(4) n_realizations** + + Number of realizations for global tallies. + +**integer(4) N_GLOBAL_TALLIES** + + Number of global tally scores + +*do i = 1, N_GLOBAL_TALLIES* + + **real(8) global_tallies(i) % sum** + + Accumulated sum for the i-th global tally + + **real(8) global_tallies(i) % sum_sq** + + Accumulated sum of squares for the i-th global tally + +**integer(4) tallies_on** + + Flag indicated if tallies are present in the file. + +if (tallies_on > 0) + + *do i = 1, n_tallies* + + *do k = 1, size(tallies(i) % scores, 2)* + + *do j = 1, size(tallies(i) % scores, 1)* + + **real(8) tallies(i) % scores(j,k) % sum** + + Accumulated sum for the j-th score and k-th filter of the + i-th tally + + **real(8) tallies(i) % scores(j,k) % sum_sq** + + Accumulated sum of squares for the j-th score and k-th + filter of the i-th tally + +if (run_mode == MODE_EIGENVALUE) + + *do i = 1, n_particles* + + **real(8) source_bank(i) % wgt** + + Weight of the i-th source particle + + **real(8) source_bank(i) % xyz(1:3)** + + Coordinates of the i-th source particle. + + **real(8) source_bank(i) % uvw(1:3)** + + Direction of the i-th source particle + + **real(8) source_bank(i) % E** + + Energy of the i-th source particle. + ---------- Revision 7 ---------- @@ -53,7 +301,7 @@ Revision 7 The number of batches already simulated. -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) **integer(4) n_inactive** @@ -216,7 +464,7 @@ if (tallies_on > 0) Accumulated sum of squares for the j-th score and k-th filter of the i-th tally -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) *do i = 1, n_particles* @@ -285,7 +533,7 @@ Revision 6 The number of batches already simulated. -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) **integer(4) n_inactive** @@ -437,7 +685,7 @@ if (tallies_on > 0) Accumulated sum of squares for the j-th score and k-th filter of the i-th tally -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) *do i = 1, n_particles* @@ -502,7 +750,7 @@ Revision 5 The number of batches already simulated. -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) **integer(4) n_inactive** @@ -646,7 +894,7 @@ if (tallies_on > 0) Accumulated sum of squares for the j-th score and k-th filter of the i-th tally -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) *do i = 1, n_particles* @@ -711,7 +959,7 @@ Revision 4 The number of batches already simulated. -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) **integer(4) n_inactive** @@ -851,7 +1099,7 @@ if (tallies_on > 0) Accumulated sum of squares for the j-th score and k-th filter of the i-th tally -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) *do i = 1, n_particles* @@ -916,7 +1164,7 @@ Revision 3 The number of batches already simulated. -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) **integer(4) n_inactive** @@ -1052,7 +1300,7 @@ if (tallies_on > 0) Accumulated sum of squares for the j-th score and k-th filter of the i-th tally -if (run_mode == MODE_CRITICALITY) +if (run_mode == MODE_EIGENVALUE) *do i = 1, n_particles* diff --git a/src/constants.F90 b/src/constants.F90 index 373a1f9c3d..95c10f5281 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -12,7 +12,7 @@ module constants ! Revision numbers for binary files integer, parameter :: REVISION_SOURCE = 1 - integer, parameter :: REVISION_STATEPOINT = 7 + integer, parameter :: REVISION_STATEPOINT = 8 ! ============================================================================ ! ADJUSTABLE PARAMETERS diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index bd093434d8..5ca2b0c682 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -887,6 +887,12 @@ contains dims(1) = current_batch*gen_per_batch call h5ltmake_dataset_double_f(hdf5_state_point, "entropy", 1, & dims, entropy, hdf5_err) + call hdf5_write_double(hdf5_state_point, "k_col_abs", k_col_abs) + call hdf5_write_double(hdf5_state_point, "k_col_tra", k_col_tra) + call hdf5_write_double(hdf5_state_point, "k_abs_tra", k_abs_tra) + dims(1) = 2 + call h5ltmake_dataset_double_f(hdf5_state_point, "k_combined", 1, & + dims, k_combined, hdf5_err) end if ! Create group for tallies @@ -1189,6 +1195,9 @@ contains k_batch(1:restart_batch), dims, hdf5_err) call h5ltread_dataset_double_f(hdf5_state_point, "entropy", & entropy(1:restart_batch*gen_per_batch), dims, hdf5_err) + call hdf5_read_double(hdf5_state_point, "k_col_abs", k_col_abs) + call hdf5_read_double(hdf5_state_point, "k_col_tra", k_col_tra) + call hdf5_read_double(hdf5_state_point, "k_abs_tra", k_abs_tra) end if ! Read number of realizations for global tallies diff --git a/src/state_point.F90 b/src/state_point.F90 index 7b3e4a5a94..9a92e64f09 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -187,6 +187,10 @@ contains write(UNIT_STATE) n_inactive, gen_per_batch write(UNIT_STATE) k_batch(1:current_batch) write(UNIT_STATE) entropy(1:current_batch*gen_per_batch) + write(UNIT_STATE) k_col_abs + write(UNIT_STATE) k_col_tra + write(UNIT_STATE) k_abs_tra + write(UNIT_STATE) k_combined end if ! Write number of meshes @@ -374,6 +378,14 @@ contains MPI_STATUS_IGNORE, mpi_err) call MPI_FILE_WRITE(fh, entropy, current_batch*gen_per_batch, MPI_REAL8, & MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_WRITE(fh, k_col_abs, 1, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_WRITE(fh, k_col_tra, 1, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_WRITE(fh, k_abs_tra, 1, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_WRITE(fh, k_combined, 2, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) end if ! Write number of meshes @@ -685,6 +697,16 @@ contains MPI_STATUS_IGNORE, mpi_err) call MPI_FILE_READ_ALL(fh, entropy, restart_batch*gen_per_batch, & MPI_REAL8, MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_READ_ALL(fh, k_col_abs, 1, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_READ_ALL(fh, k_col_tra, 1, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) + call MPI_FILE_READ_ALL(fh, k_abs_tra, 1, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) + allocate(real_array(2)) + call MPI_FILE_READ_ALL(fh, real_array, 2, MPI_REAL8, & + MPI_STATUS_IGNORE, mpi_err) + deallocate(real_array) end if if (master) then @@ -892,6 +914,12 @@ contains read(UNIT_STATE) n_inactive, gen_per_batch read(UNIT_STATE) k_batch(1:restart_batch) read(UNIT_STATE) entropy(1:restart_batch*gen_per_batch) + read(UNIT_STATE) k_col_abs + read(UNIT_STATE) k_col_tra + read(UNIT_STATE) k_abs_tra + allocate(real_array(2)) + read(UNIT_STATE) real_array + deallocate(real_array) end if if (master) then diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index 7e6d11d30a..1fb814c5fc 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -195,6 +195,10 @@ class StatePoint(BinaryFile): self.n_inactive, self.gen_per_batch = self._get_int(2) self.k_batch = self._get_double(self.current_batch) self.entropy = self._get_double(self.current_batch) + self.k_col_abs = self._get_double()[0] + self.k_col_tra = self._get_double()[0] + self.k_abs_tra = self._get_double()[0] + self.k_combined = self._get_double(2) # Read number of meshes n_meshes = self._get_int()[0]