diff --git a/src/modules/swiftest_classes.f90 b/src/modules/swiftest_classes.f90 index 92d671e9b..0842ab154 100644 --- a/src/modules/swiftest_classes.f90 +++ b/src/modules/swiftest_classes.f90 @@ -433,7 +433,6 @@ module swiftest_classes integer(I4B) :: nenc !! Total number of encounters logical, dimension(:), allocatable :: lvdotr !! relative vdotr flag integer(I4B), dimension(:), allocatable :: status !! status of the interaction - integer(I8B), dimension(:), allocatable :: kidx !! index value of the encounter from the master k_plpl encounter list integer(I4B), dimension(:), allocatable :: index1 !! position of the first body in the encounter integer(I4B), dimension(:), allocatable :: index2 !! position of the second body in the encounter integer(I4B), dimension(:), allocatable :: id1 !! id of the first body in the encounter diff --git a/src/setup/setup.f90 b/src/setup/setup.f90 index 41c0d9fba..18d8f2189 100644 --- a/src/setup/setup.f90 +++ b/src/setup/setup.f90 @@ -85,7 +85,6 @@ module subroutine setup_encounter(self, n) if (allocated(self%lvdotr)) deallocate(self%lvdotr) if (allocated(self%status)) deallocate(self%status) - if (allocated(self%kidx)) deallocate(self%kidx) if (allocated(self%index1)) deallocate(self%index1) if (allocated(self%index2)) deallocate(self%index2) if (allocated(self%id1)) deallocate(self%id1) @@ -101,7 +100,6 @@ module subroutine setup_encounter(self, n) allocate(self%lvdotr(n)) allocate(self%status(n)) - allocate(self%kidx(n)) allocate(self%index1(n)) allocate(self%index2(n)) allocate(self%id1(n)) @@ -114,7 +112,6 @@ module subroutine setup_encounter(self, n) self%lvdotr(:) = .false. self%status(:) = INACTIVE - self%kidx(:) = 0_I8B self%index1(:) = 0 self%index2(:) = 0 self%id1(:) = 0 diff --git a/src/symba/symba_encounter_check.f90 b/src/symba/symba_encounter_check.f90 index 1df9ca03c..cd6b81577 100644 --- a/src/symba/symba_encounter_check.f90 +++ b/src/symba/symba_encounter_check.f90 @@ -173,9 +173,12 @@ module function symba_encounter_check_pl(self, param, system, dt, irec) result(l else nplm = pl%nplm call symba_encounter_check_all_triangular(npl, nplm, pl%xh, pl%vh, pl%rhill, dt, irec, lvdotr, index1, index2, nenc) - call move_alloc(lvdotr, plplenc_list%lvdotr) - call move_alloc(index1, plplenc_list%index1) - call move_alloc(index2, plplenc_list%index2) + lany_encounter = nenc > 0 + if (lany_encounter) then + call move_alloc(lvdotr, plplenc_list%lvdotr) + call move_alloc(index1, plplenc_list%index1) + call move_alloc(index2, plplenc_list%index2) + end if end if if (lany_encounter) then @@ -183,7 +186,6 @@ module function symba_encounter_check_pl(self, param, system, dt, irec) result(l i = plplenc_list%index1(k) j = plplenc_list%index2(k) call util_index_eucl_ij_to_k(npl, i, j, kenc) - plplenc_list%kidx(k) = kenc plplenc_list%id1(k) = pl%id(plplenc_list%index1(k)) plplenc_list%id2(k) = pl%id(plplenc_list%index2(k)) plplenc_list%status(k) = ACTIVE diff --git a/src/symba/symba_kick.f90 b/src/symba/symba_kick.f90 index 414c89805..fd0354612 100644 --- a/src/symba/symba_kick.f90 +++ b/src/symba/symba_kick.f90 @@ -56,7 +56,8 @@ module subroutine symba_kick_getacch_pl(self, system, param, t, lbeg) ah_enc(:,:) = 0.0_DP nplplenc = int(plplenc_list%nenc, kind=I8B) allocate(k_plpl_enc(2,nplplenc)) - k_plpl_enc(:,1:nplplenc) = pl%k_plpl(:,plplenc_list%kidx(1:nplplenc)) + k_plpl_enc(1,1:nplplenc) = plplenc_list%index1(1:nplplenc) + k_plpl_enc(2,1:nplplenc) = plplenc_list%index2(1:nplplenc) call kick_getacch_int_all_flat_pl(npl, nplplenc, k_plpl_enc, pl%xh, pl%Gmass, pl%radius, ah_enc) pl%ah(:,1:npl) = pl%ah(:,1:npl) - ah_enc(:,1:npl) end if diff --git a/src/util/util_copy.f90 b/src/util/util_copy.f90 index 60d93e45e..f271c1c2e 100644 --- a/src/util/util_copy.f90 +++ b/src/util/util_copy.f90 @@ -15,7 +15,6 @@ module subroutine util_copy_encounter(self, source) self%nenc = n self%lvdotr(1:n) = source%lvdotr(1:n) self%status(1:n) = source%status(1:n) - self%kidx(1:n) = source%kidx(1:n) self%index1(1:n) = source%index1(1:n) self%index2(1:n) = source%index2(1:n) self%id1(1:n) = source%id1(1:n) diff --git a/src/util/util_spill.f90 b/src/util/util_spill.f90 index 16039c4da..e9d243cb6 100644 --- a/src/util/util_spill.f90 +++ b/src/util/util_spill.f90 @@ -373,7 +373,6 @@ module subroutine util_spill_encounter(self, discards, lspill_list, ldestructive associate(keeps => self) call util_spill(keeps%lvdotr, discards%lvdotr, lspill_list, ldestructive) call util_spill(keeps%status, discards%status, lspill_list, ldestructive) - call util_spill(keeps%kidx, discards%kidx, lspill_list, ldestructive) call util_spill(keeps%index1, discards%index1, lspill_list, ldestructive) call util_spill(keeps%index2, discards%index2, lspill_list, ldestructive) call util_spill(keeps%id1, discards%id1, lspill_list, ldestructive)