From 9058b7b490524e0164fdad880fbc9938753006d9 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Mon, 9 Dec 2013 12:24:20 -0500 Subject: [PATCH 01/16] Fixed non-(current)standard usage of L(I) for Laws 4, 44, 61, 67. Error will be thrown. --- src/ace.F90 | 83 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 9 deletions(-) diff --git a/src/ace.F90 b/src/ace.F90 index d54aa83c28..4673898c0c 100644 --- a/src/ace.F90 +++ b/src/ace.F90 @@ -161,16 +161,16 @@ contains mat % i_sab_tables(m) = temp_table end do SORT_SAB end if - + ! Deallocate temporary arrays for names of nuclides and S(a,b) tables if (allocated(mat % names)) deallocate(mat % names) if (allocated(mat % sab_names)) deallocate(mat % sab_names) end do MATERIAL_LOOP2 - + ! Avoid some valgrind leak errors call already_read % clear() - + end subroutine read_xs !=============================================================================== @@ -253,7 +253,7 @@ contains end if ! Read more header and NXS and JXS - read(UNIT=in, FMT=100) comment, mat, & + read(UNIT=in, FMT=100) comment, mat, & (zaids(i), awrs(i), i=1,16), NXS, JXS 100 format(A70,A10/4(I7,F11.0)/4(I7,F11.0)/4(I7,F11.0)/4(I7,F11.0)/& ,8I9/8I9/8I9/8I9/8I9/8I9) @@ -277,7 +277,7 @@ contains ACCESS='direct', RECL=record_length) ! Read all header information - read(UNIT=in, REC=location) name, awr, kT, date_, & + read(UNIT=in, REC=location) name, awr, kT, date_, & comment, mat, (zaids(i), awrs(i), i=1,16), NXS, JXS ! determine table length @@ -406,7 +406,7 @@ contains integer :: LNU ! type of nu data (polynomial or tabular) integer :: NC ! number of polynomial coefficients integer :: NR ! number of interpolation regions - integer :: NE ! number of energies + integer :: NE ! number of energies integer :: NPCR ! number of delayed neutron precursor groups integer :: LED ! location of energy distribution locators integer :: LDIS ! location of all energy distributions @@ -809,7 +809,7 @@ contains LED = JXS(10) - ! Loop over all reactions + ! Loop over all reactions do i = 1, NXS(5) rxn => nuc % reactions(i+1) ! skip over elastic scattering rxn % has_energy_dist = .true. @@ -840,7 +840,7 @@ contains integer :: LDIS ! location of all energy distributions integer :: LNW ! location of next energy distribution if multiple - integer :: LAW ! secondary energy distribution law + integer :: LAW ! secondary energy distribution law integer :: NR ! number of interpolation regions integer :: NE ! number of incoming energies integer :: IDAT ! location of first energy distribution for given MT @@ -934,6 +934,7 @@ contains integer :: NEa ! number of energies for Watt 'a' integer :: NRb ! number of interpolation regions for Watt 'b' integer :: NEb ! number of energies for Watt 'b' + real(8), allocatable :: L(:) ! locations of distributions for each Ein ! initialize length length = 0 @@ -958,6 +959,22 @@ contains ! Continuous tabular distribution NR = int(XSS(lc + 1)) NE = int(XSS(lc + 2 + 2*NR)) + ! Before progressing, check to see if data set uses L(I) values + ! in a way inconsistent with the current form of the ACE Format Guide + ! (MCNP5 Manual, Vol 3) + allocate(L(NE)) + L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) + do i = 1,NE + ! Now check to see if L(i) is equal to any other entries + ! If so, then we must exit + if (count(L == L(i)) > 1) then + message = "Invalid usage of L(I) in ACE data; & + &Consider using more recent data set." + call fatal_error() + end if + end do + deallocate(L) + ! Continue with finding data length length = length + 2 + 2*NR + 2*NE do i = 1,NE ! determine length @@ -1000,6 +1017,22 @@ contains ! Kalbach-Mann correlated scattering NR = int(XSS(lc + 1)) NE = int(XSS(lc + 2 + 2*NR)) + ! Before progressing, check to see if data set uses L(I) values + ! in a way inconsistent with the current form of the ACE Format Guide + ! (MCNP5 Manual, Vol 3) + allocate(L(NE)) + L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) + do i = 1,NE + ! Now check to see if L(i) is equal to any other entries + ! If so, then we must exit + if (count(L == L(i)) > 1) then + message = "Invalid usage of L(I) in ACE data; & + &Consider using more recent data set." + call fatal_error() + end if + end do + deallocate(L) + ! Continue with finding data length length = length + 2 + 2*NR + 2*NE do i = 1,NE NP = int(XSS(lc + length + 2)) @@ -1014,6 +1047,22 @@ contains ! Correlated energy and angle distribution NR = int(XSS(lc + 1)) NE = int(XSS(lc + 2 + 2*NR)) + ! Before progressing, check to see if data set uses L(I) values + ! in a way inconsistent with the current form of the ACE Format Guide + ! (MCNP5 Manual, Vol 3) + allocate(L(NE)) + L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) + do i = 1,NE + ! Now check to see if L(i) is equal to any other entries + ! If so, then we must exit + if (count(L == L(i)) > 1) then + message = "Invalid usage of L(I) in ACE data; & + &Consider using more recent data set." + call fatal_error() + end if + end do + deallocate(L) + ! Continue with finding data length length = length + 2 + 2*NR + 2*NE do i = 1,NE ! outgoing energy distribution @@ -1046,6 +1095,22 @@ contains ! Laboratory energy-angle law NR = int(XSS(lc + 1)) NE = int(XSS(lc + 2 + 2*NR)) + ! Before progressing, check to see if data set uses L(I) values + ! in a way inconsistent with the current form of the ACE Format Guide + ! (MCNP5 Manual, Vol 3) + allocate(L(NE)) + L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) + do i = 1,NE + ! Now check to see if L(i) is equal to any other entries + ! If so, then we must exit + if (count(L == L(i)) > 1) then + message = "Invalid usage of L(I) in ACE data; & + &Consider using more recent data set." + call fatal_error() + end if + end do + deallocate(L) + ! Continue with finding data length NMU = int(XSS(lc + 4 + 2*NR + 2*NE)) length = 4 + 2*(NR + NE + NMU) @@ -1188,7 +1253,7 @@ contains integer :: NMU ! number of outgoing angles integer :: JXS4 ! location of elastic energy table - ! read secondary energy mode for inelastic scattering and check + ! read secondary energy mode for inelastic scattering table % secondary_mode = NXS(7) if (table % secondary_mode /= SAB_SECONDARY_EQUAL .and. & table % secondary_mode /= SAB_SECONDARY_SKEWED) then From 8fe5014b6d5f16fe3498d4e8e172431e00e9c055 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Mon, 9 Dec 2013 12:31:27 -0500 Subject: [PATCH 02/16] Updated troubleshooting documentation to reflect the new error message for the invalid L(I) usage. --- docs/source/usersguide/troubleshoot.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/source/usersguide/troubleshoot.rst b/docs/source/usersguide/troubleshoot.rst index a13272aa65..ba7e4405cc 100644 --- a/docs/source/usersguide/troubleshoot.rst +++ b/docs/source/usersguide/troubleshoot.rst @@ -79,6 +79,14 @@ with the :envvar:`CROSS_SECTIONS` environment variable. It is recommended to add a line in your ``.profile`` or ``.bash_profile`` setting the :envvar:`CROSS_SECTIONS` environment variable. +ERROR: Invalid usage of L(I) in ACE data; Consider using more recent data set. +****************************************************************************** + +The cross-sections requested in ``materials.xml`` do not conform to the current +standard format. This typically happens with fissionable nuclides in a ``.6*c`` +library as distributed with MCNP. Please try a newer library such as any from +the ``.7*c`` set. + Geometry Debugging ****************** @@ -107,8 +115,8 @@ have many particles travelling through them there will not be many locations where overlaps are checked for in that region. The user should refer to the output after a geometry debug run to see how many checks were performed in each cell, and then adjust the number of starting particles or starting source -distributions accordingly to achieve good coverage. - +distributions accordingly to achieve good coverage. + ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 4cc8369dce9ff44d3007ef747979ca021cf0463d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Mar 2014 17:53:25 -0500 Subject: [PATCH 03/16] Started release notes for 0.5.4. --- docs/source/releasenotes/index.rst | 1 + docs/source/releasenotes/notes_0.5.4.rst | 61 ++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 docs/source/releasenotes/notes_0.5.4.rst diff --git a/docs/source/releasenotes/index.rst b/docs/source/releasenotes/index.rst index 9164fa5943..d649b1403a 100644 --- a/docs/source/releasenotes/index.rst +++ b/docs/source/releasenotes/index.rst @@ -10,6 +10,7 @@ bugs fixed, and known issues for each successive release. .. toctree:: :maxdepth: 1 + notes_0.5.4 notes_0.5.3 notes_0.5.2 notes_0.5.1 diff --git a/docs/source/releasenotes/notes_0.5.4.rst b/docs/source/releasenotes/notes_0.5.4.rst new file mode 100644 index 0000000000..1471e1c8e4 --- /dev/null +++ b/docs/source/releasenotes/notes_0.5.4.rst @@ -0,0 +1,61 @@ +.. _notes_0.5.4: + +============================== +Release Notes for OpenMC 0.5.4 +============================== + +.. note:: + These release notes are for an upcoming release of OpenMC and are still + subject to change. + +------------------- +System Requirements +------------------- + +There are no special requirements for running the OpenMC code. As of this +release, OpenMC has been tested on a variety of Linux distributions, Mac OS X, +and Microsoft Windows 7. Memory requirements will vary depending on the size of +the problem at hand (mostly on the number of nuclides in the problem). + +------------ +New Features +------------ + +- New XML parsing backend (FoX) +- Ability to write particle track files +- Handle lost particles more gracefully (via particle track files) +- Source sites outside geometry are resampled +- Multiple random number generator streams +- plot_mesh_tally.py utility converted to use Tkinter rather than PyQt +- Script added to download ACE data from NNDC +- Mixed ASCII/binary cross_sections.xml now allowed + +--------- +Bug Fixes +--------- + +- 32c03c_: Check for valid data in cross_sections.xml +- c71ef5_: Fix bug in statepoint.py +- 8884fb_: Check for all ZAIDs for S(a,b) tables +- b38af0_: Fix XML reading on multiple levels of input +- d28750_: Fix bug in convert_xsdir.py + +.. _32c03c: https://github.com/mit-crpg/openmc/commit/32c03c +.. _c71ef5: https://github.com/mit-crpg/openmc/commit/c71ef5 +.. _8884fb: https://github.com/mit-crpg/openmc/commit/8884fb +.. _b38af0: https://github.com/mit-crpg/openmc/commit/b38af0 +.. _d28750: https://github.com/mit-crpg/openmc/commit/d28750 + +------------ +Contributors +------------ + +This release contains new contributions from the following people: + +- `Sterling Harper `_ +- `Bryan Herman `_ +- `Nick Horelik `_ +- `Adam Nelson `_ +- `Paul Romano `_ +- `Tuomas Viitanen `_ +- `Jon Walsh `_ From 571ba896c90ff2d71de14e74c53e18c5850af283 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 4 Mar 2014 18:59:06 -0500 Subject: [PATCH 04/16] fixed mistake --- docs/source/usersguide/input.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 362197439d..106f7ae92a 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -1087,7 +1087,7 @@ sub-elements: the PNG format can often times reduce the file size by orders of magnitude without any loss of image quality. Likewise, high-resolution voxel files produced by OpenMC can be quite large, - but the equivalent SILO files will by significantly smaller. + but the equivalent SILO files will be significantly smaller. *Default*: "slice" From 3f218c431b5cd8e80bc44452b3262d324e9ac404 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Mar 2014 19:28:46 -0500 Subject: [PATCH 05/16] Mention how to local install in documentation. Closes #247. --- docs/source/quickinstall.rst | 7 ++++++- docs/source/usersguide/install.rst | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/source/quickinstall.rst b/docs/source/quickinstall.rst index 2cee56987a..ccbfabebe7 100644 --- a/docs/source/quickinstall.rst +++ b/docs/source/quickinstall.rst @@ -48,7 +48,12 @@ following commands in a terminal: sudo make install This will build an executable named ``openmc`` and install it (by default in -/usr/local/bin). +/usr/local/bin). If you do not have administrator privileges, the last command +can be replaced with a local install, e.g. + +.. code-block:: sh + + make install -e prefix=$HOME/.local .. _GitHub: https://github.com/mit-crpg/openmc .. _git: http://git-scm.com diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index ff33d9a6c6..2084878b73 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -189,7 +189,15 @@ the root directory of the source code: sudo make install This will build an executable named ``openmc`` and install it (by default in -/usr/local/bin). +/usr/local/bin). If you do not have administrative privileges, you can install +OpenMC locally by replacing the last command with: + +.. code-block:: sh + + make install -e prefix=$HOME/.local + +The ``prefix`` variable can be changed to any path for which you have +write-access. Compiling on Windows -------------------- From 4835a4f632f9a379ef40cfb96bc2beaeffb06f6e Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 4 Mar 2014 21:10:42 -0500 Subject: [PATCH 06/16] check for present source bank before running calculation --- src/initialize.F90 | 8 +++++++- src/state_point.F90 | 35 ++++++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/initialize.F90 b/src/initialize.F90 index 8a4b22e90f..52869a281e 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -390,7 +390,7 @@ contains ! It is a source file path_source_point = argv(i) - else + else ! Different option is specified not a source file ! Source is in statepoint file path_source_point = path_state_point @@ -399,6 +399,12 @@ contains i = i - 1 end if + + else ! No command line arg after statepoint + + ! Source is assumed to be in statepoint file + path_source_point = path_state_point + end if case ('-g', '-geometry-debug', '--geometry-debug') diff --git a/src/state_point.F90 b/src/state_point.F90 index 046d748be5..e31e7dea91 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -275,6 +275,13 @@ contains end if + ! Indicate where source bank is stored in statepoint + if (source_separate) then + call sp % write_data(0, "source_present") + else + call sp % write_data(1, "source_present") + end if + ! Close the file for serial writing call sp % file_close() @@ -518,6 +525,7 @@ contains integer :: length(4) integer :: int_array(3) integer, allocatable :: temp_array(:) + logical :: source_present real(8) :: real_array(3) type(TallyObject), pointer :: t => null() @@ -758,30 +766,35 @@ contains end if end if + ! Check for source in statepoint if needed + call sp % read_data(int_array(1), "source_present") + if (int_array(1) == 1) then + source_present = .true. + else + source_present = .false. + end if + + ! Check to make sure source bank is present + if (path_source_point == path_state_point .and. .not. source_present) then + message = "Source bank must be contained in statepoint restart file" + call fatal_error() + end if + ! Read source if in eigenvalue mode if (run_mode == MODE_EIGENVALUE) then ! Check if source was written out separately - if (source_separate) then + if (.not. source_present) then ! Close statepoint file call sp % file_close() - ! Set filename for source - filename = trim(path_output) // 'source.' // & - trim(to_str(restart_batch)) -#ifdef HDF5 - filename = trim(filename) // '.h5' -#else - filename = trim(filename) // '.binary' -#endif - ! Write message message = "Loading source file " // trim(filename) // "..." call write_message(1) ! Open source file - call sp % file_open(filename, 'r', serial = .false.) + call sp % file_open(path_source_point, 'r', serial = .false.) ! Read file type call sp % read_data(int_array(1), "filetype") From 6962b32de9164f615f58952e631afae52ca0af44 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 4 Mar 2014 21:50:06 -0500 Subject: [PATCH 07/16] simplified cleanup script --- tests/cleanup.bash | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/cleanup.bash b/tests/cleanup.bash index d23b166a26..0b792f9c77 100755 --- a/tests/cleanup.bash +++ b/tests/cleanup.bash @@ -5,10 +5,4 @@ # deleting left over binary files. This will # cause an assertion error in some of the # tests. -for i in ./*; do - if [ -d "$i" ]; then - cd $i - rm -f *.binary *.h5 - cd .. - fi -done +find . \( -name "*.binary" -o -name "*.h5" \) -exec rm -f {} \; From fb5ede7d9330e5e3f34614bb00fe795e02c3d34f Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 4 Mar 2014 21:50:50 -0500 Subject: [PATCH 08/16] remove compile from all-tests option --- tests/run_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/run_tests.py b/tests/run_tests.py index 49975c218a..0669a99d00 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -117,6 +117,8 @@ if len(sys.argv) > 1: if j.rfind(suffix) != -1: if suffix == 'omp' and j == 'compile': continue + if j == 'compile': + continue tests__.append(j) else: tests__.append(i) # append specific test (e.g., mpi-debug) From b1c288012b438abd0cda44dd9daaca52be34fba4 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 4 Mar 2014 21:54:50 -0500 Subject: [PATCH 09/16] removed source from separate and write tags --- src/input_xml.F90 | 8 ++++---- tests/test_sourcepoint_latest/settings.xml | 2 +- tests/test_sourcepoint_restart/settings.xml | 2 +- tests/test_statepoint_sourcesep/settings.xml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 9fffea5d31..03ad982cbc 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -670,14 +670,14 @@ contains end if ! Check if the user has specified to write binary source file - if (check_for_node(node_sp, "source_separate")) then - call get_node_value(node_sp, "source_separate", temp_str) + if (check_for_node(node_sp, "separate")) then + call get_node_value(node_sp, "separate", temp_str) call lower_case(temp_str) if (trim(temp_str) == 'true' .or. & trim(temp_str) == '1') source_separate = .true. end if - if (check_for_node(node_sp, "source_write")) then - call get_node_value(node_sp, "source_write", temp_str) + if (check_for_node(node_sp, "write")) then + call get_node_value(node_sp, "write", temp_str) call lower_case(temp_str) if (trim(temp_str) == 'false' .or. & trim(temp_str) == '0') source_write = .false. diff --git a/tests/test_sourcepoint_latest/settings.xml b/tests/test_sourcepoint_latest/settings.xml index 36c5c7a0d7..5056db4724 100644 --- a/tests/test_sourcepoint_latest/settings.xml +++ b/tests/test_sourcepoint_latest/settings.xml @@ -1,7 +1,7 @@ - + 10 diff --git a/tests/test_sourcepoint_restart/settings.xml b/tests/test_sourcepoint_restart/settings.xml index c405186fb7..4e9b12d246 100644 --- a/tests/test_sourcepoint_restart/settings.xml +++ b/tests/test_sourcepoint_restart/settings.xml @@ -2,7 +2,7 @@ - + 10 diff --git a/tests/test_statepoint_sourcesep/settings.xml b/tests/test_statepoint_sourcesep/settings.xml index 98abc5acfe..17d4ee2e2e 100644 --- a/tests/test_statepoint_sourcesep/settings.xml +++ b/tests/test_statepoint_sourcesep/settings.xml @@ -2,7 +2,7 @@ - + 10 From 4ca97dde96d71fc27168628b7c80790be96e1950 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 4 Mar 2014 23:32:41 -0500 Subject: [PATCH 10/16] added source present to statepoint.py and incremented version --- src/constants.F90 | 2 +- src/utils/statepoint.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/constants.F90 b/src/constants.F90 index 05327153d0..9091460148 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -11,7 +11,7 @@ module constants integer, parameter :: VERSION_RELEASE = 3 ! Revision numbers for binary files - integer, parameter :: REVISION_STATEPOINT = 10 + integer, parameter :: REVISION_STATEPOINT = 11 integer, parameter :: REVISION_PARTICLE_RESTART = 1 ! Binary file types diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index 430abee8b8..0bfb66716b 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -151,7 +151,7 @@ class StatePoint(object): # Read statepoint revision self.revision = self._get_int(path='revision')[0] - if self.revision != 10: + if self.revision != 11: raise Exception('Statepoint Revision is not consistent.') # Read OpenMC version @@ -342,6 +342,12 @@ class StatePoint(object): if not self._results: self.read_results() + # Source bank present + source_present = self._get_int(path='source_present')[0] + if source_present != 1: + print('Source bank not present.') + return + # For HDF5 state points, copy entire bank if self._hdf5: source_sites = self._f['source_bank'].value From 76cbf0ffaaf0d26db89b89befaba1460f94c7120 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 5 Mar 2014 13:34:59 -0500 Subject: [PATCH 11/16] moved source_present data to the end of meta data section of statepoint writing --- src/state_point.F90 | 42 ++++++++++++++++++++--------------------- src/utils/statepoint.py | 14 ++++++++++---- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/state_point.F90 b/src/state_point.F90 index e31e7dea91..4cf62c7c10 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -232,6 +232,13 @@ contains end if + ! Indicate where source bank is stored in statepoint + if (source_separate) then + call sp % write_data(0, "source_present") + else + call sp % write_data(1, "source_present") + end if + ! Check for the no-tally-reduction method if (.not. reduce_tallies) then ! If using the no-tally-reduction method, we need to collect tally @@ -275,13 +282,6 @@ contains end if - ! Indicate where source bank is stored in statepoint - if (source_separate) then - call sp % write_data(0, "source_present") - else - call sp % write_data(1, "source_present") - end if - ! Close the file for serial writing call sp % file_close() @@ -730,6 +730,20 @@ contains end do TALLY_METADATA + ! Check for source in statepoint if needed + call sp % read_data(int_array(1), "source_present") + if (int_array(1) == 1) then + source_present = .true. + else + source_present = .false. + end if + + ! Check to make sure source bank is present + if (path_source_point == path_state_point .and. .not. source_present) then + message = "Source bank must be contained in statepoint restart file" + call fatal_error() + end if + ! Read tallies to master if (master) then @@ -766,20 +780,6 @@ contains end if end if - ! Check for source in statepoint if needed - call sp % read_data(int_array(1), "source_present") - if (int_array(1) == 1) then - source_present = .true. - else - source_present = .false. - end if - - ! Check to make sure source bank is present - if (path_source_point == path_state_point .and. .not. source_present) then - message = "Source bank must be contained in statepoint restart file" - call fatal_error() - end if - ! Read source if in eigenvalue mode if (run_mode == MODE_EIGENVALUE) then diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index 0bfb66716b..d64ad09663 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -298,6 +298,13 @@ class StatePoint(object): f.stride = stride stride *= f.length + # Source bank present + source_present = self._get_int(path='source_present')[0] + if source_present == 1: + self.source_present = True + else: + self.source_present = False + # Set flag indicating metadata has already been read self._metadata = True @@ -342,10 +349,9 @@ class StatePoint(object): if not self._results: self.read_results() - # Source bank present - source_present = self._get_int(path='source_present')[0] - if source_present != 1: - print('Source bank not present.') + # Check if source bank is in statepoint + if not self.source_present: + print('Source not in statepoint file.') return # For HDF5 state points, copy entire bank From 23bd929683c66ae4abd4379f66f6606391c2cbfd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 5 Mar 2014 16:55:40 -0500 Subject: [PATCH 12/16] Update settings.xml RELAX NG schema. --- src/relaxng/settings.rnc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/relaxng/settings.rnc b/src/relaxng/settings.rnc index 0e4942e357..fb6a8b1537 100644 --- a/src/relaxng/settings.rnc +++ b/src/relaxng/settings.rnc @@ -102,10 +102,10 @@ element settings { (element interval { xsd:positiveInteger } | attribute interval { xsd:positiveInteger }) ) & - (element source_separate { xsd:boolean } | - attribute source_separate { xsd:boolean })? & - (element source_write { xsd:boolean } | - attribute source_write { xsd:boolean })? & + (element separate { xsd:boolean } | + attribute separate { xsd:boolean })? & + (element write { xsd:boolean } | + attribute write { xsd:boolean })? & (element overwrite_latest { xsd:boolean} | attribute overwrite_latest {xsd:boolean})? }? & From 1abdcff45880c28d58f5d3882f680dede4c46aa4 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 5 Mar 2014 17:11:52 -0500 Subject: [PATCH 13/16] Make batches/interval sub-attribute optional in settings.rnc. --- src/relaxng/settings.rnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/relaxng/settings.rnc b/src/relaxng/settings.rnc index fb6a8b1537..58699a2a26 100644 --- a/src/relaxng/settings.rnc +++ b/src/relaxng/settings.rnc @@ -101,7 +101,7 @@ element settings { attribute batches { list { xsd:positiveInteger+ } }) | (element interval { xsd:positiveInteger } | attribute interval { xsd:positiveInteger }) - ) & + )? & (element separate { xsd:boolean } | attribute separate { xsd:boolean })? & (element write { xsd:boolean } | From 40fb29b819a13f23bcf5b958d79499a48d1a8cac Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 5 Mar 2014 17:21:22 -0500 Subject: [PATCH 14/16] removed check variable to address @paulromano comment --- src/input_xml.F90 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 03ad982cbc..fffd4a54e7 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -58,7 +58,6 @@ contains integer(8) :: temp_long integer :: n_tracks logical :: file_exists - logical :: check character(MAX_FILE_LEN) :: env_variable character(MAX_WORD_LEN) :: type character(MAX_LINE_LEN) :: filename @@ -702,10 +701,9 @@ contains ! make sure that the sourcepoint batch numbers are contained in the ! statepoint list if (.not. source_separate) then - check = .true. do i = 1, n_source_points - check = statepoint_batch % contains(sourcepoint_batch % get_item(i)) - if (.not. check) then + if (.not. statepoint_batch % contains(sourcepoint_batch % & + get_item(i))) then message = 'Sourcepoint batches are not a subset& & of statepoint batches.' call fatal_error() From b73dfd352e453586a53da69afbc35f9a8401e554 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 5 Mar 2014 17:22:20 -0500 Subject: [PATCH 15/16] formatted source_present lines as per PEP8 --- src/utils/statepoint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index d64ad09663..47809d4728 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -301,9 +301,9 @@ class StatePoint(object): # Source bank present source_present = self._get_int(path='source_present')[0] if source_present == 1: - self.source_present = True + self.source_present = True else: - self.source_present = False + self.source_present = False # Set flag indicating metadata has already been read self._metadata = True From fbb692f351393998febb0c5452977ca8e75f9c9e Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 5 Mar 2014 17:28:52 -0500 Subject: [PATCH 16/16] removed extension from cleanup --- tests/{cleanup.bash => cleanup} | 2 ++ 1 file changed, 2 insertions(+) rename tests/{cleanup.bash => cleanup} (96%) diff --git a/tests/cleanup.bash b/tests/cleanup similarity index 96% rename from tests/cleanup.bash rename to tests/cleanup index 0b792f9c77..288c81025b 100755 --- a/tests/cleanup.bash +++ b/tests/cleanup @@ -1,3 +1,5 @@ +#!/bin/bash + # This simple script ensures that all binary # output files have been deleted in all the # folders. This can occur if a previous error