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

Commit

Permalink
Ensure that bodies that are flagged as a discared outside of swiftest…
Browse files Browse the repository at this point in the history
…_discard_system (such as when Danby fails) are discarded
  • Loading branch information
daminton committed Jan 23, 2023
1 parent b4f29c2 commit f4887b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/swiftest/swiftest_discard.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ module subroutine swiftest_discard_system(self, param)
associate(nbody_system => self, tp => self%tp, pl => self%pl, tp_discards => self%tp_discards, pl_discards => self%pl_discards, nc => self%system_history%nc)
lpl_discards = .false.
ltp_discards = .false.
if (lpl_check) then
if (lpl_check .and. pl%nbody > 0) then
pl%ldiscard = pl%status(:) /= ACTIVE
call pl%discard(nbody_system, param)
lpl_discards = (pl_discards%nbody > 0)
end if

if (ltp_check) then
if (ltp_check .and. tp%nbody > 0) then
tp%ldiscard = tp%status(:) /= ACTIVE
call tp%discard(nbody_system, param)
ltp_discards = (tp_discards%nbody > 0)
end if
Expand Down

0 comments on commit f4887b4

Please sign in to comment.