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

Commit

Permalink
Removed the mergesub_list call from inside the symba step
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 2, 2021
1 parent c1ca5fc commit aa3e810
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,10 @@ module subroutine symba_collision_check_plplenc(self, system, param, t, dt, irec
! Check to see if either of these bodies has been involved with a collision before, and if so, make this a collisional family
if (pl%lcollision(ind1(k)) .or. pl%lcollision(ind2(k))) call pl%make_family([ind1(k),ind2(k)])

! Add any of the bodies that have *not* previously been involved in a collision to the subtraction list
lmask(:) = .false.
lmask(ind1(k)) = .not.pl%lcollision(ind1(k))
lmask(ind2(k)) = .not.pl%lcollision(ind2(k))
! Set the collision flag for these to bodies to true in case they become involved in another collision later in the step
pl%lcollision([ind1(k), ind2(k)]) = .true.
pl%lcollision([ind1(k), ind2(k)]) = .true.
pl%status([ind1(k), ind2(k)]) = COLLISION
call system%mergesub_list%append(pl, lmask)
end do

end if
Expand Down
8 changes: 7 additions & 1 deletion src/symba/symba_discard.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ end subroutine symba_discard_pl
subroutine symba_discard_cb_pl(pl, system, param)
!! author: David A. Minton
!!
!! Check to see if planets should be discarded based on their positions relative to the central body
!! Check to see if planets should be discarded based on their positions relative to the central body.
!! If a body gets flagged here when it has also been previously flagged for a collision with another massive body,
!! its collisional status will be revoked. Discards due to colliding with or escaping the central body take precedence
!! over pl-pl collisions
!!
!! Adapted from David E. Kaufmann's Swifter routine: symba_discard_cb.f90
!! Adapted from Hal Levison's Swift routine discard_massive5.f
Expand All @@ -60,10 +63,12 @@ subroutine symba_discard_cb_pl(pl, system, param)
rh2 = dot_product(pl%xh(:,i), pl%xh(:,i))
if ((param%rmax >= 0.0_DP) .and. (rh2 > rmax2)) then
pl%ldiscard(i) = .true.
pl%lcollision(i) = .false.
pl%status(i) = DISCARDED_RMAX
write(*, *) "Massive body ", pl%id(i), " too far from the central body at t = ", param%t
else if ((param%rmin >= 0.0_DP) .and. (rh2 < rmin2)) then
pl%ldiscard(i) = .true.
pl%lcollision(i) = .false.
pl%status(i) = DISCARDED_RMIN
write(*, *) "Massive body ", pl%id(i), " too close to the central body at t = ", param%t
else if (param%rmaxu >= 0.0_DP) then
Expand All @@ -72,6 +77,7 @@ subroutine symba_discard_cb_pl(pl, system, param)
energy = 0.5_DP * vb2 - system%msys / sqrt(rb2)
if ((energy > 0.0_DP) .and. (rb2 > rmaxu2)) then
pl%ldiscard(i) = .true.
pl%lcollision(i) = .false.
pl%status(i) = DISCARDED_RMAXU
write(*, *) "Massive body ", pl%id(i), " is unbound and too far from barycenter at t = ", param%t
end if
Expand Down

0 comments on commit aa3e810

Please sign in to comment.