diff --git a/src/eucl/eucl.f90 b/src/eucl/eucl.f90 index 306110635..09ff2eb63 100644 --- a/src/eucl/eucl.f90 +++ b/src/eucl/eucl.f90 @@ -17,12 +17,12 @@ module subroutine eucl_dist_index_plpl(self) integer(I8B) :: i, j, counter, npl npl = int(self%nbody, kind=I8B) - associate(num_comparisons => self%num_comparisons) - num_comparisons = (npl * (npl - 1) / 2) ! number of entries in a strict lower triangle, nplm x npl, minus first column + associate(nplpl => self%nplpl) + nplpl = (npl * (npl - 1) / 2) ! number of entries in a strict lower triangle, nplm x npl, minus first column if (allocated(self%k_eucl)) deallocate(self%k_eucl) ! Reset the index array if it's been set previously if (allocated(self%irij3)) deallocate(self%irij3) - allocate(self%k_eucl(2, num_comparisons)) - allocate(self%irij3(num_comparisons)) + allocate(self%k_eucl(2, nplpl)) + allocate(self%irij3(nplpl)) do i = 1, npl counter = (i - 1_I8B) * npl - i * (i - 1_I8B) / 2_I8B + 1_I8B do j = i + 1_I8B, npl @@ -61,7 +61,7 @@ module subroutine eucl_irij3_plpl(self) real(DP), dimension(NDIM) :: dx real(DP) :: rji2 - associate(k_eucl => self%k_eucl, xh => self%xh, irij3 => self%irij3, nk => self%num_comparisons) + associate(k_eucl => self%k_eucl, xh => self%xh, irij3 => self%irij3, nk => self%nplpl) do k = 1, nk i = k_eucl(1, k) j = k_eucl(2, k) diff --git a/src/modules/swiftest_classes.f90 b/src/modules/swiftest_classes.f90 index 85986fec4..c70d3159a 100644 --- a/src/modules/swiftest_classes.f90 +++ b/src/modules/swiftest_classes.f90 @@ -163,7 +163,7 @@ module swiftest_classes real(DP), dimension(:), allocatable :: capm !! Mean anomaly real(DP), dimension(:), allocatable :: mu !! G * (Mcb + [m]) integer(I4B), dimension(:,:), allocatable :: k_eucl !! Index array used to convert flattened the body-body comparison upper triangular matrix - integer(I8B) :: num_comparisons !! Number of body-body comparisons in the flattened upper triangular matrix + integer(I8B) :: nplpl !! Number of body-body comparisons in the flattened upper triangular matrix !! Note to developers: If you add components to this class, be sure to update methods and subroutines that traverse the !! component list, such as setup_body and util_spill contains diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index 471019127..d8fc75707 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -77,6 +77,7 @@ module symba_classes logical, dimension(:), allocatable :: lencounter !! flag indicating whether body is part of an encounter this time step logical, dimension(:), allocatable :: lmtiny !! flag indicating whether this body is below the MTINY cutoff value integer(I4B) :: nplm !! number of bodies above the MTINY limit + integer(I8B) :: nplplm !! Number of body (all massive)-body (only those above MTINY) comparisons in the flattened upper triangular matrix integer(I4B), dimension(:), allocatable :: nplenc !! number of encounters with other planets this time step integer(I4B), dimension(:), allocatable :: ntpenc !! number of encounters with test particles this time step integer(I4B), dimension(:), allocatable :: levelg !! level at which this body should be moved diff --git a/src/setup/setup.f90 b/src/setup/setup.f90 index 0c89d613b..e85f9754a 100644 --- a/src/setup/setup.f90 +++ b/src/setup/setup.f90 @@ -183,7 +183,7 @@ module subroutine setup_pl(self,n) self%k2(:) = 0.0_DP self%Q(:) = 0.0_DP self%tlag(:) = 0.0_DP - self%num_comparisons = 0 + self%nplpl = 0 return end subroutine setup_pl