From af547856e8462459c9ff677c58ceb907212c2053 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Tue, 3 Jan 2023 14:19:42 -0500 Subject: [PATCH] Fixed typo that was preventing the "after" stage to be saved to file (instead it was putting the "before" stage in twice) --- src/collision/collision_io.f90 | 2 +- src/collision/collision_resolve.f90 | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/collision/collision_io.f90 b/src/collision/collision_io.f90 index a798004d1..820f69af1 100644 --- a/src/collision/collision_io.f90 +++ b/src/collision/collision_io.f90 @@ -303,7 +303,7 @@ module subroutine collision_io_netcdf_write_frame_snapshot(self, history, param) select type(before =>self%collider%before) class is (swiftest_nbody_system) - select type(after =>self%collider%before) + select type(after =>self%collider%after) class is (swiftest_nbody_system) do stage = 1,2 if (allocated(pl)) deallocate(pl) diff --git a/src/collision/collision_resolve.f90 b/src/collision/collision_resolve.f90 index acec15b5f..0044fe33c 100644 --- a/src/collision/collision_resolve.f90 +++ b/src/collision/collision_resolve.f90 @@ -316,7 +316,7 @@ module subroutine collision_resolve_mergeaddsub(nbody_system, param, t, status) real(DP), intent(in) :: t !! Time of collision integer(I4B), intent(in) :: status !! Status flag to assign to adds ! Internals - integer(I4B) :: i, ibiggest, ismallest, iother, nstart, nend, nimpactors, nfrag + integer(I4B) :: i, ibiggest, ismallest, iother, nimpactors, nfrag logical, dimension(:), allocatable :: lmask class(swiftest_pl), allocatable :: plnew, plsub character(*), parameter :: FRAGFMT = '("Newbody",I0.7)' @@ -447,8 +447,6 @@ module subroutine collision_resolve_mergeaddsub(nbody_system, param, t, status) end select ! Append the new merged body to the list - nstart = pl_adds%nbody + 1 - nend = pl_adds%nbody + nfrag call pl_adds%append(plnew, lsource_mask=[(.true., i=1, nfrag)]) ! Add the discarded bodies to the discard list @@ -465,8 +463,6 @@ module subroutine collision_resolve_mergeaddsub(nbody_system, param, t, status) allocate(plsub, mold=pl) call pl%spill(plsub, lmask, ldestructive=.false.) - nstart = pl_discards%nbody + 1 - nend = pl_discards%nbody + nimpactors call pl_discards%append(plsub, lsource_mask=[(.true., i = 1, nimpactors)]) call plsub%setup(0, param)