From cf8b24da5b2b952b788780d3fdec36f69bd56108 Mon Sep 17 00:00:00 2001 From: blakewalters Date: Wed, 17 Aug 2016 13:47:08 -0400 Subject: [PATCH] Fix #125: Sync DOSXYZnrc source 20 with IAEA phsp Monitor unit (MU) index from IAEA phase space sources was not read in by DOSXYZnrc. The issue was twofold: 1. For all iaea phase space sources, regardless of whether MU was stored or not: iaea_i_muidx, the index at which MU values are stored in a floating point array, was automatically reset to -99 (i.e., no MU values stored) due to erroneous invoking of the $INIT_PHSP_COUNTERS macro at the beginning of subroutine srcinit. 2. For iaea phase space sources storing one or more floating point values (e.g., ZLAST) but not MU: The DOSXYZnrc flag, i_mu_phsp, indicating MU is stored in this data, was erroneously set to 1. This resulted in DOSXYZnrc failing to set a value of MU for each incident particle, defaulting to a value of 0 instead. The erroneous setting of i_mu_phsp was due to a bug in the macro $IAEA_READ_PHSP_HEADER (in $HEN_HOUSE/utils/iaea_phsp_macros.mortran). --- HEN_HOUSE/user_codes/dosxyznrc/srcxyznrc.mortran | 2 -- HEN_HOUSE/utils/iaea_phsp_macros.mortran | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/HEN_HOUSE/user_codes/dosxyznrc/srcxyznrc.mortran b/HEN_HOUSE/user_codes/dosxyznrc/srcxyznrc.mortran index 402bf988d..24e335baf 100644 --- a/HEN_HOUSE/user_codes/dosxyznrc/srcxyznrc.mortran +++ b/HEN_HOUSE/user_codes/dosxyznrc/srcxyznrc.mortran @@ -2397,8 +2397,6 @@ $REAL weight, cosphi,sinphi; $INTEGER i; -$INIT_PHSP_COUNTERS; - OUTPUT61;(' '); "------------------------------------------------------------------------" diff --git a/HEN_HOUSE/utils/iaea_phsp_macros.mortran b/HEN_HOUSE/utils/iaea_phsp_macros.mortran index 957a22896..e94b78611 100644 --- a/HEN_HOUSE/utils/iaea_phsp_macros.mortran +++ b/HEN_HOUSE/utils/iaea_phsp_macros.mortran @@ -253,7 +253,7 @@ ELSE[ "we assume this is the first float after zlast, if zlast is scored," "and has generic user type = 0" iaea_i_muidx=MAX(1,iaea_i_zlast+1); -IF(iaea_n_extra_floats=0 | iaea_extra_float_types(iaea_i_muidx)~=0) [ +IF(iaea_i_muidx>iaea_n_extra_floats | iaea_extra_float_types(iaea_i_muidx)~=0) [ iaea_i_muidx=-99;"reset this to no scoring" {P8}=0; ]