diff --git a/src/encounter/encounter_check.f90 b/src/encounter/encounter_check.f90 index 9965b2f9d..7018e6f19 100644 --- a/src/encounter/encounter_check.f90 +++ b/src/encounter/encounter_check.f90 @@ -977,9 +977,11 @@ module subroutine encounter_check_sweep_aabb_double_list(self, n1, n2, nenc, ind call util_index_array(ind_arr, ntot) allocate(ibeg(SWEEPDIM * ntot)) allocate(iend(SWEEPDIM * ntot)) - do dim = 1, SWEEPDIM - ibeg((dim - 1) * ntot + 1:dim * ntot) = self%aabb(dim)%ibeg(:) - iend((dim - 1) * ntot + 1:dim * ntot) = self%aabb(dim)%iend(:) + do i = 1, ntot + do dim = 1, SWEEPDIM + ibeg((i - 1) * SWEEPDIM + dim) = self%aabb(dim)%ibeg(i) + iend((i - 1) * SWEEPDIM + dim) = self%aabb(dim)%iend(i) + end do end do ! Sweep the intervals for each of the massive bodies along one dimension ! This will build a ragged pair of index lists inside of the lenc data structure