From 7472c5cd63baccf6e583ba203de57767b5a9adb8 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 25 May 2023 14:03:11 -0400 Subject: [PATCH] Fixed problem in SyMBA where nplm was not being updated properly after massive body discards --- src/swiftest/swiftest_util.f90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/swiftest/swiftest_util.f90 b/src/swiftest/swiftest_util.f90 index 641fcc170..2c7b803bc 100644 --- a/src/swiftest/swiftest_util.f90 +++ b/src/swiftest/swiftest_util.f90 @@ -1678,7 +1678,10 @@ module subroutine swiftest_util_rearray_pl(self, nbody_system, param) npl = pl%nbody end if - if (npl == 0) return + if (npl == 0) then + if (param%lmtiny_pl) pl%nplm = 0 + return + end if ! Reset all of the status flags for this body pl%status(1:npl) = ACTIVE @@ -1696,6 +1699,7 @@ module subroutine swiftest_util_rearray_pl(self, nbody_system, param) elsewhere pl%info(1:npl)%particle_type = PL_TYPE_NAME end where + pl%nplm = count(.not.pl%lmtiny(1:npl)) end if ! Reindex the new list of bodies