From 499cf27212a4299f8da41a3a488c422b78eac949 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Tue, 26 Oct 2021 14:40:39 -0400 Subject: [PATCH 1/2] Fixed problem that was causing MTINY bodies from being indexed incorrectly --- src/encounter/encounter_check.f90 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/encounter/encounter_check.f90 b/src/encounter/encounter_check.f90 index bbfa98ba3..56bb9fd5a 100644 --- a/src/encounter/encounter_check.f90 +++ b/src/encounter/encounter_check.f90 @@ -189,7 +189,7 @@ module subroutine encounter_check_all_plplm(param, nplm, nplt, xplm, vplm, xplt, call move_alloc(itmp, index1) allocate(itmp(nenc+plmplt_nenc)) itmp(1:nenc) = index2(1:nenc) - itmp(nenc+1:nenc+plmplt_nenc) = plmplt_index2(1:plmplt_nenc) + itmp(nenc+1:nenc+plmplt_nenc) = plmplt_index2(1:plmplt_nenc) - nplm ! Be sure to shift these indices back to their natural range call move_alloc(itmp, index2) allocate(ltmp(nenc+plmplt_nenc)) ltmp(1:nenc) = lvdotr(1:nenc) @@ -517,9 +517,6 @@ subroutine encounter_check_all_sort_and_sweep_plplm(nplm, nplt, xplm, vplm, xplt call encounter_check_all(nenc, index1, index2, xplm, vplm, xplt, vplt, rencm, renct, dt, lencounter, lvdotr) - ! Shift the tiny body indices back to their natural range - index2(:) = index2(:) + nplm - call encounter_check_reduce_broadphase(ntot, nenc, index1, index2, lencounter, lvdotr) end if return From 17d6c576b78ab24f48c4440fb15469bdecc6af6e Mon Sep 17 00:00:00 2001 From: David A Minton Date: Tue, 26 Oct 2021 14:45:21 -0400 Subject: [PATCH 2/2] Fixed sign error --- src/encounter/encounter_check.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encounter/encounter_check.f90 b/src/encounter/encounter_check.f90 index 56bb9fd5a..b125d0ff9 100644 --- a/src/encounter/encounter_check.f90 +++ b/src/encounter/encounter_check.f90 @@ -189,7 +189,7 @@ module subroutine encounter_check_all_plplm(param, nplm, nplt, xplm, vplm, xplt, call move_alloc(itmp, index1) allocate(itmp(nenc+plmplt_nenc)) itmp(1:nenc) = index2(1:nenc) - itmp(nenc+1:nenc+plmplt_nenc) = plmplt_index2(1:plmplt_nenc) - nplm ! Be sure to shift these indices back to their natural range + itmp(nenc+1:nenc+plmplt_nenc) = plmplt_index2(1:plmplt_nenc) + nplm ! Be sure to shift these indices back to their natural range call move_alloc(itmp, index2) allocate(ltmp(nenc+plmplt_nenc)) ltmp(1:nenc) = lvdotr(1:nenc)