Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed typo that was preventing the "after" stage to be saved to file …
Browse files Browse the repository at this point in the history
…(instead it was putting the "before" stage in twice)
  • Loading branch information
daminton committed Jan 3, 2023
1 parent ec4d44b commit af54785
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/collision/collision_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions src/collision/collision_resolve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit af54785

Please sign in to comment.