From 1ae2a6fce3c30350d8bc7439ddb29b7721b2b8a3 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Sun, 29 Aug 2021 10:52:22 -0400 Subject: [PATCH] Small changes to help track down the source of a mysterious segfault that only happens in ifort --- src/symba/symba_encounter_check.f90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/symba/symba_encounter_check.f90 b/src/symba/symba_encounter_check.f90 index c1b83f9dd..5aa0af850 100644 --- a/src/symba/symba_encounter_check.f90 +++ b/src/symba/symba_encounter_check.f90 @@ -19,7 +19,7 @@ module function symba_encounter_check_pl(self, system, dt, irec) result(lany_enc integer(I8B) :: k, nplplm integer(I4B) :: i, j, nenc real(DP) :: xr, yr, zr, vxr, vyr, vzr, rhill1, rhill2 - logical, dimension(self%nplplm) :: lencounter, loc_lvdotr + logical, dimension(:), allocatable :: lencounter, loc_lvdotr real(DP), dimension(:,:), pointer :: xh, vh real(DP), dimension(:), pointer :: rhill integer(I4B), dimension(:,:), pointer :: k_plpl @@ -28,6 +28,8 @@ module function symba_encounter_check_pl(self, system, dt, irec) result(lany_enc associate(pl => self, xh => self%xh, vh => self%vh, rhill => self%rhill, npl => self%nbody, k_plpl => self%k_plpl) nplplm = self%nplplm + allocate(lencounter(nplplm)) + allocate(loc_lvdotr(nplplm)) lencounter(:) = .false. loc_lvdotr(:) = .false. @@ -48,7 +50,9 @@ module function symba_encounter_check_pl(self, system, dt, irec) result(lany_enc end do !$omp end parallel do + !$omp parallel workshare nenc = count(lencounter(:)) + !$omp end parallel workshare lany_encounter = nenc > 0 if (lany_encounter) then associate(plplenc_list => system%plplenc_list)