From adf2da7e1dd744ac135699e3b7fc70d32ff0bb06 Mon Sep 17 00:00:00 2001 From: David Minton Date: Fri, 16 Apr 2021 17:10:10 -0400 Subject: [PATCH] Fixed small bugs --- src/modules/rmvs_classes.f90 | 6 +++--- src/rmvs/rmvs_setup.f90 | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/modules/rmvs_classes.f90 b/src/modules/rmvs_classes.f90 index d5fe4861d..f32122d2a 100644 --- a/src/modules/rmvs_classes.f90 +++ b/src/modules/rmvs_classes.f90 @@ -34,7 +34,7 @@ module rmvs_classes !******************************************************************************************************************************* !> RMVS central body particle class type, public, extends(whm_cb) :: rmvs_cb - logical :: lplanetocentric !! Flag that indicates that the object is a planetocentric set of test particles used for close encounter calculations + logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of test particles used for close encounter calculations real(DP), dimension(NDIM) :: xin = [0.0_DP, 0.0_DP, 0.0_DP] real(DP), dimension(NDIM) :: vin = [0.0_DP, 0.0_DP, 0.0_DP] end type rmvs_cb @@ -48,7 +48,7 @@ module rmvs_classes !! Note to developers: If you add componenets to this class, be sure to update methods and subroutines that traverse the !! component list, such as rmvs_setup_tp and rmvs_spill_tp ! encounter steps) - logical :: lplanetocentric !! Flag that indicates that the object is a planetocentric set of test particles used for close encounter calculations + logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of test particles used for close encounter calculations logical, dimension(:), allocatable :: lperi !! planetocentric pericenter passage flag (persistent for a full rmvs time step) over a full RMVS time step) integer(I4B), dimension(:), allocatable :: plperP !! index of planet associated with pericenter distance peri (persistent over a full RMVS time step) integer(I4B), dimension(:), allocatable :: plencP !! index of planet that test particle is encountering (not persistent for a full RMVS time step) @@ -82,7 +82,7 @@ module rmvs_classes !> RMVS massive body particle class type, private, extends(whm_pl) :: rmvs_base_pl - logical :: lplanetocentric !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations + logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations integer(I4B), dimension(:), allocatable :: nenc !! number of test particles encountering planet this full rmvs time step integer(I4B), dimension(:), allocatable :: tpenc1P !! index of first test particle encountering planet integer(I4B), dimension(:), allocatable :: plind ! Connects the planetocentric indices back to the heliocentric planet list diff --git a/src/rmvs/rmvs_setup.f90 b/src/rmvs/rmvs_setup.f90 index 3dd22ba43..23a00cce9 100644 --- a/src/rmvs/rmvs_setup.f90 +++ b/src/rmvs/rmvs_setup.f90 @@ -16,25 +16,25 @@ module subroutine rmvs_setup_pl(self,n) !type(swiftest_configuration) :: encounter_config !> Call allocation method for parent class - associate(system => self) - call whm_setup_pl(system, n) + associate(pl => self) + call whm_setup_pl(pl, n) if (n <= 0) return - if (.not.system%lplanetocentric) then - allocate(self%nenc(n)) - self%nenc(:) = 0 + if (.not.pl%lplanetocentric) then + allocate(pl%nenc(n)) + pl%nenc(:) = 0 ! Set up inner and outer planet interpolation vector storage containers - allocate(self%outer(0:NTENC)) + allocate(pl%outer(0:NTENC)) do i = 0, NTENC - allocate(self%outer(i)%x(NDIM, n)) - allocate(self%outer(i)%v(NDIM, n)) + allocate(pl%outer(i)%x(NDIM, n)) + allocate(pl%outer(i)%v(NDIM, n)) end do - allocate(self%inner(0:NTPHENC)) + allocate(pl%inner(0:NTPHENC)) do i = 0, NTPHENC - allocate(self%inner(i)%x(NDIM, n)) - allocate(self%inner(i)%v(NDIM, n)) - allocate(self%inner(i)%aobl(NDIM, n)) + allocate(pl%inner(i)%x(NDIM, n)) + allocate(pl%inner(i)%v(NDIM, n)) + allocate(pl%inner(i)%aobl(NDIM, n)) end do end if end associate @@ -84,6 +84,7 @@ module subroutine rmvs_setup_system(self, config) class(swiftest_configuration), intent(inout) :: config !! Input collection of configuration parameters ! Internals integer(I4B) :: i, j + ! Call parent method call whm_setup_system(self, config)