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

Commit

Permalink
Moved the set_renc methods inside the various flavors of encounter_ch…
Browse files Browse the repository at this point in the history
…eck so that it always has the most up-to-date value at the time it is called
  • Loading branch information
daminton committed Oct 26, 2021
1 parent 46f0fa3 commit 3a02f5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/symba/symba_encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ module function symba_encounter_check_pl(self, param, system, dt, irec) result(l
nplm = pl%nplm
nplt = npl - nplm

call pl%set_renc(irec)

if (nplt == 0) then
call encounter_check_all_plpl(param, npl, pl%xh, pl%vh, pl%renc, dt, lvdotr, index1, index2, nenc)
else
Expand Down Expand Up @@ -116,6 +118,8 @@ module function symba_encounter_check(self, param, system, dt, irec) result(lany
nenc_enc = count(lencmask(:))
if (nenc_enc == 0) return

call pl%set_renc(irec)

allocate(encidx(nenc_enc))
allocate(lencounter(nenc_enc))
encidx(:) = pack([(k, k = 1, self%nenc)], lencmask(:))
Expand Down Expand Up @@ -203,6 +207,7 @@ module function symba_encounter_check_tp(self, param, system, dt, irec) result(l
if (self%nbody == 0) return

associate(tp => self, ntp => self%nbody, pl => system%pl, npl => system%pl%nbody)
call pl%set_renc(irec)
call encounter_check_all_pltp(param, npl, ntp, pl%xh, pl%vh, tp%xh, tp%vh, pl%renc, dt, lvdotr, index1, index2, nenc)

lany_encounter = nenc > 0
Expand Down
1 change: 0 additions & 1 deletion src/symba/symba_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ module recursive subroutine symba_step_recur_system(self, param, t, ireci)
nloops = NTENC
end if
do j = 1, nloops
call system%pl%set_renc(irecp)
lencounter = plplenc_list%encounter_check(param, system, dtl, irecp) .or. pltpenc_list%encounter_check(param, system, dtl, irecp)

call plplenc_list%kick(system, dth, irecp, 1)
Expand Down

0 comments on commit 3a02f5b

Please sign in to comment.