diff --git a/src/modules/rmvs_classes.f90 b/src/modules/rmvs_classes.f90 index 8b0ad2c2f..c167906fc 100644 --- a/src/modules/rmvs_classes.f90 +++ b/src/modules/rmvs_classes.f90 @@ -26,7 +26,7 @@ module rmvs_classes contains private !> Replace the abstract procedures with concrete ones - procedure, public :: initialize => rmvs_setup_system !! Performs RMVS-specific initilization steps, including generating the close encounter planetocentric structures + procedure, public :: initialize => rmvs_setup_initialize_system !! Performs RMVS-specific initilization steps, including generating the close encounter planetocentric structures procedure, public :: step => rmvs_step_system !! Advance the RMVS nbody system forward in time by one step end type rmvs_nbody_system @@ -152,12 +152,12 @@ module subroutine rmvs_setup_pl(self,n) integer, intent(in) :: n !! Number of test particles to allocate end subroutine rmvs_setup_pl - module subroutine rmvs_setup_system(self, param) + module subroutine rmvs_setup_initialize_system(self, param) use swiftest_classes, only : swiftest_parameters implicit none class(rmvs_nbody_system), intent(inout) :: self !! RMVS system object class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters - end subroutine rmvs_setup_system + end subroutine rmvs_setup_initialize_system module subroutine rmvs_setup_tp(self,n) implicit none diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index 98108e9df..3fe5a1824 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -160,7 +160,7 @@ module symba_classes class(symba_pl), allocatable :: pl_discards !! Discarded test particle data structure contains private - procedure, public :: initialize => symba_setup_system !! Performs SyMBA-specific initilization steps + procedure, public :: initialize => symba_setup_initialize_system !! Performs SyMBA-specific initilization steps procedure, public :: step => symba_step_system !! Advance the SyMBA nbody system forward in time by one step procedure, public :: interp => symba_step_interp_system !! Perform an interpolation step on the SymBA nbody system procedure, public :: recursive_step => symba_step_recur_system !! Step interacting planets and active test particles ahead in democratic heliocentric coordinates at the current recursion level, if applicable, and descend to the next deeper level if necessary @@ -332,12 +332,12 @@ module subroutine symba_setup_plplenc(self,n) integer, intent(in) :: n !! Number of encounters to allocate space for end subroutine symba_setup_plplenc - module subroutine symba_setup_system(self, param) + module subroutine symba_setup_initialize_system(self, param) use swiftest_classes, only : swiftest_parameters implicit none class(symba_nbody_system), intent(inout) :: self !! SyMBA system object class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters - end subroutine symba_setup_system + end subroutine symba_setup_initialize_system module subroutine symba_setup_tp(self,n) implicit none diff --git a/src/modules/whm_classes.f90 b/src/modules/whm_classes.f90 index 46a4e3743..a61cefb78 100644 --- a/src/modules/whm_classes.f90 +++ b/src/modules/whm_classes.f90 @@ -41,7 +41,7 @@ module whm_classes procedure, public :: gr_pos_kick => whm_gr_p4_pl !! Position kick due to p**4 term in the post-Newtonian correction procedure, public :: setup => whm_setup_pl !! Constructor method - Allocates space for number of particles procedure, public :: set_mu => whm_util_set_mu_eta_pl !! Sets the Jacobi mass value for all massive bodies. - procedure, public :: set_ir3 => whm_setup_set_ir3j !! Sets both the heliocentric and jacobi inverse radius terms (1/rj**3 and 1/rh**3) + procedure, public :: set_ir3 => whm_util_set_ir3j !! Sets both the heliocentric and jacobi inverse radius terms (1/rj**3 and 1/rh**3) procedure, public :: step => whm_step_pl !! Steps the body forward one stepsize procedure, public :: spill => whm_util_spill_pl !!"Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) end type whm_pl @@ -72,7 +72,7 @@ module whm_classes contains private !> Replace the abstract procedures with concrete ones - procedure, public :: initialize => whm_setup_system !! Performs WHM-specific initilization steps, like calculating the Jacobi masses + procedure, public :: initialize => whm_setup_initialize_system !! Performs WHM-specific initilization steps, like calculating the Jacobi masses procedure, public :: step => whm_step_system !! Advance the WHM nbody system forward in time by one step end type whm_nbody_system @@ -199,10 +199,10 @@ module subroutine whm_setup_pl(self,n) integer(I4B), intent(in) :: n !! Number of test particles to allocate end subroutine whm_setup_pl - module subroutine whm_setup_set_ir3j(self) + module subroutine whm_util_set_ir3j(self) implicit none class(whm_pl), intent(inout) :: self !! WHM massive body object - end subroutine whm_setup_set_ir3j + end subroutine whm_util_set_ir3j module subroutine whm_util_set_mu_eta_pl(self, cb) use swiftest_classes, only : swiftest_cb @@ -211,12 +211,12 @@ module subroutine whm_util_set_mu_eta_pl(self, cb) class(swiftest_cb), intent(inout) :: cb !! Swiftest central body object end subroutine whm_util_set_mu_eta_pl - module subroutine whm_setup_system(self, param) + module subroutine whm_setup_initialize_system(self, param) use swiftest_classes, only : swiftest_parameters implicit none class(whm_nbody_system), intent(inout) :: self !! WHM nbody system object class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters - end subroutine whm_setup_system + end subroutine whm_setup_initialize_system !> Reads WHM test particle object in from file module subroutine whm_setup_tp(self,n) diff --git a/src/rmvs/rmvs_setup.f90 b/src/rmvs/rmvs_setup.f90 index 4cda7bd6f..58002401e 100644 --- a/src/rmvs/rmvs_setup.f90 +++ b/src/rmvs/rmvs_setup.f90 @@ -46,7 +46,7 @@ module subroutine rmvs_setup_pl(self,n) return end subroutine rmvs_setup_pl - module subroutine rmvs_setup_system(self, param) + module subroutine rmvs_setup_initialize_system(self, param) !! author: David A. Minton !! !! Initialize an RMVS nbody system from files and sets up the planetocentric structures. @@ -64,7 +64,7 @@ module subroutine rmvs_setup_system(self, param) integer(I4B) :: i, j ! Call parent method - call whm_setup_system(self, param) + call whm_setup_initialize_system(self, param) ! Set up the pl-tp planetocentric encounter structures for pl and cb. The planetocentric tp structures are ! generated as necessary during close encounter steps. @@ -116,7 +116,7 @@ module subroutine rmvs_setup_system(self, param) end select end select - end subroutine rmvs_setup_system + end subroutine rmvs_setup_initialize_system module subroutine rmvs_setup_tp(self,n) !! author: David A. Minton diff --git a/src/symba/symba_setup.f90 b/src/symba/symba_setup.f90 index 9efb37e9a..51aaf69ba 100644 --- a/src/symba/symba_setup.f90 +++ b/src/symba/symba_setup.f90 @@ -100,7 +100,7 @@ module subroutine symba_setup_plplenc(self,n) return end subroutine symba_setup_plplenc - module subroutine symba_setup_system(self, param) + module subroutine symba_setup_initialize_system(self, param) !! author: David A. Minton !! !! Initialize an SyMBA nbody system from files and sets up the planetocentric structures. @@ -115,7 +115,7 @@ module subroutine symba_setup_system(self, param) ! Call parent method associate(system => self) - call whm_setup_system(system, param) + call whm_setup_initialize_system(system, param) call system%mergeadd_list%setup(1) call system%mergesub_list%setup(1) call system%pltpenc_list%setup(1) @@ -131,7 +131,7 @@ module subroutine symba_setup_system(self, param) end select end associate return - end subroutine symba_setup_system + end subroutine symba_setup_initialize_system module subroutine symba_setup_tp(self,n) !! author: David A. Minton diff --git a/src/whm/whm_setup.f90 b/src/whm/whm_setup.f90 index 1f098df26..940ba0b26 100644 --- a/src/whm/whm_setup.f90 +++ b/src/whm/whm_setup.f90 @@ -71,7 +71,7 @@ module subroutine whm_util_set_mu_eta_pl(self, cb) end subroutine whm_util_set_mu_eta_pl - module subroutine whm_setup_system(self, param) + module subroutine whm_setup_initialize_system(self, param) !! author: David A. Minton !! !! Initialize a WHM nbody system from files @@ -91,29 +91,6 @@ module subroutine whm_setup_system(self, param) call self%tp%v2pv(param) end if - end subroutine whm_setup_system - - module subroutine whm_setup_set_ir3j(self) - !! author: David A. Minton - !! - !! Sets the inverse Jacobi and heliocentric radii cubed (1/rj**3 and 1/rh**3) - implicit none - ! Arguments - class(whm_pl), intent(inout) :: self !! WHM massive body object - ! Internals - integer(I4B) :: i - real(DP) :: r2, ir - - if (self%nbody > 0) then - do i = 1, self%nbody - r2 = dot_product(self%xh(:, i), self%xh(:, i)) - ir = 1.0_DP / sqrt(r2) - self%ir3h(i) = ir / r2 - r2 = dot_product(self%xj(:, i), self%xj(:, i)) - ir = 1.0_DP / sqrt(r2) - self%ir3j(i) = ir / r2 - end do - end if - end subroutine whm_setup_set_ir3j + end subroutine whm_setup_initialize_system end submodule s_whm_setup \ No newline at end of file diff --git a/src/whm/whm_util.f90 b/src/whm/whm_util.f90 index 275130df9..67c7ef4a1 100644 --- a/src/whm/whm_util.f90 +++ b/src/whm/whm_util.f90 @@ -89,4 +89,27 @@ module subroutine whm_util_fill_pl(self, inserts, lfill_list) end subroutine whm_util_fill_pl + module subroutine whm_util_set_ir3j(self) + !! author: David A. Minton + !! + !! Sets the inverse Jacobi and heliocentric radii cubed (1/rj**3 and 1/rh**3) + implicit none + ! Arguments + class(whm_pl), intent(inout) :: self !! WHM massive body object + ! Internals + integer(I4B) :: i + real(DP) :: r2, ir + + if (self%nbody > 0) then + do i = 1, self%nbody + r2 = dot_product(self%xh(:, i), self%xh(:, i)) + ir = 1.0_DP / sqrt(r2) + self%ir3h(i) = ir / r2 + r2 = dot_product(self%xj(:, i), self%xj(:, i)) + ir = 1.0_DP / sqrt(r2) + self%ir3j(i) = ir / r2 + end do + end if + end subroutine whm_util_set_ir3j + end submodule s_whm_util