From c532cc1189725e1aeb9067cb384880ca1a7f8698 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Fri, 20 Nov 2015 05:02:00 -0500 Subject: [PATCH] Fixed bug in mg tallying --- src/tally.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tally.F90 b/src/tally.F90 index 6b9ee4e277..96dc5b5837 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -2548,6 +2548,9 @@ contains else matching_bins(i) = p % last_g end if + ! Tallies are ordered in increasing groups, group indices + ! however are the opposite, so switch + matching_bins(i) = energy_groups - matching_bins(i) + 1 else ! make sure the correct energy is used if (t % estimator == ESTIMATOR_TRACKLENGTH) then @@ -2573,6 +2576,10 @@ contains if (t % energyout_matches_groups) then ! Since all groups are filters, the filter bin is the group matching_bins(i) = p % g + + ! Tallies are ordered in increasing groups, group indices + ! however are the opposite, so switch + matching_bins(i) = energy_groups - matching_bins(i) + 1 else ! determine outgoing energy bin n = t % filters(i) % n_bins