diff --git a/src/symba/symba_encounter_check.f90 b/src/symba/symba_encounter_check.f90 index 7c40516b6..f75fc49f2 100644 --- a/src/symba/symba_encounter_check.f90 +++ b/src/symba/symba_encounter_check.f90 @@ -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 @@ -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(:)) @@ -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 diff --git a/src/symba/symba_step.f90 b/src/symba/symba_step.f90 index ba4c1a734..eac112dcd 100644 --- a/src/symba/symba_step.f90 +++ b/src/symba/symba_step.f90 @@ -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)