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

Commit

Permalink
Fixed recursion level problem in SyMBA
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 18, 2021
1 parent 70bfb25 commit 5d85880
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
26 changes: 21 additions & 5 deletions src/symba/symba_encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@ module function symba_encounter_check_pl(self, system, dt, irec) result(lany_enc
plplenc_list%id1(1:nenc) = pl%id(plplenc_list%index1(1:nenc))
plplenc_list%id2(1:nenc) = pl%id(plplenc_list%index2(1:nenc))
do k = 1, nenc
plplenc_list%status(k) = ACTIVE
plplenc_list%level(k) = irec
pl%lencounter(plplenc_list%index1(k)) = .true.
pl%lencounter(plplenc_list%index2(k)) = .true.
associate(i => plplenc_list%index1(k), j => plplenc_list%index2(k))
plplenc_list%status(k) = ACTIVE
plplenc_list%level(k) = irec
pl%lencounter(i) = .true.
pl%lencounter(j) = .true.
pl%levelg(i) = irec
pl%levelm(i) = irec
pl%levelg(j) = irec
pl%levelm(j) = irec
pl%nplenc(i) = pl%nplenc(i) + 1
pl%nplenc(j) = pl%nplenc(j) + 1
end associate
end do
end associate
end if
Expand Down Expand Up @@ -186,7 +194,15 @@ module function symba_encounter_check_tp(self, system, dt, irec) result(lany_enc
class is (symba_pl)
pl%lencounter(1:npl) = .false.
do k = 1, nenc
pl%lencounter(pltpenc_list%index1(k)) = .true.
associate(plind => pltpenc_list%index1(k), tpind => pltpenc_list%index2(k))
pl%lencounter(plind) = .true.
pl%levelg(plind) = irec
pl%levelm(plind) = irec
tp%levelg(tpind) = irec
tp%levelm(tpind) = irec
pl%ntpenc(plind) = pl%ntpenc(plind) + 1
tp%nplenc(tpind) = tp%nplenc(tpind) + 1
end associate
end do
end select
end associate
Expand Down
2 changes: 1 addition & 1 deletion src/symba/symba_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ module subroutine symba_step_reset_system(self, param)
tp%nplenc(:) = 0
tp%levelg(:) = 0
tp%levelm(:) = 0
system%pltpenc_list%nenc = 0
system%pltpenc_list%nenc = 0
end if

call system%pl_adds%setup(0, param)
Expand Down

0 comments on commit 5d85880

Please sign in to comment.