From f046829c1448e32a6c291bb2c7d9b8827c6e1b64 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 17 Feb 2016 09:36:23 -0600 Subject: [PATCH 1/4] Write summary.h5 by default --- src/global.F90 | 2 +- src/input_xml.F90 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/global.F90 b/src/global.F90 index 4c243ee41..7652d1580 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -390,7 +390,7 @@ module global type(SetInt) :: sourcepoint_batch ! Various output options - logical :: output_summary = .false. + logical :: output_summary = .true. logical :: output_xs = .false. logical :: output_tallies = .true. diff --git a/src/input_xml.F90 b/src/input_xml.F90 index df9d28e13..92840db5a 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -905,8 +905,8 @@ contains if (check_for_node(node_output, "summary")) then call get_node_value(node_output, "summary", temp_str) temp_str = to_lower(temp_str) - if (trim(temp_str) == 'true' .or. & - trim(temp_str) == '1') output_summary = .true. + if (trim(temp_str) == 'false' .or. & + trim(temp_str) == '0') output_summary = .false. end if ! Check for cross sections option From 8f3b6147742cc1779443d0f73682e35cb255a5e6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 17 Feb 2016 20:47:18 -0600 Subject: [PATCH 2/4] Update documentation/notebooks to reflect default writing of summary.h5 --- docs/source/pythonapi/examples/mgxs-part-i.ipynb | 2 +- docs/source/pythonapi/examples/mgxs-part-ii.ipynb | 2 +- docs/source/pythonapi/examples/mgxs-part-iii.ipynb | 2 +- docs/source/pythonapi/examples/pandas-dataframes.ipynb | 2 +- docs/source/pythonapi/examples/tally-arithmetic.ipynb | 2 +- docs/source/usersguide/input.rst | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/pythonapi/examples/mgxs-part-i.ipynb b/docs/source/pythonapi/examples/mgxs-part-i.ipynb index 104fbe759..6b78e9d53 100644 --- a/docs/source/pythonapi/examples/mgxs-part-i.ipynb +++ b/docs/source/pythonapi/examples/mgxs-part-i.ipynb @@ -341,7 +341,7 @@ "settings_file.batches = batches\n", "settings_file.inactive = inactive\n", "settings_file.particles = particles\n", - "settings_file.output = {'tallies': True, 'summary': True}\n", + "settings_file.output = {'tallies': True}\n", "bounds = [-0.63, -0.63, -0.63, 0.63, 0.63, 0.63]\n", "settings_file.source = Source(space=Box(\n", " bounds[:3], bounds[3:], only_fissionable=True))\n", diff --git a/docs/source/pythonapi/examples/mgxs-part-ii.ipynb b/docs/source/pythonapi/examples/mgxs-part-ii.ipynb index 593d53647..0a8d7230e 100644 --- a/docs/source/pythonapi/examples/mgxs-part-ii.ipynb +++ b/docs/source/pythonapi/examples/mgxs-part-ii.ipynb @@ -286,7 +286,7 @@ "settings_file.batches = batches\n", "settings_file.inactive = inactive\n", "settings_file.particles = particles\n", - "settings_file.output = {'tallies': True, 'summary': True}\n", + "settings_file.output = {'tallies': True}\n", "bounds = [-0.63, -0.63, -0.63, 0.63, 0.63, 0.63]\n", "settings_file.source = Source(space=Box(\n", " bounds[:3], bounds[3:], only_fissionable=True))\n", diff --git a/docs/source/pythonapi/examples/mgxs-part-iii.ipynb b/docs/source/pythonapi/examples/mgxs-part-iii.ipynb index a541efbf0..dcb496160 100644 --- a/docs/source/pythonapi/examples/mgxs-part-iii.ipynb +++ b/docs/source/pythonapi/examples/mgxs-part-iii.ipynb @@ -392,7 +392,7 @@ "settings_file.batches = batches\n", "settings_file.inactive = inactive\n", "settings_file.particles = particles\n", - "settings_file.output = {'tallies': False, 'summary': True}\n", + "settings_file.output = {'tallies': False}\n", "source_bounds = [-10.71, -10.71, -10, 10.71, 10.71, 10.]\n", "settings_file.source = Source(Box(\n", " source_bounds[:3], source_bounds[3:], only_fissionable=True))\n", diff --git a/docs/source/pythonapi/examples/pandas-dataframes.ipynb b/docs/source/pythonapi/examples/pandas-dataframes.ipynb index 9e08acccd..ac5d4e410 100644 --- a/docs/source/pythonapi/examples/pandas-dataframes.ipynb +++ b/docs/source/pythonapi/examples/pandas-dataframes.ipynb @@ -302,7 +302,7 @@ "settings_file.batches = min_batches\n", "settings_file.inactive = inactive\n", "settings_file.particles = particles\n", - "settings_file.output = {'tallies': False, 'summary': True}\n", + "settings_file.output = {'tallies': False}\n", "settings_file.trigger_active = True\n", "settings_file.trigger_max_batches = max_batches\n", "source_bounds = [-10.71, -10.71, -10, 10.71, 10.71, 10.]\n", diff --git a/docs/source/pythonapi/examples/tally-arithmetic.ipynb b/docs/source/pythonapi/examples/tally-arithmetic.ipynb index e357e73fc..3a61b0979 100644 --- a/docs/source/pythonapi/examples/tally-arithmetic.ipynb +++ b/docs/source/pythonapi/examples/tally-arithmetic.ipynb @@ -288,7 +288,7 @@ "settings_file.batches = batches\n", "settings_file.inactive = inactive\n", "settings_file.particles = particles\n", - "settings_file.output = {'tallies': True, 'summary': True}\n", + "settings_file.output = {'tallies': True}\n", "source_bounds = [-0.63, -0.63, -0.63, 0.63, 0.63, 0.63]\n", "settings_file.source = Source(space=Box(\n", " source_bounds[:3], source_bounds[3:]))\n", diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index a9dda8ff4..85736334a 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -312,10 +312,10 @@ out the file and "false" will not. *Default*: false :summary: - Writes out an ASCII summary file describing all of the user input files that + Writes out an HDF5 summary file describing all of the user input files that were read in. - *Default*: false + *Default*: true :tallies: Write out an ASCII file of tally results. From 3b719d7a469a13811c4d6430faffa66a870afea9 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Thu, 18 Feb 2016 11:49:03 -0500 Subject: [PATCH 3/4] Fix methods/geometry doc typo --- docs/source/methods/geometry.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/methods/geometry.rst b/docs/source/methods/geometry.rst index c1be68f72..f642cca10 100644 --- a/docs/source/methods/geometry.rst +++ b/docs/source/methods/geometry.rst @@ -84,10 +84,10 @@ to fully define the surface. | Plane perpendicular | x-plane | :math:`x - x_0 = 0` | :math:`x_0` | | to :math:`x`-axis | | | | +----------------------+------------+------------------------------+-------------------------+ - | Plane perpendicular | y-plane | :math:`x - x_0 = 0` | :math:`y_0` | + | Plane perpendicular | y-plane | :math:`y - y_0 = 0` | :math:`y_0` | | to :math:`y`-axis | | | | +----------------------+------------+------------------------------+-------------------------+ - | Plane perpendicular | z-plane | :math:`x - x_0 = 0` | :math:`z_0` | + | Plane perpendicular | z-plane | :math:`z - z_0 = 0` | :math:`z_0` | | to :math:`z`-axis | | | | +----------------------+------------+------------------------------+-------------------------+ | Arbitrary plane | plane | :math:`Ax + By + Cz = D` | :math:`A\;B\;C\;D` | From 0227f4823080a686e8130df065762d8d855d6f3d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 19 Feb 2016 07:07:46 -0600 Subject: [PATCH 4/4] Fix bug when sampling multiple energy distributions --- src/secondary_header.F90 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/secondary_header.F90 b/src/secondary_header.F90 index d85807412..7449a5793 100644 --- a/src/secondary_header.F90 +++ b/src/secondary_header.F90 @@ -1,5 +1,6 @@ module secondary_header + use constants, only: ZERO use endf_header, only: Tab1 use interpolation, only: interpolate_tab1 use random_lcg, only: prn @@ -54,16 +55,19 @@ contains real(8), intent(out) :: mu ! sampled scattering cosine integer :: n ! number of angle-energy distributions - real(8) :: p_valid ! probability that given distribution is valid + real(8) :: prob ! cumulative probability + real(8) :: c ! sampled cumulative probability n = size(this%applicability) if (n > 1) then + prob = ZERO + c = prn() do i = 1, n ! Determine probability that i-th energy distribution is sampled - p_valid = interpolate_tab1(this%applicability(i), E_in) + prob = prob + interpolate_tab1(this%applicability(i), E_in) ! If i-th distribution is sampled, sample energy from the distribution - if (prn() <= p_valid) then + if (c <= prob) then call this%distribution(i)%obj%sample(E_in, E_out, mu) exit end if