diff --git a/src/modules/helio_classes.f90 b/src/modules/helio_classes.f90 index 2f8a52808..d03466676 100644 --- a/src/modules/helio_classes.f90 +++ b/src/modules/helio_classes.f90 @@ -7,21 +7,22 @@ module helio_classes use swiftest_classes, only : swiftest_cb, swiftest_pl, swiftest_tp, swiftest_nbody_system use whm_classes, only : whm_nbody_system implicit none + public !******************************************************************************************************************************** ! helio_nbody_system class definitions and method interfaces !******************************************************************************************************************************** - type, public, extends(whm_nbody_system) :: helio_nbody_system + type, extends(whm_nbody_system) :: helio_nbody_system contains - procedure, public :: step => helio_step_system !! Advance the Helio nbody system forward in time by one step + procedure :: step => helio_step_system !! Advance the Helio nbody system forward in time by one step end type helio_nbody_system !******************************************************************************************************************************** ! helio_cb class definitions and method interfaces !******************************************************************************************************************************* !> Helio central body particle class - type, public, extends(swiftest_cb) :: helio_cb + type, extends(swiftest_cb) :: helio_cb real(DP), dimension(NDIM) :: ptbeg !! negative barycentric velocity of the central body at the beginning of time step real(DP), dimension(NDIM) :: ptend !! negative barycentric velocity of the central body at the end of time step contains @@ -32,15 +33,15 @@ module helio_classes !******************************************************************************************************************************* !! Helio massive body particle class - type, public, extends(swiftest_pl) :: helio_pl + type, extends(swiftest_pl) :: helio_pl contains - procedure, public :: vh2vb => helio_coord_vh2vb_pl !! Convert massive bodies from heliocentric to barycentric coordinates (velocity only) - procedure, public :: vb2vh => helio_coord_vb2vh_pl !! Convert massive bodies from barycentric to heliocentric coordinates (velocity only) - procedure, public :: drift => helio_drift_pl !! Method for Danby drift in Democratic Heliocentric coordinates - procedure, public :: lindrift => helio_drift_linear_pl !! Method for linear drift of massive bodies due to barycentric momentum of Sun - procedure, public :: accel => helio_kick_getacch_pl !! Compute heliocentric accelerations of massive bodies - procedure, public :: kick => helio_kick_vb_pl !! Kicks the barycentric velocities - procedure, public :: step => helio_step_pl !! Steps the body forward one stepsize + procedure :: vh2vb => helio_coord_vh2vb_pl !! Convert massive bodies from heliocentric to barycentric coordinates (velocity only) + procedure :: vb2vh => helio_coord_vb2vh_pl !! Convert massive bodies from barycentric to heliocentric coordinates (velocity only) + procedure :: drift => helio_drift_pl !! Method for Danby drift in Democratic Heliocentric coordinates + procedure :: lindrift => helio_drift_linear_pl !! Method for linear drift of massive bodies due to barycentric momentum of Sun + procedure :: accel => helio_kick_getacch_pl !! Compute heliocentric accelerations of massive bodies + procedure :: kick => helio_kick_vb_pl !! Kicks the barycentric velocities + procedure :: step => helio_step_pl !! Steps the body forward one stepsize end type helio_pl !******************************************************************************************************************************** @@ -48,15 +49,15 @@ module helio_classes !******************************************************************************************************************************* !! Helio test particle class - type, public, extends(swiftest_tp) :: helio_tp + type, extends(swiftest_tp) :: helio_tp contains - procedure, public :: vh2vb => helio_coord_vh2vb_tp !! Convert test particles from heliocentric to barycentric coordinates (velocity only) - procedure, public :: vb2vh => helio_coord_vb2vh_tp !! Convert test particles from barycentric to heliocentric coordinates (velocity only) - procedure, public :: lindrift => helio_drift_linear_tp !! Method for linear drift of massive bodies due to barycentric momentum of Sun - procedure, public :: drift => helio_drift_tp !! Method for Danby drift in Democratic Heliocentric coordinates - procedure, public :: accel => helio_kick_getacch_tp !! Compute heliocentric accelerations of massive bodies - procedure, public :: kick => helio_kick_vb_tp !! Kicks the barycentric velocities - procedure, public :: step => helio_step_tp !! Steps the body forward one stepsize + procedure :: vh2vb => helio_coord_vh2vb_tp !! Convert test particles from heliocentric to barycentric coordinates (velocity only) + procedure :: vb2vh => helio_coord_vb2vh_tp !! Convert test particles from barycentric to heliocentric coordinates (velocity only) + procedure :: lindrift => helio_drift_linear_tp !! Method for linear drift of massive bodies due to barycentric momentum of Sun + procedure :: drift => helio_drift_tp !! Method for Danby drift in Democratic Heliocentric coordinates + procedure :: accel => helio_kick_getacch_tp !! Compute heliocentric accelerations of massive bodies + procedure :: kick => helio_kick_vb_tp !! Kicks the barycentric velocities + procedure :: step => helio_step_tp !! Steps the body forward one stepsize end type helio_tp interface diff --git a/src/modules/rmvs_classes.f90 b/src/modules/rmvs_classes.f90 index c167906fc..37a88993c 100644 --- a/src/modules/rmvs_classes.f90 +++ b/src/modules/rmvs_classes.f90 @@ -6,28 +6,27 @@ module rmvs_classes use swiftest_globals use whm_classes, only : whm_cb, whm_pl, whm_tp, whm_nbody_system implicit none - public + integer(I4B), private, parameter :: NTENC = 10 integer(I4B), private, parameter :: NTPHENC = 3 integer(I4B), private, parameter :: NTPENC = NTENC * NTPHENC - real(DP), private, parameter :: RHSCALE = 3.5_DP - real(DP), private, parameter :: RHPSCALE = 1.0_DP - real(DP), private, parameter :: FACQDT = 2.0_DP + real(DP), private, parameter :: RHSCALE = 3.5_DP + real(DP), private, parameter :: RHPSCALE = 1.0_DP + real(DP), private, parameter :: FACQDT = 2.0_DP !******************************************************************************************************************************** ! rmvs_nbody_system class definitions and method interfaces !******************************************************************************************************************************** - type, public, extends(whm_nbody_system) :: rmvs_nbody_system + type, extends(whm_nbody_system) :: rmvs_nbody_system !> In the RMVS integrator, only test particles are discarded logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations real(DP) :: rts !! fraction of Hill's sphere radius to use as radius of encounter region real(DP), dimension(:,:), allocatable :: vbeg !! Planet velocities at beginning ot step contains - private !> Replace the abstract procedures with concrete ones - 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 + procedure :: initialize => rmvs_setup_initialize_system !! Performs RMVS-specific initilization steps, including generating the close encounter planetocentric structures + procedure :: step => rmvs_step_system !! Advance the RMVS nbody system forward in time by one step end type rmvs_nbody_system type, private :: rmvs_interp @@ -41,7 +40,7 @@ module rmvs_classes ! rmvs_cb class definitions and method interfaces !******************************************************************************************************************************* !> RMVS central body particle class - type, public, extends(whm_cb) :: rmvs_cb + type, extends(whm_cb) :: rmvs_cb type(rmvs_interp), dimension(:), allocatable :: outer !! interpolated heliocentric central body position for outer encounters type(rmvs_interp), dimension(:), allocatable :: inner !! interpolated heliocentric central body position for inner encounters logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations @@ -52,7 +51,7 @@ module rmvs_classes !******************************************************************************************************************************* !! RMVS test particle class - type, public, extends(whm_tp) :: rmvs_tp + type, extends(whm_tp) :: rmvs_tp !! 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_util_spill_tp ! encounter steps) @@ -67,14 +66,13 @@ module rmvs_classes integer(I4B) :: ipleP !! index value of encountering planet logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations contains - private - procedure, public :: discard => rmvs_discard_tp !! Check to see if test particles should be discarded based on pericenter passage distances with respect to planets encountered - procedure, public :: encounter_check => rmvs_encounter_check_tp !! Checks if any test particles are undergoing a close encounter with a massive body - procedure, public :: fill => rmvs_util_fill_tp !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) - procedure, public :: accel => rmvs_kick_getacch_tp !! Calculates either the standard or modified version of the acceleration depending if the - !! if the test particle is undergoing a close encounter or not - procedure, public :: setup => rmvs_setup_tp !! Constructor method - Allocates space for number of particles - procedure, public :: spill => rmvs_util_spill_tp !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) + procedure :: discard => rmvs_discard_tp !! Check to see if test particles should be discarded based on pericenter passage distances with respect to planets encountered + procedure :: encounter_check => rmvs_encounter_check_tp !! Checks if any test particles are undergoing a close encounter with a massive body + procedure :: fill => rmvs_util_fill_tp !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) + procedure :: accel => rmvs_kick_getacch_tp !! Calculates either the standard or modified version of the acceleration depending if the + !! if the test particle is undergoing a close encounter or not + procedure :: setup => rmvs_setup_tp !! Constructor method - Allocates space for number of particles + procedure :: spill => rmvs_util_spill_tp !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) end type rmvs_tp !******************************************************************************************************************************** @@ -82,19 +80,18 @@ module rmvs_classes !******************************************************************************************************************************* !> RMVS massive body particle class - type, public, extends(whm_pl) :: rmvs_pl - 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 - type(rmvs_interp), dimension(:), allocatable :: outer !! interpolated heliocentric central body position for outer encounters - type(rmvs_interp), dimension(:), allocatable :: inner !! interpolated heliocentric central body position for inner encounters - class(rmvs_nbody_system), dimension(:), allocatable :: planetocentric - logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations + type, extends(whm_pl) :: rmvs_pl + 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 + type(rmvs_interp), dimension(:), allocatable :: outer !! interpolated heliocentric central body position for outer encounters + type(rmvs_interp), dimension(:), allocatable :: inner !! interpolated heliocentric central body position for inner encounters + class(rmvs_nbody_system), dimension(:), allocatable :: planetocentric !! Planetocentric version of the massive body objects (one for each massive body) + logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations contains - private - procedure, public :: fill => rmvs_util_fill_pl !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) - procedure, public :: setup => rmvs_setup_pl !! Constructor method - Allocates space for number of particles - procedure, public :: spill => rmvs_util_spill_pl !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) + procedure :: fill => rmvs_util_fill_pl !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) + procedure :: setup => rmvs_setup_pl !! Constructor method - Allocates space for number of particles + procedure :: spill => rmvs_util_spill_pl !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) end type rmvs_pl interface diff --git a/src/modules/swiftest_classes.f90 b/src/modules/swiftest_classes.f90 index 7f91f93f2..eff9f4077 100644 --- a/src/modules/swiftest_classes.f90 +++ b/src/modules/swiftest_classes.f90 @@ -5,25 +5,7 @@ module swiftest_classes !! Adapted from David E. Kaufmann's Swifter routine: module_swifter.f90 use swiftest_globals implicit none - private - public :: discard_pl, discard_system, discard_tp - public :: drift_all, drift_body, drift_one - public :: eucl_dist_index_plpl - public :: gr_kick_getaccb_ns_body, gr_p4_pos_kick, gr_pseudovel2vel, gr_vel2pseudovel - public :: io_dump_param, io_dump_swiftest, io_dump_system, io_get_args, io_get_token, io_param_reader, io_param_writer, io_read_body_in, & - io_read_cb_in, io_read_param_in, io_read_frame_body, io_read_frame_cb, io_read_frame_system, & - io_toupper, io_write_discard, io_write_encounter, io_write_frame_body, io_write_frame_cb, io_write_frame_system - public :: kick_getacch_int_pl - public :: obl_acc_body, obl_acc_pl, obl_acc_tp - public :: orbel_el2xv_vec, orbel_xv2el_vec, orbel_scget, orbel_xv2aeq, orbel_xv2aqt - public :: setup_body, setup_construct_system, setup_initialize_system, setup_pl, setup_tp - public :: tides_kick_getacch_pl, tides_step_spin_system - public :: user_kick_getacch_body - public :: util_coord_b2h_pl, util_coord_b2h_tp, util_coord_h2b_pl, util_coord_h2b_tp, util_exit, util_fill_body, util_fill_pl, util_fill_tp, & - util_peri_tp, util_reverse_status, util_set_beg_end_pl, util_set_ir3h, util_set_msys, util_set_mu_pl, & - util_set_mu_tp, util_set_rhill, util_set_rhill_approximate, & - util_sort, util_sort_body, util_sort_pl, util_sort_tp, util_sort_rearrange_body, util_sort_rearrange_pl, util_sort_rearrange_tp, & - util_spill_body, util_spill_pl, util_spill_tp, util_valid, util_version + public !******************************************************************************************************************************** ! swiftest_parameters class definitions @@ -31,7 +13,7 @@ module swiftest_classes !> User defined parameters that are read in from the parameters input file. !> Each paramter is initialized to a default values. - type, public :: swiftest_parameters + type :: swiftest_parameters integer(I4B) :: integrator = UNKNOWN_INTEGRATOR !! Symbolic name of the nbody integrator used integer(I4B) :: nplmax = -1 !! Maximum allowed number of massive bodies integer(I4B) :: ntpmax = -1 !! Maximum allowed number of test particles @@ -78,33 +60,31 @@ module swiftest_classes logical :: lyarkovsky = .false. !! Turn on Yarkovsky effect logical :: lyorp = .false. !! Turn on YORP effect contains - private - procedure, public :: reader => io_param_reader - procedure, public :: writer => io_param_writer - procedure, public :: dump => io_dump_param - procedure, public :: read_from_file => io_read_param_in + procedure :: reader => io_param_reader + procedure :: writer => io_param_writer + procedure :: dump => io_dump_param + procedure :: read_from_file => io_read_param_in end type swiftest_parameters !******************************************************************************************************************************** ! swiftest_base class definitions and methods !******************************************************************************************************************************** - type, abstract, public :: swiftest_base + type, abstract :: swiftest_base !! An superclass for a generic Swiftest object logical :: lintegrate = .false. !! Flag indicating that this object should be integrated in the current step contains !! The minimal methods that all systems must have - private procedure :: dump => io_dump_swiftest - procedure(abstract_initialize), public, deferred :: initialize - procedure(abstract_read_frame), public, deferred :: read_frame - procedure(abstract_write_frame), public, deferred :: write_frame + procedure(abstract_initialize), deferred :: initialize + procedure(abstract_read_frame), deferred :: read_frame + procedure(abstract_write_frame), deferred :: write_frame end type swiftest_base !******************************************************************************************************************************** ! swiftest_cb class definitions and methods !******************************************************************************************************************************** !> A concrete lass for the central body in a Swiftest simulation - type, abstract, public, extends(swiftest_base) :: swiftest_cb + type, abstract, extends(swiftest_base) :: swiftest_cb character(len=STRMAX) :: name !! Non-unique name integer(I4B) :: id = 0 !! External identifier (unique) real(DP) :: mass = 0.0_DP !! Central body mass (units MU) @@ -130,17 +110,16 @@ module swiftest_classes real(DP), dimension(NDIM) :: L0 = 0.0_DP !! Initial angular momentum of the central body real(DP), dimension(NDIM) :: dL = 0.0_DP !! Change in angular momentum of the central body contains - private - procedure, public :: initialize => io_read_cb_in !! I/O routine for reading in central body data - procedure, public :: read_frame => io_read_frame_cb !! I/O routine for reading out a single frame of time-series data for the central body - procedure, public :: write_frame => io_write_frame_cb !! I/O routine for writing out a single frame of time-series data for the central body + procedure :: initialize => io_read_cb_in !! I/O routine for reading in central body data + procedure :: read_frame => io_read_frame_cb !! I/O routine for reading out a single frame of time-series data for the central body + procedure :: write_frame => io_write_frame_cb !! I/O routine for writing out a single frame of time-series data for the central body end type swiftest_cb !******************************************************************************************************************************** ! swiftest_body definitions and methods !******************************************************************************************************************************** !> An abstract class for a generic collection of Swiftest bodies - type, abstract, public, extends(swiftest_base) :: swiftest_body + type, abstract, extends(swiftest_base) :: swiftest_body !! Superclass that defines the generic elements of a Swiftest particle logical :: lfirst = .true. !! Run the current step as a first integer(I4B) :: nbody = 0 !! Number of bodies @@ -167,37 +146,36 @@ module swiftest_classes !! 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 - private - procedure(abstract_discard_body), public, deferred :: discard - procedure(abstract_kick_body), public, deferred :: kick - procedure(abstract_set_mu), public, deferred :: set_mu - procedure(abstract_step_body), public, deferred :: step - procedure(abstract_accel), public, deferred :: accel + procedure(abstract_discard_body), deferred :: discard + procedure(abstract_kick_body), deferred :: kick + procedure(abstract_set_mu), deferred :: set_mu + procedure(abstract_step_body), deferred :: step + procedure(abstract_accel), deferred :: accel ! These are concrete because the implementation is the same for all types of particles - procedure, public :: drift => drift_body !! Loop through bodies and call Danby drift routine on heliocentric variables - procedure, public :: v2pv => gr_vh2pv_body !! Converts from velocity to psudeovelocity for GR calculations using symplectic integrators - procedure, public :: pv2v => gr_pv2vh_body !! Converts from psudeovelocity to velocity for GR calculations using symplectic integrators - procedure, public :: initialize => io_read_body_in !! Read in body initial conditions from a file - procedure, public :: read_frame => io_read_frame_body !! I/O routine for writing out a single frame of time-series data for the central body - procedure, public :: write_frame => io_write_frame_body !! I/O routine for writing out a single frame of time-series data for the central body - procedure, public :: accel_obl => obl_acc_body !! Compute the barycentric accelerations of bodies due to the oblateness of the central body - procedure, public :: el2xv => orbel_el2xv_vec !! Convert orbital elements to position and velocity vectors - procedure, public :: xv2el => orbel_xv2el_vec !! Convert position and velocity vectors to orbital elements - procedure, public :: setup => setup_body !! A constructor that sets the number of bodies and allocates all allocatable arrays - procedure, public :: accel_user => user_kick_getacch_body !! Add user-supplied heliocentric accelerations to planets - procedure, public :: fill => util_fill_body !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) - procedure, public :: reverse_status => util_reverse_status !! Reverses the active/inactive status of all particles in a structure - procedure, public :: set_ir3 => util_set_ir3h !! Sets the inverse heliocentric radius term (1/rh**3) - procedure, public :: sort => util_sort_body !! Sorts body arrays by a sortable componen - procedure, public :: rearrange => util_sort_rearrange_body !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods - procedure, public :: spill => util_spill_body !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) + procedure :: drift => drift_body !! Loop through bodies and call Danby drift routine on heliocentric variables + procedure :: v2pv => gr_vh2pv_body !! Converts from velocity to psudeovelocity for GR calculations using symplectic integrators + procedure :: pv2v => gr_pv2vh_body !! Converts from psudeovelocity to velocity for GR calculations using symplectic integrators + procedure :: initialize => io_read_body_in !! Read in body initial conditions from a file + procedure :: read_frame => io_read_frame_body !! I/O routine for writing out a single frame of time-series data for the central body + procedure :: write_frame => io_write_frame_body !! I/O routine for writing out a single frame of time-series data for the central body + procedure :: accel_obl => obl_acc_body !! Compute the barycentric accelerations of bodies due to the oblateness of the central body + procedure :: el2xv => orbel_el2xv_vec !! Convert orbital elements to position and velocity vectors + procedure :: xv2el => orbel_xv2el_vec !! Convert position and velocity vectors to orbital elements + procedure :: setup => setup_body !! A constructor that sets the number of bodies and allocates all allocatable arrays + procedure :: accel_user => user_kick_getacch_body !! Add user-supplied heliocentric accelerations to planets + procedure :: fill => util_fill_body !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) + procedure :: reverse_status => util_reverse_status !! Reverses the active/inactive status of all particles in a structure + procedure :: set_ir3 => util_set_ir3h !! Sets the inverse heliocentric radius term (1/rh**3) + procedure :: sort => util_sort_body !! Sorts body arrays by a sortable componen + procedure :: rearrange => util_sort_rearrange_body !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods + procedure :: spill => util_spill_body !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) end type swiftest_body !******************************************************************************************************************************** ! swiftest_pl definitions and methods !******************************************************************************************************************************** !> An abstract class for a generic collection of Swiftest massive bodies - type, abstract, public, extends(swiftest_body) :: swiftest_pl + type, abstract, extends(swiftest_body) :: swiftest_pl !! Superclass that defines the generic elements of a Swiftest particle real(DP), dimension(:), allocatable :: mass !! Body mass (units MU) real(DP), dimension(:), allocatable :: Gmass !! Mass gravitational term G * mass (units GU * MU) @@ -217,31 +195,30 @@ module swiftest_classes !! 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_pl and util_spill_pl contains - private ! Massive body-specific concrete methods ! These are concrete because they are the same implemenation for all integrators - procedure, public :: discard => discard_pl !! Placeholder method for discarding massive bodies - procedure, public :: eucl_index => eucl_dist_index_plpl !! Sets up the (i, j) -> k indexing used for the single-loop blocking Euclidean distance matrix - procedure, public :: accel_int => kick_getacch_int_pl !! Compute direct cross (third) term heliocentric accelerations of massive bodies - procedure, public :: accel_obl => obl_acc_pl !! Compute the barycentric accelerations of bodies due to the oblateness of the central body - procedure, public :: setup => setup_pl !! A base constructor that sets the number of bodies and allocates and initializes all arrays - procedure, public :: accel_tides => tides_kick_getacch_pl !! Compute the accelerations of bodies due to tidal interactions with the central body - procedure, public :: h2b => util_coord_h2b_pl !! Convert massive bodies from heliocentric to barycentric coordinates (position and velocity) - procedure, public :: b2h => util_coord_b2h_pl !! Convert massive bodies from barycentric to heliocentric coordinates (position and velocity) - procedure, public :: fill => util_fill_pl !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) - procedure, public :: set_beg_end => util_set_beg_end_pl !! Sets the beginning and ending positions and velocities of planets. - procedure, public :: set_mu => util_set_mu_pl !! Method used to construct the vectorized form of the central body mass - procedure, public :: set_rhill => util_set_rhill !! Calculates the Hill's radii for each body - procedure, public :: sort => util_sort_pl !! Sorts body arrays by a sortable component - procedure, public :: rearrange => util_sort_rearrange_pl !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods - procedure, public :: spill => util_spill_pl !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) + procedure :: discard => discard_pl !! Placeholder method for discarding massive bodies + procedure :: eucl_index => eucl_dist_index_plpl !! Sets up the (i, j) -> k indexing used for the single-loop blocking Euclidean distance matrix + procedure :: accel_int => kick_getacch_int_pl !! Compute direct cross (third) term heliocentric accelerations of massive bodies + procedure :: accel_obl => obl_acc_pl !! Compute the barycentric accelerations of bodies due to the oblateness of the central body + procedure :: setup => setup_pl !! A base constructor that sets the number of bodies and allocates and initializes all arrays + procedure :: accel_tides => tides_kick_getacch_pl !! Compute the accelerations of bodies due to tidal interactions with the central body + procedure :: h2b => util_coord_h2b_pl !! Convert massive bodies from heliocentric to barycentric coordinates (position and velocity) + procedure :: b2h => util_coord_b2h_pl !! Convert massive bodies from barycentric to heliocentric coordinates (position and velocity) + procedure :: fill => util_fill_pl !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) + procedure :: set_beg_end => util_set_beg_end_pl !! Sets the beginning and ending positions and velocities of planets. + procedure :: set_mu => util_set_mu_pl !! Method used to construct the vectorized form of the central body mass + procedure :: set_rhill => util_set_rhill !! Calculates the Hill's radii for each body + procedure :: sort => util_sort_pl !! Sorts body arrays by a sortable component + procedure :: rearrange => util_sort_rearrange_pl !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods + procedure :: spill => util_spill_pl !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) end type swiftest_pl !******************************************************************************************************************************** ! swiftest_tp definitions and methods !******************************************************************************************************************************** !> An abstract class for a generic collection of Swiftest test particles - type, abstract, public, extends(swiftest_body) :: swiftest_tp + type, abstract, extends(swiftest_body) :: swiftest_tp !! Superclass that defines the generic elements of a Swiftest test particle integer(I4B), dimension(:), allocatable :: isperi !! Perihelion passage flag real(DP), dimension(:), allocatable :: peri !! Perihelion distance @@ -249,28 +226,27 @@ module swiftest_classes !! 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_tp and util_spill_tp contains - private ! Test particle-specific concrete methods ! These are concrete because they are the same implemenation for all integrators - procedure, public :: discard => discard_tp !! Check to see if test particles should be discarded based on their positions relative to the massive bodies - procedure, public :: accel_int => kick_getacch_int_tp !! Compute direct cross (third) term heliocentric accelerations of test particles by massive bodies - procedure, public :: accel_obl => obl_acc_tp !! Compute the barycentric accelerations of bodies due to the oblateness of the central body - procedure, public :: setup => setup_tp !! A base constructor that sets the number of bodies and - procedure, public :: h2b => util_coord_h2b_tp !! Convert test particles from heliocentric to barycentric coordinates (position and velocity) - procedure, public :: b2h => util_coord_b2h_tp !! Convert test particles from barycentric to heliocentric coordinates (position and velocity) - procedure, public :: fill => util_fill_tp !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) - procedure, public :: get_peri => util_peri_tp !! Determine system pericenter passages for test particles - procedure, public :: set_mu => util_set_mu_tp !! Method used to construct the vectorized form of the central body mass - procedure, public :: sort => util_sort_tp !! Sorts body arrays by a sortable component - procedure, public :: rearrange => util_sort_rearrange_tp !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods - procedure, public :: spill => util_spill_tp !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) + procedure :: discard => discard_tp !! Check to see if test particles should be discarded based on their positions relative to the massive bodies + procedure :: accel_int => kick_getacch_int_tp !! Compute direct cross (third) term heliocentric accelerations of test particles by massive bodies + procedure :: accel_obl => obl_acc_tp !! Compute the barycentric accelerations of bodies due to the oblateness of the central body + procedure :: setup => setup_tp !! A base constructor that sets the number of bodies and + procedure :: h2b => util_coord_h2b_tp !! Convert test particles from heliocentric to barycentric coordinates (position and velocity) + procedure :: b2h => util_coord_b2h_tp !! Convert test particles from barycentric to heliocentric coordinates (position and velocity) + procedure :: fill => util_fill_tp !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) + procedure :: get_peri => util_peri_tp !! Determine system pericenter passages for test particles + procedure :: set_mu => util_set_mu_tp !! Method used to construct the vectorized form of the central body mass + procedure :: sort => util_sort_tp !! Sorts body arrays by a sortable component + procedure :: rearrange => util_sort_rearrange_tp !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods + procedure :: spill => util_spill_tp !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) end type swiftest_tp !******************************************************************************************************************************** ! swiftest_nbody_system class definitions and methods !******************************************************************************************************************************** !> An abstract class for a basic Swiftest nbody system - type, abstract, public, extends(swiftest_base) :: swiftest_nbody_system + type, abstract, extends(swiftest_base) :: swiftest_nbody_system !! This superclass contains a minimial system of a set of test particles (tp), massive bodies (pl), and a central body (cb) class(swiftest_cb), allocatable :: cb !! Central body data structure class(swiftest_pl), allocatable :: pl !! Massive body data structure @@ -289,19 +265,18 @@ module swiftest_classes !! separately from massive bodies. Massive body variables are saved at half steps, and passed to !! the test particles contains - private !> Each integrator will have its own version of the step - procedure(abstract_step_system), public, deferred :: step + procedure(abstract_step_system), deferred :: step ! Concrete classes that are common to the basic integrator (only test particles considered for discard) - procedure, public :: discard => discard_system !! Perform a discard step on the system - procedure, public :: dump => io_dump_system !! Dump the state of the system to a file - procedure, public :: read_frame => io_read_frame_system !! Append a frame of output data to file - procedure, public :: write_discard => io_write_discard !! Append a frame of output data to file - procedure, public :: write_frame => io_write_frame_system !! Append a frame of output data to file - procedure, public :: initialize => setup_initialize_system !! Initialize the system from input files - procedure, public :: step_spin => tides_step_spin_system !! Steps the spins of the massive & central bodies due to tides. - procedure, public :: set_msys => util_set_msys !! Sets the value of msys from the masses of system bodies. + procedure :: discard => discard_system !! Perform a discard step on the system + procedure :: dump => io_dump_system !! Dump the state of the system to a file + procedure :: read_frame => io_read_frame_system !! Append a frame of output data to file + procedure :: write_discard => io_write_discard !! Append a frame of output data to file + procedure :: write_frame => io_write_frame_system !! Append a frame of output data to file + procedure :: initialize => setup_initialize_system !! Initialize the system from input files + procedure :: step_spin => tides_step_spin_system !! Steps the spins of the massive & central bodies due to tides. + procedure :: set_msys => util_set_msys !! Sets the value of msys from the masses of system bodies. end type swiftest_nbody_system abstract interface diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index 3fe5a1824..fc3520079 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -8,6 +8,7 @@ module symba_classes use helio_classes, only : helio_cb, helio_pl, helio_tp, helio_nbody_system use rmvs_classes, only : rmvs_chk_ind implicit none + public integer(I4B), private, parameter :: NENMAX = 32767 integer(I4B), private, parameter :: NTENC = 3 @@ -16,28 +17,26 @@ module symba_classes character(*), parameter :: PARTICLE_OUTFILE = 'particle.dat' integer(I4B), parameter :: PARTICLEUNIT = 44 !! File unit number for the binary particle info output file - type, public, extends(swiftest_parameters) :: symba_parameters + type, extends(swiftest_parameters) :: symba_parameters character(STRMAX) :: particle_file = PARTICLE_OUTFILE !! Name of output particle information file real(DP) :: MTINY = -1.0_DP !! Smallest mass that is fully gravitating integer(I4B), dimension(:), allocatable :: seed !! Random seeds logical :: lfragmentation = .false. !! Do fragmentation modeling instead of simple merger. contains - private - procedure, public :: reader => symba_io_param_reader - procedure, public :: writer => symba_io_param_writer + procedure :: reader => symba_io_param_reader + procedure :: writer => symba_io_param_writer end type symba_parameters !******************************************************************************************************************************** ! symba_cb class definitions and method interfaces !******************************************************************************************************************************* !> SyMBA central body particle class - type, public, extends(helio_cb) :: symba_cb + type, extends(helio_cb) :: symba_cb real(DP) :: M0 = 0.0_DP !! Initial mass of the central body real(DP) :: dM = 0.0_DP !! Change in mass of the central body real(DP) :: R0 = 0.0_DP !! Initial radius of the central body real(DP) :: dR = 0.0_DP !! Change in the radius of the central body contains - private end type symba_cb !******************************************************************************************************************************** @@ -45,17 +44,16 @@ module symba_classes !******************************************************************************************************************************* !> Class definition for the particle origin information object. This object is used to track time, location, and collisional regime !> of fragments produced in collisional events. - type, public, extends(swiftest_base) :: symba_particle_info + type, extends(swiftest_base) :: symba_particle_info character(len=32) :: origin_type !! String containing a description of the origin of the particle (e.g. Initial Conditions, Supercatastrophic, Disruption, etc.) real(DP) :: origin_time !! The time of the particle's formation real(DP), dimension(NDIM) :: origin_xh !! The heliocentric distance vector at the time of the particle's formation real(DP), dimension(NDIM) :: origin_vh !! The heliocentric velocity vector at the time of the particle's formation contains - private - procedure, public :: dump => symba_io_dump_particle_info !! I/O routine for dumping particle info to file - procedure, public :: initialize => symba_io_initialize_particle_info !! I/O routine for reading in particle info data - procedure, public :: read_frame => symba_io_read_frame_info !! I/O routine for reading in a single frame of particle info - procedure, public :: write_frame => symba_io_write_frame_info !! I/O routine for writing out a single frame of particle info + procedure :: dump => symba_io_dump_particle_info !! I/O routine for dumping particle info to file + procedure :: initialize => symba_io_initialize_particle_info !! I/O routine for reading in particle info data + procedure :: read_frame => symba_io_read_frame_info !! I/O routine for reading in a single frame of particle info + procedure :: write_frame => symba_io_write_frame_info !! I/O routine for writing out a single frame of particle info end type symba_particle_info !******************************************************************************************************************************** @@ -72,7 +70,7 @@ module symba_classes ! symba_pl class definitions and method interfaces !******************************************************************************************************************************* !> SyMBA massive body class - type, public, extends(helio_pl) :: symba_pl + type, extends(helio_pl) :: symba_pl logical, dimension(:), allocatable :: lcollision !! flag indicating whether body has merged with another this time step 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 @@ -88,37 +86,35 @@ module symba_classes type(symba_kinship), dimension(:), allocatable :: kin !! Array of merger relationship structures that can account for multiple pairwise mergers in a single step type(symba_particle_info), dimension(:), allocatable :: info contains - private - procedure, public :: discard => symba_discard_pl !! Process massive body discards - procedure, public :: encounter_check => symba_encounter_check_pl !! Checks if massive bodies are going through close encounters with each other - procedure, public :: accel => symba_kick_getacch_pl !! Compute heliocentric accelerations of massive bodies - procedure, public :: setup => symba_setup_pl !! Constructor method - Allocates space for number of particle - procedure, public :: sort => symba_util_sort_pl !! Sorts body arrays by a sortable componen - procedure, public :: rearrange => symba_util_sort_rearrange_pl !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods + procedure :: discard => symba_discard_pl !! Process massive body discards + procedure :: encounter_check => symba_encounter_check_pl !! Checks if massive bodies are going through close encounters with each other + procedure :: accel => symba_kick_getacch_pl !! Compute heliocentric accelerations of massive bodies + procedure :: setup => symba_setup_pl !! Constructor method - Allocates space for number of particle + procedure :: sort => symba_util_sort_pl !! Sorts body arrays by a sortable componen + procedure :: rearrange => symba_util_sort_rearrange_pl !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods end type symba_pl !******************************************************************************************************************************** ! symba_tp class definitions and method interfaces !******************************************************************************************************************************* !> SyMBA test particle class - type, public, extends(helio_tp) :: symba_tp + type, extends(helio_tp) :: symba_tp integer(I4B), dimension(:), allocatable :: nplenc !! number of encounters with planets this time step integer(I4B), dimension(:), allocatable :: levelg !! level at which this particle should be moved integer(I4B), dimension(:), allocatable :: levelm !! deepest encounter level achieved this time step contains - private - procedure, public :: encounter_check => symba_encounter_check_tp !! Checks if any test particles are undergoing a close encounter with a massive body - procedure, public :: accel => symba_kick_getacch_tp !! Compute heliocentric accelerations of test particles - procedure, public :: setup => symba_setup_tp !! Constructor method - Allocates space for number of particle - procedure, public :: sort => symba_util_sort_tp !! Sorts body arrays by a sortable componen - procedure, public :: rearrange => symba_util_sort_rearrange_tp !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods + procedure :: encounter_check => symba_encounter_check_tp !! Checks if any test particles are undergoing a close encounter with a massive body + procedure :: accel => symba_kick_getacch_tp !! Compute heliocentric accelerations of test particles + procedure :: setup => symba_setup_tp !! Constructor method - Allocates space for number of particle + procedure :: sort => symba_util_sort_tp !! Sorts body arrays by a sortable componen + procedure :: rearrange => symba_util_sort_rearrange_tp !! Rearranges the order of array elements of body based on an input index array. Used in sorting methods end type symba_tp !******************************************************************************************************************************** ! symba_pltpenc class definitions and method interfaces !******************************************************************************************************************************* !> SyMBA class for tracking pl-tp close encounters in a step - type, public :: symba_pltpenc + type :: symba_pltpenc integer(I4B) :: nenc !! Total number of encounters logical, dimension(:), allocatable :: lvdotr !! relative vdotr flag integer(I4B), dimension(:), allocatable :: status !! status of the interaction @@ -126,49 +122,47 @@ module symba_classes integer(I4B), dimension(:), allocatable :: index1 !! position of the planet in encounter integer(I4B), dimension(:), allocatable :: index2 !! position of the test particle in encounter contains - procedure, public :: collision_check => symba_collision_check_pltpenc !! Checks if a test particle is going to collide with a massive body - procedure, public :: encounter_check => symba_encounter_check_pltpenc !! Checks if massive bodies are going through close encounters with each other - procedure, public :: kick => symba_kick_pltpenc !! Kick barycentric velocities of active test particles within SyMBA recursion - procedure, public :: setup => symba_setup_pltpenc !! A constructor that sets the number of encounters and allocates and initializes all arrays - procedure, public :: copy => symba_util_copy_pltpenc !! Copies all elements of one pltpenc list to another - procedure, public :: resize => symba_util_resize_pltpenc !! Checks the current size of the pltpenc_list against the required size and extends it by a factor of 2 more than requested if it is too small + procedure :: collision_check => symba_collision_check_pltpenc !! Checks if a test particle is going to collide with a massive body + procedure :: encounter_check => symba_encounter_check_pltpenc !! Checks if massive bodies are going through close encounters with each other + procedure :: kick => symba_kick_pltpenc !! Kick barycentric velocities of active test particles within SyMBA recursion + procedure :: setup => symba_setup_pltpenc !! A constructor that sets the number of encounters and allocates and initializes all arrays + procedure :: copy => symba_util_copy_pltpenc !! Copies all elements of one pltpenc list to another + procedure :: resize => symba_util_resize_pltpenc !! Checks the current size of the pltpenc_list against the required size and extends it by a factor of 2 more than requested if it is too small end type symba_pltpenc !******************************************************************************************************************************** ! symba_plplenc class definitions and method interfaces !******************************************************************************************************************************* !> SyMBA class for tracking pl-pl close encounters in a step - type, public, extends(symba_pltpenc) :: symba_plplenc + type, extends(symba_pltpenc) :: symba_plplenc real(DP), dimension(:,:), allocatable :: xh1 !! the heliocentric position of parent 1 in encounter real(DP), dimension(:,:), allocatable :: xh2 !! the heliocentric position of parent 2 in encounter real(DP), dimension(:,:), allocatable :: vb1 !! the barycentric velocity of parent 1 in encounter real(DP), dimension(:,:), allocatable :: vb2 !! the barycentric velocity of parent 2 in encounter contains - procedure, public :: collision_check => symba_collision_check_plplenc !! Checks if two massive bodies are going to collide - procedure, public :: setup => symba_setup_plplenc !! A constructor that sets the number of encounters and allocates and initializes all arrays - procedure, public :: copy => symba_util_copy_plplenc !! Copies all elements of one plplenc list to another + procedure :: collision_check => symba_collision_check_plplenc !! Checks if two massive bodies are going to collide + procedure :: setup => symba_setup_plplenc !! A constructor that sets the number of encounters and allocates and initializes all arrays + procedure :: copy => symba_util_copy_plplenc !! Copies all elements of one plplenc list to another end type symba_plplenc !******************************************************************************************************************************** ! symba_nbody_system class definitions and method interfaces !******************************************************************************************************************************** - type, public, extends(helio_nbody_system) :: symba_nbody_system + type, extends(helio_nbody_system) :: symba_nbody_system class(symba_pl), allocatable :: mergeadd_list !! List of added bodies in mergers or collisions class(symba_pl), allocatable :: mergesub_list !! List of subtracted bodies in mergers or collisions class(symba_pltpenc), allocatable :: pltpenc_list !! List of massive body-test particle encounters in a single step class(symba_plplenc), allocatable :: plplenc_list !! List of massive body-massive body encounters in a single step class(symba_pl), allocatable :: pl_discards !! Discarded test particle data structure contains - private - 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 - procedure, public :: reset => symba_step_reset_system !! Resets pl, tp,and encounter structures at the start of a new step + procedure :: initialize => symba_setup_initialize_system !! Performs SyMBA-specific initilization steps + procedure :: step => symba_step_system !! Advance the SyMBA nbody system forward in time by one step + procedure :: interp => symba_step_interp_system !! Perform an interpolation step on the SymBA nbody system + procedure :: 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 + procedure :: reset => symba_step_reset_system !! Resets pl, tp,and encounter structures at the start of a new step end type symba_nbody_system interface - module subroutine symba_collision_check_pltpenc(self, system, param, t, dt, irec) implicit none class(symba_pltpenc), intent(inout) :: self !! SyMBA pl-tp encounter list object diff --git a/src/modules/whm_classes.f90 b/src/modules/whm_classes.f90 index a61cefb78..a6ab59958 100644 --- a/src/modules/whm_classes.f90 +++ b/src/modules/whm_classes.f90 @@ -12,7 +12,7 @@ module whm_classes ! whm_cb class definitions and method interfaces !******************************************************************************************************************************* !> Swiftest central body particle class - type, public, extends(swiftest_cb) :: whm_cb + type, extends(swiftest_cb) :: whm_cb contains end type whm_cb @@ -21,7 +21,7 @@ module whm_classes !******************************************************************************************************************************* !> WHM massive body particle class - type, public, extends(swiftest_pl) :: whm_pl + type, extends(swiftest_pl) :: whm_pl real(DP), dimension(:), allocatable :: eta !! Jacobi mass real(DP), dimension(:,:), allocatable :: xj !! Jacobi position real(DP), dimension(:,:), allocatable :: vj !! Jacobi velocity @@ -30,20 +30,20 @@ module whm_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 whm_setup_pl and whm_util_spill_pl contains - procedure, public :: h2j => whm_coord_h2j_pl !! Convert position and velcoity vectors from heliocentric to Jacobi coordinates - procedure, public :: j2h => whm_coord_j2h_pl !! Convert position and velcoity vectors from Jacobi to helliocentric coordinates - procedure, public :: vh2vj => whm_coord_vh2vj_pl !! Convert velocity vectors from heliocentric to Jacobi coordinates - procedure, public :: drift => whm_drift_pl !! Loop through massive bodies and call Danby drift routine to jacobi coordinates - procedure, public :: fill => whm_util_fill_pl !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) - procedure, public :: accel => whm_kick_getacch_pl !! Compute heliocentric accelerations of massive bodies - procedure, public :: kick => whm_kick_vh_pl !! Kick heliocentric velocities of massive bodies - procedure, public :: accel_gr => whm_gr_kick_getacch_pl !! Acceleration term arising from the post-Newtonian correction - 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_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) + procedure :: h2j => whm_coord_h2j_pl !! Convert position and velcoity vectors from heliocentric to Jacobi coordinates + procedure :: j2h => whm_coord_j2h_pl !! Convert position and velcoity vectors from Jacobi to helliocentric coordinates + procedure :: vh2vj => whm_coord_vh2vj_pl !! Convert velocity vectors from heliocentric to Jacobi coordinates + procedure :: drift => whm_drift_pl !! Loop through massive bodies and call Danby drift routine to jacobi coordinates + procedure :: fill => whm_util_fill_pl !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) + procedure :: accel => whm_kick_getacch_pl !! Compute heliocentric accelerations of massive bodies + procedure :: kick => whm_kick_vh_pl !! Kick heliocentric velocities of massive bodies + procedure :: accel_gr => whm_gr_kick_getacch_pl !! Acceleration term arising from the post-Newtonian correction + procedure :: gr_pos_kick => whm_gr_p4_pl !! Position kick due to p**4 term in the post-Newtonian correction + procedure :: setup => whm_setup_pl !! Constructor method - Allocates space for number of particles + procedure :: set_mu => whm_util_set_mu_eta_pl !! Sets the Jacobi mass value for all massive bodies. + procedure :: set_ir3 => whm_util_set_ir3j !! Sets both the heliocentric and jacobi inverse radius terms (1/rj**3 and 1/rh**3) + procedure :: step => whm_step_pl !! Steps the body forward one stepsize + procedure :: 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 !******************************************************************************************************************************** @@ -51,29 +51,27 @@ module whm_classes !******************************************************************************************************************************* !! WHM test particle class - type, public, extends(swiftest_tp) :: whm_tp + type, extends(swiftest_tp) :: whm_tp !! Note to developers: If you add componenets to this class, be sure to update methods and subroutines that traverse the !! component list, such as whm_setup_tp and whm_util_spill_tp contains - private - procedure, public :: accel => whm_kick_getacch_tp !! Compute heliocentric accelerations of test particles - procedure, public :: kick => whm_kick_vh_tp !! Kick heliocentric velocities of test particles - procedure, public :: accel_gr => whm_gr_kick_getacch_tp !! Acceleration term arising from the post-Newtonian correction - procedure, public :: gr_pos_kick => whm_gr_p4_tp !! Position kick due to p**4 term in the post-Newtonian correction - procedure, public :: setup => whm_setup_tp !! Allocates new components of the whm class and recursively calls parent allocations - procedure, public :: step => whm_step_tp !! Steps the particle forward one stepsize + procedure :: accel => whm_kick_getacch_tp !! Compute heliocentric accelerations of test particles + procedure :: kick => whm_kick_vh_tp !! Kick heliocentric velocities of test particles + procedure :: accel_gr => whm_gr_kick_getacch_tp !! Acceleration term arising from the post-Newtonian correction + procedure :: gr_pos_kick => whm_gr_p4_tp !! Position kick due to p**4 term in the post-Newtonian correction + procedure :: setup => whm_setup_tp !! Allocates new components of the whm class and recursively calls parent allocations + procedure :: step => whm_step_tp !! Steps the particle forward one stepsize end type whm_tp !******************************************************************************************************************************** ! whm_nbody_system class definitions and method interfaces !******************************************************************************************************************************** !> An abstract class for the WHM integrator nbody system - type, public, extends(swiftest_nbody_system) :: whm_nbody_system + type, extends(swiftest_nbody_system) :: whm_nbody_system contains - private !> Replace the abstract procedures with concrete ones - 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 + procedure :: initialize => whm_setup_initialize_system !! Performs WHM-specific initilization steps, like calculating the Jacobi masses + procedure :: step => whm_step_system !! Advance the WHM nbody system forward in time by one step end type whm_nbody_system interface