From bca4562d67867260db682ecacf52facf278d3fba Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Thu, 11 Sep 2014 21:52:29 -0400 Subject: [PATCH 1/4] Removed n_batches from statepoint --- docs/source/devguide/statepoint.rst | 286 ++++++++++++++++++++++++++++ src/constants.F90 | 2 +- src/state_point.F90 | 5 - src/utils/statepoint.py | 3 +- 4 files changed, 288 insertions(+), 8 deletions(-) diff --git a/docs/source/devguide/statepoint.rst b/docs/source/devguide/statepoint.rst index 5f05c92c8..fee3fab59 100644 --- a/docs/source/devguide/statepoint.rst +++ b/docs/source/devguide/statepoint.rst @@ -4,6 +4,292 @@ State Point Binary File Specifications ====================================== +----------- +Revision 13 +----------- + +**integer(4) FILETYPE_STATEPOINT** + + Flags whether this file is a statepoint file or a particle restart file. + +**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) 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 \* gen_per_batch* + + **real(8) k_generation(i)** + + k-effective for the i-th total generation + + *do i = 1, current_batch \* gen_per_batch* + + **real(8) entropy(i)** + + Shannon entropy for the i-th total generation + + **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) cmfd_on** + + Flag that cmfd is on + + if (cmfd_on) + + **integer(4) cmfd % indices** + + Indices for cmfd mesh (i,j,k,g) + + **real(8) cmfd % k_cmfd(1:current_batch)** + + CMFD eigenvalues + + **real(8) cmfd % src(1:G,1:I,1:J,1:K)** + + CMFD fission source + + **real(8) cmfd % entropy(1:current_batch)** + + CMFD estimate of Shannon entropy + + **real(8) cmfd % balance(1:current_batch)** + + RMS of the residual neutron balance equation on CMFD mesh + + **real(8) cmfd % dom(1:current_batch)** + + CMFD estimate of dominance ratio + + **real(8) cmfd % scr_cmp(1:current_batch)** + + RMS comparison of difference between OpenMC and CMFD fission source + +**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) source_present** + + Flag indicated if source bank is present in the file + +**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 and source_present) + + *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 11 ----------- diff --git a/src/constants.F90 b/src/constants.F90 index 7d0657b69..a890f261c 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -11,7 +11,7 @@ module constants integer, parameter :: VERSION_RELEASE = 0 ! Revision numbers for binary files - integer, parameter :: REVISION_STATEPOINT = 12 + integer, parameter :: REVISION_STATEPOINT = 13 integer, parameter :: REVISION_PARTICLE_RESTART = 1 ! Binary file types diff --git a/src/state_point.F90 b/src/state_point.F90 index 8aff2ec36..ca260a40e 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -84,7 +84,6 @@ contains ! Write run information call sp % write_data(run_mode, "run_mode") call sp % write_data(n_particles, "n_particles") - call sp % write_data(n_batches, "n_batches") ! Write out current batch number call sp % write_data(current_batch, "current_batch") @@ -572,10 +571,6 @@ contains ! Read and overwrite run information except number of batches call sp % read_data(run_mode, "run_mode") call sp % read_data(n_particles, "n_particles") - call sp % read_data(int_array(1), "n_batches") - - ! Take maximum of statepoint n_batches and input n_batches - n_batches = max(n_batches, int_array(1)) ! Read batch number to restart at call sp % read_data(restart_batch, "current_batch") diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index 5a9764d92..b51b69c3f 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -6,7 +6,7 @@ from collections import OrderedDict import numpy as np import scipy.stats -REVISION_STATEPOINT = 12 +REVISION_STATEPOINT = 13 filter_types = {1: 'universe', 2: 'material', 3: 'cell', 4: 'cellborn', 5: 'surface', 6: 'mesh', 7: 'energyin', 8: 'energyout'} @@ -182,7 +182,6 @@ class StatePoint(object): # Read run information self.run_mode = self._get_int(path='run_mode')[0] self.n_particles = self._get_long(path='n_particles')[0] - self.n_batches = self._get_int(path='n_batches')[0] # Read current batch self.current_batch = self._get_int(path='current_batch')[0] From ec0205694039940710a7e761641f1dab2810f0de Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Fri, 12 Sep 2014 18:46:21 -0400 Subject: [PATCH 2/4] Added error for restarts with small n_batches --- src/state_point.F90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/state_point.F90 b/src/state_point.F90 index ca260a40e..0e8d9e561 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -575,6 +575,12 @@ contains ! Read batch number to restart at call sp % read_data(restart_batch, "current_batch") + if (restart_batch > n_batches) then + message = 'The number batches specified in settings.xml is fewer than' //& + & ' the number of batches in the given statepoint file.' + call fatal_error() + end if + ! Read information specific to eigenvalue run if (run_mode == MODE_EIGENVALUE) then call sp % read_data(int_array(1), "n_inactive") From 906f8864afe0779969761523ec169d538e6c7b3c Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Fri, 24 Oct 2014 17:26:35 -0400 Subject: [PATCH 3/4] Add 'implicit none' to modules --- src/eigenvalue.F90 | 1 + src/endf.F90 | 2 ++ src/energy_grid.F90 | 2 ++ src/fixed_source.F90 | 2 ++ src/search.F90 | 2 ++ src/tracking.F90 | 2 ++ 6 files changed, 11 insertions(+) diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index c46f90ab1..58dd02841 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -23,6 +23,7 @@ module eigenvalue reset_result use tracking, only: transport + implicit none private public :: run_eigenvalue diff --git a/src/endf.F90 b/src/endf.F90 index 924e12557..fb85262b2 100644 --- a/src/endf.F90 +++ b/src/endf.F90 @@ -3,6 +3,8 @@ module endf use constants use string, only: to_str + implicit none + contains !=============================================================================== diff --git a/src/energy_grid.F90 b/src/energy_grid.F90 index a006959d9..4c4061a20 100644 --- a/src/energy_grid.F90 +++ b/src/energy_grid.F90 @@ -5,6 +5,8 @@ module energy_grid use list_header, only: ListReal use output, only: write_message + implicit none + contains !=============================================================================== diff --git a/src/fixed_source.F90 b/src/fixed_source.F90 index 3cbf8673a..4e7d9642f 100644 --- a/src/fixed_source.F90 +++ b/src/fixed_source.F90 @@ -11,6 +11,8 @@ module fixed_source use tally, only: synchronize_tallies, setup_active_usertallies use tracking, only: transport + implicit none + contains subroutine run_fixedsource() diff --git a/src/search.F90 b/src/search.F90 index c8fc71d36..8de05a955 100644 --- a/src/search.F90 +++ b/src/search.F90 @@ -3,6 +3,8 @@ module search use constants use error, only: fatal_error + implicit none + integer, parameter :: MAX_ITERATION = 64 interface binary_search diff --git a/src/tracking.F90 b/src/tracking.F90 index 9545d41ee..d108325fa 100644 --- a/src/tracking.F90 +++ b/src/tracking.F90 @@ -16,6 +16,8 @@ module tracking use track_output, only: initialize_particle_track, write_particle_track, & finalize_particle_track + implicit none + contains !=============================================================================== From 314c9c246d6db054e64a061c569e1007630c829e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 25 Oct 2014 10:53:32 -0400 Subject: [PATCH 4/4] Pass argument to fatal_error. --- src/state_point.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/state_point.F90 b/src/state_point.F90 index 495fd1138..b39bda74d 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -305,7 +305,7 @@ contains ! Set filename filename = trim(path_output) // 'source.' // & & zero_padded(current_batch, count_digits(n_batches)) - + #ifdef HDF5 filename = trim(filename) // '.h5' #else @@ -572,9 +572,8 @@ contains call sp % read_data(restart_batch, "current_batch") if (restart_batch > n_batches) then - message = 'The number batches specified in settings.xml is fewer than' //& - & ' the number of batches in the given statepoint file.' - call fatal_error() + call fatal_error("The number batches specified in settings.xml is fewer & + & than the number of batches in the given statepoint file.") end if ! Read information specific to eigenvalue run