diff --git a/src/geometry.F90 b/src/geometry.F90 index 07ce177020..72e074d7e4 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -260,15 +260,15 @@ contains ! forward slightly so that if the mesh boundary is on the surface, it is ! still processed + if (associated(active_current_tallies)) then + ! TODO: Find a better solution to score surface currents than + ! physically moving the particle forward slightly + + p % coord0 % xyz = p % coord0 % xyz + TINY_BIT * p % coord0 % uvw + call score_surface_current() + end if + if (tallies_on) then - if (n_current_tallies > 0) then - ! TODO: Find a better solution to score surface currents than - ! physically moving the particle forward slightly - - p % coord0 % xyz = p % coord0 % xyz + TINY_BIT * p % coord0 % uvw - call score_surface_current() - end if - ! Score to global leakage tally call add_to_score(global_tallies(LEAKAGE), p % wgt) end if @@ -295,7 +295,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 .and. n_current_tallies > 0) then + if (associated(active_current_tallies)) then p % coord0 % xyz = p % coord0 % xyz - TINY_BIT * p % coord0 % uvw call score_surface_current() p % coord0 % xyz = p % coord0 % xyz + TINY_BIT * p % coord0 % uvw diff --git a/src/physics.F90 b/src/physics.F90 index 008263fe87..12dccef40d 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -99,11 +99,12 @@ contains coord => coord % next end do - if (tallies_on) then - ! Score track-length tallies - if (n_tracklength_tallies > 0) & - call score_tracklength_tally(distance) + ! Score track-length tallies + if (associated(active_tracklength_tallies)) & + call score_tracklength_tally(distance) + ! Score global tracklength tallies + if (tallies_on) then ! Score track-length estimate of k-eff call add_to_score(global_tallies(K_TRACKLENGTH), & p % wgt * distance * material_xs % nu_fission) @@ -195,7 +196,7 @@ 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 .and. n_current_tallies > 0) & + if (associated(active_current_tallies)) & call score_surface_current() ! Sample nuclide/reaction for the material the particle is in @@ -229,7 +230,7 @@ contains ! information on the outgoing energy for any tallies with an outgoing energy ! filter - if (tallies_on .and. n_analog_tallies > 0) & + if (associated(active_analog_tallies)) & call score_analog_tally() ! Reset banked weight during collision