diff --git a/src/geometry.f90 b/src/geometry.f90 index cf0ed8adb1..569755d2e1 100644 --- a/src/geometry.f90 +++ b/src/geometry.f90 @@ -248,11 +248,13 @@ contains ! forward slightly so that if the mesh boundary is on the surface, it is ! still processed - ! TODO: Find a better solution to score surface currents than physically - ! moving the particle forward slightly + if (tallies_on) 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(p) + p % coord0 % xyz = p % coord0 % xyz + TINY_BIT * p % coord0 % uvw + call score_surface_current(p) + end if ! Display message if (verbosity >= 10 .or. trace) then @@ -274,9 +276,12 @@ contains ! Score surface currents since reflection causes the direction of the ! particle to change -- artificially move the particle slightly back in ! case the surface crossing in coincident with a mesh boundary - 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 + + if (tallies_on) 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 + end if ! Copy particle's direction cosines u = p % coord0 % uvw(1) diff --git a/src/tally.f90 b/src/tally.f90 index 253e040d7c..d30533a7e8 100644 --- a/src/tally.f90 +++ b/src/tally.f90 @@ -662,7 +662,7 @@ contains bins(TS_SURFACE) = OUT_TOP bins(1:3) = ijk0 + 1 score_index = sum((bins - 1) * t % stride) + 1 - call add_to_score(t % scores(score_index, 1), p % last_wgt) + call add_to_score(t % scores(score_index, 1), p % wgt) end if end do else @@ -672,7 +672,7 @@ contains bins(TS_SURFACE) = IN_TOP bins(1:3) = ijk0 + 1 score_index = sum((bins - 1) * t % stride) + 1 - call add_to_score(t % scores(score_index, 1), p % last_wgt) + call add_to_score(t % scores(score_index, 1), p % wgt) end if end do end if @@ -686,7 +686,7 @@ contains bins(TS_SURFACE) = OUT_FRONT bins(1:3) = ijk0 + 1 score_index = sum((bins - 1) * t % stride) + 1 - call add_to_score(t % scores(score_index, 1), p % last_wgt) + call add_to_score(t % scores(score_index, 1), p % wgt) end if end do else @@ -696,7 +696,7 @@ contains bins(TS_SURFACE) = IN_FRONT bins(1:3) = ijk0 + 1 score_index = sum((bins - 1) * t % stride) + 1 - call add_to_score(t % scores(score_index, 1), p % last_wgt) + call add_to_score(t % scores(score_index, 1), p % wgt) end if end do end if @@ -710,7 +710,7 @@ contains bins(TS_SURFACE) = OUT_RIGHT bins(1:3) = ijk0 + 1 score_index = sum((bins - 1) * t % stride) + 1 - call add_to_score(t % scores(score_index, 1), p % last_wgt) + call add_to_score(t % scores(score_index, 1), p % wgt) end if end do else @@ -720,7 +720,7 @@ contains bins(TS_SURFACE) = IN_RIGHT bins(1:3) = ijk0 + 1 score_index = sum((bins - 1) * t % stride) + 1 - call add_to_score(t % scores(score_index, 1), p % last_wgt) + call add_to_score(t % scores(score_index, 1), p % wgt) end if end do end if @@ -836,7 +836,7 @@ contains end if ! Add to surface current tally - call add_to_score(t % scores(score_index, 1), p % last_wgt) + call add_to_score(t % scores(score_index, 1), p % wgt) end if ! Calculate new coordinates