Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed small bugs
  • Loading branch information
daminton committed Apr 16, 2021
1 parent b9838f0 commit adf2da7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/modules/rmvs_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
25 changes: 13 additions & 12 deletions src/rmvs/rmvs_setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit adf2da7

Please sign in to comment.