From 39e272cd63b6c6785bb8c9e130f09186770830d4 Mon Sep 17 00:00:00 2001 From: walshjon Date: Tue, 9 Sep 2014 13:18:43 -0400 Subject: [PATCH] added some checks on resonance scattering energy bounds and in test problem python script --- src/input_xml.F90 | 14 +++++++++++++- .../test_resonance_scattering.py | 10 ++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 7132d18e65..9b8b1a3c11 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -840,12 +840,24 @@ contains call get_node_value(node_scatterer, "E_min", & nuclides_0K(i) % E_min) end if - + + ! check that E_min is non-negative + if (E_min < ZERO) then + message = "Lower resonance scattering energy bound is negative" + call fatal_error() + end if + if (check_for_node(node_scatterer, "E_max")) then call get_node_value(node_scatterer, "E_max", & nuclides_0K(i) % E_max) end if + ! check that E_max is not less than E_min + if (E_max < E_min) then + message = "Lower resonance scattering energy bound exceeds upper" + call fatal_error() + end if + nuclides_0K(i) % nuclide = trim(nuclides_0K(i) % nuclide) nuclides_0K(i) % scheme = trim(nuclides_0K(i) % scheme) call lower_case(nuclides_0K(i) % scheme) diff --git a/tests/test_resonance_scattering/test_resonance_scattering.py b/tests/test_resonance_scattering/test_resonance_scattering.py index bcc3f8a819..6fdbf87459 100644 --- a/tests/test_resonance_scattering/test_resonance_scattering.py +++ b/tests/test_resonance_scattering/test_resonance_scattering.py @@ -51,7 +51,9 @@ if __name__ == '__main__': raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests - test_run() - test_created_statepoint() - test_results() - teardown() + try: + test_run() + test_created_statepoint() + test_results() + finally: + teardown()