From 51a6461d69ece74f7d928206471f68b5c78c7d85 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 12 Feb 2012 21:03:07 -0500 Subject: [PATCH] Only call tally scoring routines when needed. --- src/geometry.F90 | 4 ++-- src/physics.F90 | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/geometry.F90 b/src/geometry.F90 index 79bc8d94e3..3e9dad4abf 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -266,7 +266,7 @@ contains ! forward slightly so that if the mesh boundary is on the surface, it is ! still processed - if (tallies_on) then + if (tallies_on .and. n_current_tallies > 0) then ! TODO: Find a better solution to score surface currents than ! physically moving the particle forward slightly @@ -296,7 +296,7 @@ contains ! particle to change -- artificially move the particle slightly back in ! case the surface crossing in coincident with a mesh boundary - if (tallies_on) then + if (tallies_on .and. n_current_tallies > 0) then p % coord0 % xyz = p % coord0 % xyz - TINY_BIT * p % coord0 % uvw call score_surface_current(p) p % coord0 % xyz = p % coord0 % xyz + TINY_BIT * p % coord0 % uvw diff --git a/src/physics.F90 b/src/physics.F90 index 644dc39d91..cce1abda14 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -96,7 +96,8 @@ contains end do ! Score track-length tallies - if (tallies_on) call score_tracklength_tally(p, distance) + if (tallies_on .and. n_tracklength_tallies > 0) & + call score_tracklength_tally(p, distance) if (d_collision > d_boundary) then last_cell = p % coord % cell @@ -166,7 +167,8 @@ contains ! since the direction of the particle will change and we need to use the ! pre-collision direction to figure out what mesh surfaces were crossed - if (tallies_on) call score_surface_current(p) + if (tallies_on .and. n_current_tallies > 0) & + call score_surface_current(p) ! Sample nuclide/reaction for the material the particle is in call sample_reaction(p) @@ -190,7 +192,8 @@ contains ! information on the outgoing energy for any tallies with an outgoing energy ! filter - if (tallies_on) call score_analog_tally(p) + if (tallies_on .and. n_analog_tallies > 0) & + call score_analog_tally(p) ! Reset number of particles banked during collision p % n_bank = 0