diff --git a/examples/symba_swifter_comparison/1pl_1pl_encounter/swiftest_vs_swifter.ipynb b/examples/symba_swifter_comparison/1pl_1pl_encounter/swiftest_vs_swifter.ipynb index dc1a9992f..57dd1934a 100644 --- a/examples/symba_swifter_comparison/1pl_1pl_encounter/swiftest_vs_swifter.ipynb +++ b/examples/symba_swifter_comparison/1pl_1pl_encounter/swiftest_vs_swifter.ipynb @@ -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" ] }, diff --git a/src/symba/symba_encounter_check.f90 b/src/symba/symba_encounter_check.f90 index 1a9d8c68f..baa2dc5f5 100644 --- a/src/symba/symba_encounter_check.f90 +++ b/src/symba/symba_encounter_check.f90 @@ -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 @@ -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)