From 4edbee8f71b18ef25108a52f95199d07df644569 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 12 Oct 2011 21:59:39 -0400 Subject: [PATCH] Fixed bug in tallies that depend on post-collision parameters. --- src/mpi_routines.f90 | 1 + src/source.f90 | 1 + src/tally.f90 | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/mpi_routines.f90 b/src/mpi_routines.f90 index de7b51b7ff..d828e81cad 100644 --- a/src/mpi_routines.f90 +++ b/src/mpi_routines.f90 @@ -356,6 +356,7 @@ contains p % xyz_local = temp_bank(i) % xyz p % uvw = temp_bank(i) % uvw p % E = temp_bank(i) % E + p % last_E = p % E ! set defaults call initialize_particle(p) diff --git a/src/source.f90 b/src/source.f90 index 19daea98d1..e9141b66b6 100644 --- a/src/source.f90 +++ b/src/source.f90 @@ -89,6 +89,7 @@ contains ! set particle energy p % E = E + p % last_E = E end do end if end do diff --git a/src/tally.f90 b/src/tally.f90 index efcd8833a0..b3f027380f 100644 --- a/src/tally.f90 +++ b/src/tally.f90 @@ -217,6 +217,14 @@ contains end do + do i = 1, n_cells + do j = 1, size(tally_maps(T_CELL) % items(i) % elements) + print *, cells(i) % uid, & + tally_maps(T_CELL) % items(i) % elements(j) % index_tally, & + tally_maps(T_CELL) % items(i) % elements(j) % index_bin + end do + end do + end subroutine create_tally_map !=============================================================================== @@ -259,10 +267,10 @@ contains ! SCORE_TALLY contains the main logic for scoring user-specified tallies !=============================================================================== - subroutine score_tally(p, scatter) + subroutine score_tally(p, scattered) type(Particle), pointer :: p - logical, intent(in) :: scatter + logical, intent(in) :: scattered integer :: i integer :: j @@ -290,7 +298,7 @@ contains do i = 1, n_tallies t => tallies(i) - + ! ======================================================================= ! DETERMINE SCORING BIN COMBINATION @@ -395,7 +403,7 @@ contains ! If this tally has an outgoing energy filter, the only supported ! reaction is scattering. For all other reactions, about - if (.not. scatter) return + if (.not. scattered) cycle ! Make sure bin is scattering -- since scattering has already ! occured, we do not need to multiply by the scattering cross