From 54feb3fe20a86edd18fc2436e4fdbaa7222925fc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 26 Mar 2012 19:51:37 -0400 Subject: [PATCH] Another fix for mesh tracklength tallies. --- src/physics.F90 | 6 +++--- src/tally.F90 | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/physics.F90 b/src/physics.F90 index 03ca45354d..ca9d389ec1 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -81,9 +81,6 @@ contains ! Select smaller of the two distances distance = min(d_boundary, d_collision) - ! Save coordinates for tallying purposes - p % last_xyz = p % coord0 % xyz - ! Advance particle coord => p % coord0 do while (associated(coord)) @@ -131,6 +128,9 @@ contains p % surface = NONE call collision() + ! Save coordinates for tallying purposes + p % last_xyz = p % coord0 % xyz + ! Set last material to none since cross sections will need to be ! re-evaluated p % last_material = NONE diff --git a/src/tally.F90 b/src/tally.F90 index cb701e7070..5d304e4ddb 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -552,7 +552,7 @@ contains ! since multiple bins can be scored to with a single track if (t % n_filter_bins(FILTER_MESH) > 0) then - call score_tl_on_mesh(tracklength_tallies(i)) + call score_tl_on_mesh(tracklength_tallies(i), distance) cycle end if @@ -621,9 +621,10 @@ contains ! these tallies, it is possible to score to multiple mesh cells for each track. !=============================================================================== - subroutine score_tl_on_mesh(index_tally) + subroutine score_tl_on_mesh(index_tally, d_track) integer, intent(in) :: index_tally + real(8), intent(in) :: d_track integer :: i ! loop index for filter/score bins integer :: j ! loop index for direction @@ -657,8 +658,8 @@ contains ! CHECK IF THIS TRACK INTERSECTS THE MESH ! Copy starting and ending location of particle - xyz0 = p % last_xyz - xyz1 = p % coord0 % xyz + xyz0 = p % coord0 % xyz - (d_track - TINY_BIT) * p % coord0 % uvw + xyz1 = p % coord0 % xyz - TINY_BIT * p % coord0 % uvw ! Determine indices for starting and ending location m => meshes(t % mesh) @@ -671,6 +672,10 @@ contains if (.not. mesh_intersects(m, xyz0, xyz1)) return end if + ! Reset starting and ending location + xyz0 = p % coord0 % xyz - d_track * p % coord0 % uvw + xyz1 = p % coord0 % xyz + ! ========================================================================= ! CHECK FOR SCORING COMBINATION FOR FILTERS OTHER THAN MESH