diff --git a/src/encounter/encounter_check.f90 b/src/encounter/encounter_check.f90 index 298bf7d4f..b6dae95fb 100644 --- a/src/encounter/encounter_check.f90 +++ b/src/encounter/encounter_check.f90 @@ -981,9 +981,11 @@ module subroutine encounter_check_sweep_aabb_single_list(self, n, nenc, index1, call util_index_array(ind_arr, n) allocate(ibeg(SWEEPDIM * n)) allocate(iend(SWEEPDIM * n)) - do dim = 1, SWEEPDIM - ibeg((dim - 1) * n + 1:dim * n) = self%aabb(dim)%ibeg(:) - iend((dim - 1) * n + 1:dim * n) = self%aabb(dim)%iend(:) + do i = 1, n + 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