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

Commit

Permalink
Fixed concurrent loop issue when there is nothing that meets the crit…
Browse files Browse the repository at this point in the history
…eria for checking encounters
  • Loading branch information
daminton committed Jul 30, 2021
1 parent f074454 commit 472e1fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"output_type": "stream",
"text": [
"Reading Swiftest file param.swiftest.in\n",
"Reading in time 6.845e-04\n",
"Reading in time 1.506e-01\n",
"Creating Dataset\n"
]
},
Expand Down
6 changes: 5 additions & 1 deletion src/symba/symba_encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module function symba_encounter_check_pltpenc(self, system, dt, irec) result(lan
real(DP), dimension(NDIM) :: xr, vr
logical :: lencounter, isplpl
real(DP) :: rlim2, rji2
logical, dimension(:), allocatable :: lencmask

lany_encounter = .false.
if (self%nenc == 0) return
Expand All @@ -90,7 +91,10 @@ module function symba_encounter_check_pltpenc(self, system, dt, irec) result(lan
class is (symba_pl)
select type(tp => system%tp)
class is (symba_tp)
do concurrent(i = 1:self%nenc, self%status(i) == ACTIVE .and. self%level(i) == irec - 1)
allocate(lencmask(self%nenc))
lencmask(:) = (self%status(1:self%nenc) == ACTIVE) .and. (self%level(:) == irec - 1)
if (.not.any(lencmask(:))) return
do concurrent(i = 1:self%nenc, lencmask(i))
associate(index_i => self%index1(i), index_j => self%index2(i))
if (isplpl) then
xr(:) = pl%xh(:,index_j) - pl%xh(:,index_i)
Expand Down

0 comments on commit 472e1fe

Please sign in to comment.