rmvs Module

Definition of classes and methods specific to the Regularized Mixed Variable Symplectic (INT_RMVS) integrator Partially adapted from David E. Kaufmann’s Swifter module: module_rmvs.f90 RMVS test particle class


Uses

  • module~~rmvs~~UsesGraph module~rmvs rmvs module~whm whm module~rmvs->module~whm module~swiftest swiftest module~rmvs->module~swiftest module~whm->module~swiftest globals globals module~swiftest->globals module~encounter encounter module~swiftest->module~encounter module~collision collision module~swiftest->module~collision module~lambda_function lambda_function module~swiftest->module~lambda_function module~base base module~swiftest->module~base module~walltime walltime module~swiftest->module~walltime module~netcdf_io netcdf_io module~swiftest->module~netcdf_io module~operators operators module~swiftest->module~operators module~io_progress_bar io_progress_bar module~swiftest->module~io_progress_bar module~solver solver module~swiftest->module~solver module~encounter->globals module~encounter->module~base module~encounter->module~netcdf_io module~collision->globals module~collision->module~encounter module~collision->module~base module~lambda_function->globals module~base->globals module~coarray coarray module~base->module~coarray module~walltime->globals module~walltime->module~base module~netcdf_io->globals module~netcdf_io->module~base module~operators->globals module~io_progress_bar->globals module~io_progress_bar->module~base module~solver->globals module~solver->module~lambda_function module~solver->module~base ieee_exceptions ieee_exceptions module~solver->ieee_exceptions module~coarray->globals

Used by

  • module~~rmvs~~UsedByGraph module~rmvs rmvs module~s_swiftest_util s_swiftest_util module~s_swiftest_util->module~rmvs module~s_rmvs_step s_rmvs_step module~s_rmvs_step->module~rmvs module~s_rmvs_kick s_rmvs_kick module~s_rmvs_kick->module~rmvs module~s_rmvs_encounter_check s_rmvs_encounter_check module~s_rmvs_encounter_check->module~rmvs module~s_rmvs_discard s_rmvs_discard module~s_rmvs_discard->module~rmvs module~s_rmvs_util s_rmvs_util module~s_rmvs_util->module~rmvs

Contents


Interfaces

public interface coclone

  • public subroutine rmvs_coarray_coclone_tp(tp)

    Author
    David A. Minton

    Broadcasts the image 1 object to all other images in a coarray

    Arguments

    TypeIntentOptionalAttributesName
    type(rmvs_tp), intent(inout), codimension[*]:: tp

    RMVS pl object

public interface cocollect

  • public subroutine rmvs_coarray_cocollect_tp(tp)

    Author
    David A. Minton

    Broadcasts the image 1 object to all other images in a coarray

    Arguments

    TypeIntentOptionalAttributesName
    type(rmvs_tp), intent(inout), codimension[*]:: tp

    RMVS pl object

interface

  • public module module subroutine rmvs_discard_tp(self, nbody_system, param)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    class(swiftest_nbody_system), intent(inout) :: nbody_system

    Swiftest nbody system object

    class(swiftest_parameters), intent(inout) :: param

    Current run configuration parameters

interface

  • public module module function rmvs_encounter_check_tp(self, param, nbody_system, dt) result(lencounter)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    class(swiftest_parameters), intent(inout) :: param

    Current run configuration parameters

    class(rmvs_nbody_system), intent(inout) :: nbody_system

    RMVS nbody system object

    real(kind=DP), intent(in) :: dt

    step size

    Return Value logical

    Returns true if there is at least one close encounter

interface

  • public module module subroutine rmvs_kick_getacch_tp(self, nbody_system, param, t, lbeg)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle data structure

    class(swiftest_nbody_system), intent(inout) :: nbody_system

    Swiftest central body particle data structuree

    class(swiftest_parameters), intent(inout) :: param

    Current run configuration parameters

    real(kind=DP), intent(in) :: t

    Current time

    logical, intent(in) :: lbeg

    Logical flag that determines whether or not this is the beginning or end of the step

interface

  • public module module subroutine rmvs_step_system(self, param, t, dt)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_nbody_system), intent(inout) :: self

    RMVS nbody system object

    class(swiftest_parameters), intent(inout) :: param

    Current run configuration parameters

    real(kind=DP), intent(in) :: t

    Simulation time

    real(kind=DP), intent(in) :: dt

    Current stepsize

interface

  • public module module subroutine rmvs_util_append_pl(self, source, lsource_mask)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

    class(swiftest_body), intent(in) :: source

    Source object to append

    logical, intent(in), dimension(:):: lsource_mask

    Logical mask indicating which elements to append to

interface

  • public module module subroutine rmvs_util_append_tp(self, source, lsource_mask)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    class(swiftest_body), intent(in) :: source

    Source object to append

    logical, intent(in), dimension(:):: lsource_mask

    Logical mask indicating which elements to append to

interface

  • public module module subroutine rmvs_util_dealloc_cb(self)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_cb), intent(inout) :: self

    RMVS central body object

interface

  • public module module subroutine rmvs_util_dealloc_interp(self)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_interp), intent(inout) :: self

    RMVS interpolated nbody_system variables object

interface

  • public module module subroutine rmvs_util_dealloc_pl(self)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

interface

  • public module module subroutine rmvs_util_dealloc_system(self)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_nbody_system), intent(inout) :: self

interface

  • public module module subroutine rmvs_util_dealloc_tp(self)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

interface

  • public module module subroutine rmvs_util_fill_pl(self, inserts, lfill_list)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

    class(swiftest_body), intent(in) :: inserts

    Inserted object

    logical, intent(in), dimension(:):: lfill_list

    Logical array of bodies to merge into the keeps

interface

  • public module module subroutine rmvs_util_fill_tp(self, inserts, lfill_list)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS massive body object

    class(swiftest_body), intent(in) :: inserts

    Inserted object

    logical, intent(in), dimension(:):: lfill_list

    Logical array of bodies to merge into the keeps

interface

  • public module module subroutine rmvs_util_resize_pl(self, nnew)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

    integer(kind=I4B), intent(in) :: nnew

    New size neded

interface

  • public module module subroutine rmvs_util_resize_tp(self, nnew)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    integer(kind=I4B), intent(in) :: nnew

    New size neded

interface

  • public module module subroutine rmvs_util_setup_initialize_system(self, system_history, param)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_nbody_system), intent(inout) :: self

    RMVS system object

    class(swiftest_storage), intent(inout), allocatable:: system_history

    Stores the system history between output dumps

    class(swiftest_parameters), intent(inout) :: param

    Current run configuration parameters

interface

  • public module module subroutine rmvs_util_setup_pl(self, n, param)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

    integer(kind=I4B), intent(in) :: n

    Number of particles to allocate space for

    class(swiftest_parameters), intent(in) :: param

    Current run configuration parameters

interface

  • public module module subroutine rmvs_util_setup_tp(self, n, param)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    integer(kind=I4B), intent(in) :: n

    Number of particles to allocate space for

    class(swiftest_parameters), intent(in) :: param

    Current run configuration parametere

interface

  • public module module subroutine rmvs_util_sort_pl(self, sortby, ascending)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

    character, intent(in) :: sortby

    Sorting attribute

    logical, intent(in) :: ascending

    Logical flag indicating whether or not the sorting should be in ascending or descending order

interface

  • public module module subroutine rmvs_util_sort_rearrange_pl(self, ind)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

    integer(kind=I4B), intent(in), dimension(:):: ind

    Index array used to restructure the body (should contain all 1:n index values in the desired order)

interface

  • public module module subroutine rmvs_util_sort_rearrange_tp(self, ind)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    integer(kind=I4B), intent(in), dimension(:):: ind

    Index array used to restructure the body (should contain all 1:n index values in the desired order)

interface

  • public module module subroutine rmvs_util_sort_tp(self, sortby, ascending)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    character, intent(in) :: sortby

    Sorting attribute

    logical, intent(in) :: ascending

    Logical flag indicating whether or not the sorting should be in ascending or descending order

interface

  • public module module subroutine rmvs_util_spill_pl(self, discards, lspill_list, ldestructive)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_pl), intent(inout) :: self

    RMVS massive body object

    class(swiftest_body), intent(inout) :: discards

    Discarded object

    logical, intent(in), dimension(:):: lspill_list

    Logical array of bodies to spill into the discards

    logical, intent(in) :: ldestructive

    Logical flag indicating whether or not this operation should alter the keeps array or not

interface

  • public module module subroutine rmvs_util_spill_tp(self, discards, lspill_list, ldestructive)

    Arguments

    TypeIntentOptionalAttributesName
    class(rmvs_tp), intent(inout) :: self

    RMVS test particle object

    class(swiftest_body), intent(inout) :: discards

    Discarded object

    logical, intent(in), dimension(:):: lspill_list

    Logical array of bodies to spill into the discards

    logical, intent(in) :: ldestructive

    Logical flag indicating whether or not this operation should alter the keeps array or not


Derived Types

type, public, extends(whm_cb) :: rmvs_cb

RMVS central body particle class

Components

TypeVisibilityAttributesNameInitial
real(kind=DP), public :: GM0 =0.0_DP

Initial G*mass of the central body

real(kind=DP), public :: Gmass =0.0_DP

Central mass gravitational term G * mass (units GU * MU)

real(kind=DP), public, dimension(NDIM):: Ip =0.0_DP

Unitless principal moments of inertia (I1, I2, I3) / (MR**2). Principal axis rotation assumed.

real(kind=DP), public, dimension(NDIM):: L0 =0.0_DP

Initial angular momentum of the central body

real(kind=DP), public :: Q =0.0_DP

Tidal quality factor

real(kind=DP), public :: R0 =0.0_DP

Initial radius of the central body

real(kind=DP), public, dimension(NDIM):: agr =0.0_DP

Acceleration due to post-Newtonian correction

real(kind=DP), public, dimension(NDIM):: aobl =0.0_DP

Barycentric acceleration due to central body oblatenes

real(kind=DP), public, dimension(NDIM):: aoblbeg =0.0_DP

Barycentric acceleration due to central body oblatenes at beginning of step

real(kind=DP), public, dimension(NDIM):: aoblend =0.0_DP

Barycentric acceleration due to central body oblatenes at end of step

real(kind=DP), public, dimension(NDIM):: atide =0.0_DP

Barycentric acceleration due to central body oblatenes

real(kind=DP), public, dimension(NDIM):: atidebeg =0.0_DP

Barycentric acceleration due to central body oblatenes at beginning of step

real(kind=DP), public, dimension(NDIM):: atideend =0.0_DP

Barycentric acceleration due to central body oblatenes at end of step

real(kind=DP), public, dimension(:,:,:), allocatable:: c_lm

Spherical Harmonics coefficients for the central body

real(kind=DP), public :: dGM =0.0_DP

Change in G*mass of the central body

real(kind=DP), public, dimension(NDIM):: dL =0.0_DP

Change in angular momentum of the central body

real(kind=DP), public :: dR =0.0_DP

Change in the radius of the central body

real(kind=DP), public :: density =1.0_DP

Central body mass density - calculated internally (units MU / DU**3)

integer(kind=I4B), public :: id =0

External identifier (unique)

class(swiftest_particle_info), public, allocatable:: info

An abstract class for a generic central body in a Swiftest simulation Particle metadata information

type(rmvs_interp), public, dimension(:), allocatable:: inner

interpolated heliocentric central body position for inner encounters

real(kind=DP), public :: j2rp2 =0.0_DP

J2*R^2 term for central body

real(kind=DP), public :: j4rp4 =0.0_DP

J4*R^4 term for central body

real(kind=DP), public :: k2 =0.0_DP

Tidal Love number

logical, public :: lplanetocentric =.false.

Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations

real(kind=DP), public :: mass =0.0_DP

Central body mass (units MU)

type(rmvs_interp), public, dimension(:), allocatable:: outer

interpolated heliocentric central body position for outer encounters

real(kind=DP), public :: radius =0.0_DP

Central body radius (units DU)

real(kind=DP), public, dimension(NDIM):: rb =0.0_DP

Barycentric position (units DU)

real(kind=DP), public, dimension(NDIM):: rot =0.0_DP

Body rotation vector in inertial coordinate frame (units rad / TU)

real(kind=DP), public :: rotphase =0.0_DP

Body rotation phase about the rotation pole (0 to 1)

real(kind=DP), public :: tlag =0.0_DP

Tidal phase lag angle

real(kind=DP), public, dimension(NDIM):: vb =0.0_DP

Barycentric velocity (units DU / TU)

Finalizations Procedures

final :: rmvs_final_cb

Finalizes the RMVS central body object - deallocates all allocatables

Type-Bound Procedures

procedure, public :: dealloc => rmvs_util_dealloc_cb

Deallocates all allocatable arrays

procedure, public :: read_in => swiftest_io_read_in_cb

Read in central body initial conditions from an ASCII file

procedure, public :: rotphase_update => swiftest_drift_cb_rotphase_update

updates the central body rotation phase

procedure, public :: write_frame => swiftest_io_netcdf_write_frame_cb

I/O routine for writing out a single frame of time-series data for all bodies in the system in NetCDF format

procedure, public :: write_info => swiftest_io_netcdf_write_info_cb

Dump contents of particle information metadata to file

type, public :: rmvs_interp

Finalizations Procedures

final :: rmvs_final_interp

Finalizes the RMVS interpolated nbody_system variables object - deallocates all allocatables

Type-Bound Procedures

procedure, public :: dealloc => rmvs_util_dealloc_interp

Deallocates all allocatable arrays

type, public, extends(whm_nbody_system) :: rmvs_nbody_system

In the RMVS integrator, pl-tp encounters are handeled, but not pl-pl

Components

TypeVisibilityAttributesNameInitial
real(kind=DP), public :: E_collisions =0.0_DP

Energy lost from nbody_system due to collisions

real(kind=DP), public :: E_orbit_error =0.0_DP
real(kind=DP), public :: E_orbit_orig =0.0_DP

Initial orbital energy

real(kind=DP), public :: E_untracked =0.0_DP

Energy gained from nbody_system due to escaped bodies

real(kind=DP), public :: E_untracked_error =0.0_DP
real(kind=DP), public :: Ecoll_error =0.0_DP
real(kind=DP), public :: GMescape =0.0_DP

Mass of bodies that escaped the nbody_system (used for bookeeping)

real(kind=DP), public :: GMtot =0.0_DP

Total nbody_system mass - used for barycentric coordinate conversion

real(kind=DP), public :: GMtot_orig =0.0_DP

Initial nbody_system mass

real(kind=DP), public, dimension(NDIM):: L_escape =0.0_DP

Angular momentum of bodies that escaped the nbody_system (used for bookeeping)

real(kind=DP), public :: L_escape_error =0.0_DP
real(kind=DP), public, dimension(NDIM):: L_orbit =0.0_DP

nbody_system orbital angular momentum vector

real(kind=DP), public :: L_orbit_error =0.0_DP
real(kind=DP), public, dimension(NDIM):: L_orbit_orig =0.0_DP

Initial orbital angular momentum

real(kind=DP), public, dimension(NDIM):: L_rot =0.0_DP

nbody_system rotational angular momentum vector

real(kind=DP), public :: L_rot_error =0.0_DP
real(kind=DP), public, dimension(NDIM):: L_rot_orig =0.0_DP

Initial rotational angular momentum vector

real(kind=DP), public, dimension(NDIM):: L_total =0.0_DP

nbody_system angular momentum vector

real(kind=DP), public :: L_total_error =0.0_DP
real(kind=DP), public, dimension(NDIM):: L_total_orig =0.0_DP

Initial total angular momentum vector

real(kind=DP), public :: Mescape_error =0.0_DP
real(kind=DP), public :: Mtot_error =0.0_DP
real(kind=DP), public :: be =0.0_DP

nbody_system binding energy of all bodies

real(kind=DP), public :: be_cb =0.0_DP

Binding energy of central body (usually orders of magnitude larger than the rest of the system, and therefore tracked seperately)

real(kind=DP), public :: be_error =0.0_DP
real(kind=DP), public :: be_orig =0.0_DP

Initial gravitational binding energy

class(swiftest_cb), public, allocatable:: cb

Central body data structure

class(collision_basic), public, allocatable:: collider

Collision system object

class(collision_storage), public, allocatable:: collision_history

Stores encounter history for later retrieval and saving to file

class(encounter_storage), public, allocatable:: encounter_history

Stores encounter history for later retrieval and saving to file

real(kind=DP), public :: ke_orbit =0.0_DP

nbody_system orbital kinetic energy

real(kind=DP), public :: ke_orbit_error =0.0_DP
real(kind=DP), public :: ke_orbit_orig =0.0_DP

Initial orbital kinetic energy

real(kind=DP), public :: ke_rot =0.0_DP

nbody_system rotational kinetic energy

real(kind=DP), public :: ke_rot_error =0.0_DP
real(kind=DP), public :: ke_rot_orig =0.0_DP

Initial rotational kinetic energy

logical, public :: lbeg

True if this is the beginning of a step. This is used so that test particle steps can be calculated separately from massive bodies. Massive body variables are saved at half steps, and passed to the test particles

logical, public :: lfirst_io =.true.

Flag to indicate that this is the first time to write to a file

logical, public :: lfirst_peri =.true.

Flag to indicate that this is the first pericenter passage

logical, public :: lplanetocentric =.false.

Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations

integer(kind=I4B), public :: maxid =-1

The current maximum particle id number

real(kind=DP), public :: oblpot =0.0_DP

nbody_system potential energy due to oblateness of the central body

real(kind=DP), public :: pe =0.0_DP

nbody_system potential energy

real(kind=DP), public :: pe_error =0.0_DP
real(kind=DP), public :: pe_orig =0.0_DP

Initial potential energy

class(swiftest_pl), public, allocatable:: pl

Massive body data structure

class(swiftest_pl), public, allocatable:: pl_adds

List of added bodies in mergers or collisions

class(swiftest_pl), public, allocatable:: pl_discards

Discarded massive body particle data structure

class(collision_list_plpl), public, allocatable:: plpl_collision

List of massive body-massive body collisions in a single step

class(encounter_list), public, allocatable:: plpl_encounter

List of massive body-massive body encounters in a single step

class(collision_list_pltp), public, allocatable:: pltp_collision

List of massive body-test particle collisions in a single step

class(encounter_list), public, allocatable:: pltp_encounter

List of massive body-test particle encounters in a single step

real(kind=DP), public :: rts

fraction of Hill’s sphere radius to use as radius of encounter region

real(kind=DP), public :: t =-1.0_DP

Integration current time

real(kind=DP), public :: te =0.0_DP

nbody_system total energy

real(kind=DP), public :: te_error =0.0_DP
real(kind=DP), public :: te_orig =0.0_DP

Initial total energy (sum of all sources of energy tracked)

class(swiftest_tp), public, allocatable:: tp

Test particle data structure

class(swiftest_tp), public, allocatable:: tp_adds

List of added bodies in mergers or collisions

class(swiftest_tp), public, allocatable:: tp_discards

Discarded test particle data structure

real(kind=DP), public, dimension(:,:), allocatable:: vbeg

Planet velocities at beginning ot step

Type-Bound Procedures

procedure, public :: coarray_balance => swiftest_coarray_balance_system

Checks whether or not the test particle coarrays need to be rebalanced.

procedure, public :: coarray_collect => swiftest_coarray_collect_system

Collects all the test particles from other images into the image #1 test particle system

procedure, public :: coarray_distribute => swiftest_coarray_distribute_system

Distributes test particles from image #1 out to all images.

procedure, public :: compact_output => swiftest_io_compact_output

Prints out out terminal output when display_style is set to COMPACT

procedure, public :: conservation_report => swiftest_io_conservation_report

Compute energy and momentum and print out the change with time

procedure, public :: dealloc => rmvs_util_dealloc_system

Replace the abstract procedures with concrete ones Performs RMVS-specific deallocation

procedure, public :: discard => swiftest_discard_system

Perform a discard step on the nbody_system

procedure, public :: display_run_information => swiftest_io_display_run_information

Displays helpful information about the run

procedure, public :: dump => swiftest_io_dump_system

Dump the state of the nbody_system to a file

procedure, public :: get_energy_and_momentum => swiftest_util_get_energy_and_momentum_system

Calculates the total nbody_system energy and momentum

procedure, public :: get_idvals => swiftest_util_get_idvalues_system

Returns an array of all id values in use in the nbody_system

procedure, public :: get_t0_values => swiftest_io_netcdf_get_t0_values_system

Validates the dump file to check whether the dump file initial conditions duplicate the last frame of the netcdf output.

procedure, public :: init_particle_info => swiftest_util_setup_initialize_particle_info_system

Initialize the nbody_system from input files

Read more…
procedure, public :: initialize => rmvs_util_setup_initialize_system

Performs RMVS-specific initilization steps, including generating the close encounter planetocentric structures

procedure, public :: initialize_output_file => swiftest_io_initialize_output_file_system

Write a frame of input data from file

procedure, public :: obl_pot => swiftest_obl_pot_system

Compute the contribution to the total gravitational potential due solely to the oblateness of the central body

procedure, public :: read_frame => swiftest_io_netcdf_read_frame_system

Read in a frame of input data from file

procedure, public :: read_hdr => swiftest_io_netcdf_read_hdr_system

Read a header for an output frame in NetCDF format

procedure, public :: read_in => swiftest_io_read_in_system

Reads the initial conditions for an nbody system

procedure, public :: read_particle_info => swiftest_io_netcdf_read_particle_info_system

Read in particle metadata from file

procedure, public :: rescale => swiftest_util_rescale_system

Rescales the nbody_system into a new set of units

procedure, public :: set_msys => swiftest_util_set_msys

Sets the value of msys from the masses of nbody_system bodies.

procedure, public :: step => rmvs_step_system

Advance the RMVS nbody system forward in time by one step

procedure, public :: validate_ids => swiftest_util_valid_id_system

Validate the numerical ids passed to the nbody_system and save the maximum value

procedure, public :: write_frame => swiftest_io_netcdf_write_frame_system

Write a frame of input data from file

procedure, public :: write_hdr => swiftest_io_netcdf_write_hdr_system

Write a header for an output frame in NetCDF format

type, public, extends(whm_pl) :: rmvs_pl

RMVS massive body particle class

Components

TypeVisibilityAttributesNameInitial
real(kind=DP), public, dimension(:), allocatable:: Gmass

Mass gravitational term G * mass (units GU * MU)

real(kind=DP), public, dimension(:,:), allocatable:: Ip

Unitless principal moments of inertia (I1, I2, I3) / (MR**2). Principal axis rotation assumed.

real(kind=DP), public, dimension(:), allocatable:: Q

Tidal quality factor

real(kind=DP), public, dimension(:), allocatable:: a

Semimajor axis (pericentric distance for a parabolic orbit)

real(kind=DP), public, dimension(:,:), allocatable:: agr

Acceleration due to post-Newtonian correction

real(kind=DP), public, dimension(:,:), allocatable:: ah

Total heliocentric acceleration

real(kind=DP), public, dimension(:,:), allocatable:: aobl

Barycentric accelerations of bodies due to central body oblatenes

real(kind=DP), public, dimension(:,:), allocatable:: atide

Tanngential component of acceleration of bodies due to tides

real(kind=DP), public, dimension(:), allocatable:: atp

semimajor axis following perihelion passage

real(kind=DP), public, dimension(:), allocatable:: capm

Mean anomaly

real(kind=DP), public, dimension(:), allocatable:: capom

Longitude of ascending node

real(kind=DP), public, dimension(:), allocatable:: density

Body mass density - calculated internally (units MU / DU**3)

real(kind=DP), public, dimension(:), allocatable:: e

Eccentricity

real(kind=DP), public, dimension(:), allocatable:: eta

Jacobi mass

integer(kind=I4B), public, dimension(:), allocatable:: id

Identifier

real(kind=DP), public, dimension(:), allocatable:: inc

Inclination

type(swiftest_particle_info), public, dimension(:), allocatable:: info

Particle metadata information

type(rmvs_interp), public, dimension(:), allocatable:: inner

interpolated heliocentric central body position for inner encounters

real(kind=DP), public, dimension(:), allocatable:: ir3h

Inverse heliocentric radius term (1/rh**3)

real(kind=DP), public, dimension(:), allocatable:: ir3j

Third term of heliocentric acceleration

integer(kind=I4B), public, dimension(:), allocatable:: isperi

perihelion passage flag

real(kind=DP), public, dimension(:), allocatable:: k2

Tidal Love number

integer(kind=I4B), public, dimension(:,:), allocatable:: k_plpl

Index array used to convert flattened the body-body comparison upper triangular matrix

type(swiftest_kinship), public, dimension(:), allocatable:: kin

Array of merger relationship structures that can account for multiple pairwise mergers in a single step

logical, public, dimension(:), allocatable:: lcollision

flag indicating whether body has merged with another this time step

logical, public, dimension(:), allocatable:: ldiscard

Body should be discarded

logical, public, dimension(:), allocatable:: lencounter

flag indicating whether body is part of an encounter this time step

logical, public :: lfirst =.true.

Run the current step as a first

logical, public, dimension(:), allocatable:: lmask

Logical mask used to select a subset of bodies when performing certain operations (drift, kick, accel, etc.)

logical, public, dimension(:), allocatable:: lmtiny

flag indicating whether this body is below the GMTINY cutoff value

logical, public :: lplanetocentric =.false.

Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations

real(kind=DP), public, dimension(:), allocatable:: mass

Body mass (units MU)

real(kind=DP), public, dimension(:), allocatable:: mu

G * (Mcb + [m])

real(kind=DP), public, dimension(:), allocatable:: muj

Jacobi mu: GMcb * eta(i) / eta(i - 1)

integer(kind=I4B), public :: nbody =0

Number of bodies

integer(kind=I4B), public, dimension(:), allocatable:: nenc

number of test particles encountering planet this full rmvs time step

integer(kind=I4B), public, dimension(:), allocatable:: nplenc

number of encounters with other planets this time step

integer(kind=I4B), public :: nplm =0

number of bodies above the GMTINY limit

integer(kind=I8B), public :: nplpl

Number of body-body comparisons in the flattened upper triangular matrix

integer(kind=I8B), public :: nplplm

Number of body (all massive)-body (only those above GMTINY) comparisons in the flattened upper triangular matrix

integer(kind=I4B), public, dimension(:), allocatable:: ntpenc

number of encounters with test particles this time step

real(kind=DP), public, dimension(:), allocatable:: omega

Argument of pericenter

type(rmvs_interp), public, dimension(:), allocatable:: outer

interpolated heliocentric central body position for outer encounters

real(kind=DP), public, dimension(:), allocatable:: peri

perihelion distance

class(rmvs_nbody_system), public, dimension(:), allocatable:: planetocentric

Planetocentric version of the massive body objects (one for each massive body)

integer(kind=I4B), public, dimension(:), allocatable:: plind

Connects the planetocentric indices back to the heliocentric planet list

real(kind=DP), public, dimension(:), allocatable:: radius

Body radius (units DU)

real(kind=DP), public, dimension(:,:), allocatable:: rb

Barycentric position

real(kind=DP), public, dimension(:,:), allocatable:: rbeg

Position at beginning of step

real(kind=DP), public, dimension(:), allocatable:: renc

Critical radius for close encounters

real(kind=DP), public, dimension(:,:), allocatable:: rend

Position at end of step

real(kind=DP), public, dimension(:,:), allocatable:: rh

Heliocentric position

real(kind=DP), public, dimension(:), allocatable:: rhill

Body mass (units MU)

real(kind=DP), public, dimension(:,:), allocatable:: rot

Body rotation vector in inertial coordinate frame (units rad / TU)

integer(kind=I4B), public, dimension(:), allocatable:: status

An integrator-specific status indicator

real(kind=DP), public, dimension(:), allocatable:: tlag

Tidal phase lag

integer(kind=I4B), public, dimension(:), allocatable:: tpenc1P

index of first test particle encountering planet

real(kind=DP), public, dimension(:,:), allocatable:: vb

Barycentric velocity

real(kind=DP), public, dimension(:,:), allocatable:: vbeg

Velocity at beginning of step

real(kind=DP), public, dimension(:,:), allocatable:: vh

Heliocentric velocity

real(kind=DP), public, dimension(:,:), allocatable:: vj

Jacobi velocity

real(kind=DP), public, dimension(:,:), allocatable:: xj

Jacobi position

Finalizations Procedures

final :: rmvs_final_pl

Finalizes the RMVS massive body object - deallocates all allocatables

Type-Bound Procedures

procedure, public :: accel => whm_kick_getacch_pl

Compute heliocentric accelerations of massive bodies

procedure, public :: accel_gr => whm_gr_kick_getacch_pl

Acceleration term arising from the post-Newtonian correction

procedure, public :: accel_int => swiftest_kick_getacch_int_pl

Compute direct cross (third) term heliocentric accelerations of massive bodies

procedure, public :: accel_non_spherical_cb => swiftest_non_spherical_cb_acc_pl

Compute the barycentric accelerations of bodies due to the oblateness of the central body

procedure, public :: accel_user => swiftest_user_kick_getacch_body

Add user-supplied heliocentric accelerations to planets

procedure, public :: append => rmvs_util_append_pl

Appends elements from one structure to another

procedure, public :: b2h => swiftest_util_coord_b2h_pl

Convert massive bodies from barycentric to heliocentric coordinates (position and velocity)

procedure, public :: dealloc => rmvs_util_dealloc_pl

Deallocates all allocatable arrays

procedure, public :: discard => swiftest_discard_pl

Placeholder method for discarding massive bodies

procedure, public :: drift => whm_drift_pl

Loop through massive bodies and call Danby drift routine to jacobi coordinates

procedure, public :: el2xv => swiftest_orbel_el2xv_vec

Convert orbital elements to position and velocity vectors

procedure, public :: fill => rmvs_util_fill_pl

“Fills” bodies from one object into another depending on the results of a mask (uses the UNPACK intrinsic)

procedure, public :: flatten => swiftest_util_flatten_eucl_plpl

Sets up the (i, j) -> k indexing used for the single-loop blocking Euclidean distance matrix

procedure, public :: get_peri => swiftest_util_peri_body

Determine nbody_system pericenter passages for test particles

procedure, public :: gr_pos_kick => whm_gr_p4_pl

Position kick due to p**4 term in the post-Newtonian correction

procedure, public :: h2b => swiftest_util_coord_h2b_pl

Convert massive bodies from heliocentric to barycentric coordinates (position and velocity)

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 :: kick => whm_kick_vh_pl

Kick heliocentric velocities of massive bodies

procedure, public :: make_impactors => swiftest_util_make_impactors_pl

Make impactors out of the current kinship relationships

procedure, public :: pv2v => swiftest_gr_pv2vh_body

Converts from psudeovelocity to velocity for GR calculations using symplectic integrators

generic, public :: read_frame => read_frame_bin

Add the generic read frame for Fortran binary files

procedure, public :: read_frame_bin => swiftest_io_read_frame_body

I/O routine for writing out a single frame of time-series data for the central body

procedure, public :: read_in => swiftest_io_read_in_body

Read in body initial conditions from an ascii file

procedure, public :: rearrange => rmvs_util_sort_rearrange_pl

Rearranges the order of array elements of body based on an input index array. Used in sorting methods

procedure, public :: rearray => swiftest_util_rearray_pl

Clean up the massive body structures to remove discarded bodies and add new bodies

procedure, public :: reset_kinship => swiftest_util_reset_kinship_pl

Resets the kinship status of bodies

procedure, public :: resize => rmvs_util_resize_pl

Checks the current size of a Swiftest body against the requested size and resizes it if it is too small.

procedure, public :: rh2rb => swiftest_util_coord_rh2rb_pl

Convert massive bodies from heliocentric to barycentric coordinates (position only)

procedure, public :: save_discard => swiftest_util_save_discard_body

Saves a snapshot of the this body to the collision storage object

procedure, public :: set_beg_end => swiftest_util_set_beg_end_pl

Sets the beginning and ending positions and velocities of planets.

procedure, public :: set_ir3 => whm_util_set_ir3j

Sets both the heliocentric and jacobi inverse radius terms (1/rj3 and 1/rh3)

procedure, public :: set_mu => whm_util_set_mu_eta_pl

Sets the Jacobi mass value for all massive bodies.

generic, public :: set_renc => set_renc_I4B, set_renc_DP
procedure, public :: set_renc_DP => swiftest_util_set_renc_DP

Sets the critical radius for encounter given an input real scale factor

procedure, public :: set_renc_I4B => swiftest_util_set_renc_I4B

Sets the critical radius for encounter given an inpput integer scale factor

procedure, public :: set_rhill => swiftest_util_set_rhill

Calculates the Hill’s radii for each body

procedure, public :: setup => rmvs_util_setup_pl

Constructor method - Allocates space for the input number of bodiess

procedure, public :: sort => rmvs_util_sort_pl

Sorts body arrays by a sortable componen

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, public :: step => whm_step_pl

Steps the body forward one stepsize

procedure, public :: v2pv => swiftest_gr_vh2pv_body

Converts from velocity to psudeovelocity for GR calculations using symplectic integrators

procedure, public :: vb2vh => swiftest_util_coord_vb2vh_pl

Convert massive bodies from barycentric to heliocentric coordinates (velocity only)

procedure, public :: vh2vb => swiftest_util_coord_vh2vb_pl

Convert massive bodies from heliocentric to barycentric coordinates (velocity only)

procedure, public :: vh2vj => whm_coord_vh2vj_pl

Convert velocity vectors from heliocentric to Jacobi coordinates

procedure, public :: write_frame => swiftest_io_netcdf_write_frame_body

I/O routine for writing out a single frame of time-series data for all bodies in the nbody_system in NetCDF format

procedure, public :: write_info => swiftest_io_netcdf_write_info_body

Dump contents of particle information metadata to file

procedure, public :: xv2el => swiftest_orbel_xv2el_vec

Convert position and velocity vectors to orbital elements

type, public, 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_util_setup_tp and rmvs_util_spill_tp

Components

TypeVisibilityAttributesNameInitial
real(kind=DP), public, dimension(:), allocatable:: a

Semimajor axis (pericentric distance for a parabolic orbit)

real(kind=DP), public, dimension(:,:), allocatable:: agr

Acceleration due to post-Newtonian correction

real(kind=DP), public, dimension(:,:), allocatable:: ah

Total heliocentric acceleration

real(kind=DP), public, dimension(:,:), allocatable:: aobl

Barycentric accelerations of bodies due to central body oblatenes

real(kind=DP), public, dimension(:,:), allocatable:: atide

Tanngential component of acceleration of bodies due to tides

real(kind=DP), public, dimension(:), allocatable:: atp

semimajor axis following perihelion passage

real(kind=DP), public, dimension(:), allocatable:: capm

Mean anomaly

real(kind=DP), public, dimension(:), allocatable:: capom

Longitude of ascending node

type(rmvs_cb), public :: cb_heliocentric

Copy of original central body object passed to close encounter (used for oblateness acceleration during planetocentric encoountters)

real(kind=DP), public, dimension(:), allocatable:: e

Eccentricity

integer(kind=I4B), public, dimension(:), allocatable:: id

Identifier

real(kind=DP), public, dimension(:), allocatable:: inc

Inclination

integer(kind=I4B), public :: index

inner substep number within current set

type(swiftest_particle_info), public, dimension(:), allocatable:: info

Particle metadata information

integer(kind=I4B), public :: ipleP

index value of encountering planet

real(kind=DP), public, dimension(:), allocatable:: ir3h

Inverse heliocentric radius term (1/rh**3)

integer(kind=I4B), public, dimension(:), allocatable:: isperi

perihelion passage flag

integer(kind=I4B), public, dimension(:,:), allocatable:: k_pltp

Index array used to convert flattened the body-body comparison upper triangular matrix

logical, public, dimension(:), allocatable:: lcollision

flag indicating whether body has merged with another this time step

logical, public, dimension(:), allocatable:: ldiscard

Body should be discarded

logical, public, dimension(:), allocatable:: lencounter

flag indicating whether body is part of an encounter this time step

logical, public :: lfirst =.true.

Run the current step as a first

logical, public, dimension(:), allocatable:: lmask

Logical mask used to select a subset of bodies when performing certain operations (drift, kick, accel, etc.)

logical, public, dimension(:), allocatable:: lperi

planetocentric pericenter passage flag (persistent for a full rmvs time step) over a full RMVS time step)

logical, public :: lplanetocentric =.false.

Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations

real(kind=DP), public, dimension(:), allocatable:: mu

G * (Mcb + [m])

integer(kind=I4B), public :: nbody =0

Number of bodies

integer(kind=I4B), public, dimension(:), allocatable:: nplenc

number of encounters with planets this time step

integer(kind=I8B), public :: npltp

Number of pl-tp comparisons in the flattened upper triangular matrix

real(kind=DP), public, dimension(:), allocatable:: omega

Argument of pericenter

real(kind=DP), public, dimension(:), allocatable:: peri

perihelion distance

integer(kind=I4B), public, dimension(:), allocatable:: plencP

index of planet that test particle is encountering (not persistent for a full RMVS time step)

integer(kind=I4B), public, dimension(:), allocatable:: plperP

index of planet associated with pericenter distance peri (persistent over a full RMVS time step)

real(kind=DP), public, dimension(:,:), allocatable:: rb

Barycentric position

real(kind=DP), public, dimension(:,:), allocatable:: rh

Heliocentric position

real(kind=DP), public, dimension(:,:), allocatable:: rheliocentric

original heliocentric position (used for oblateness calculation during close encounters)

integer(kind=I4B), public, dimension(:), allocatable:: status

An integrator-specific status indicator

real(kind=DP), public, dimension(:,:), allocatable:: vb

Barycentric velocity

real(kind=DP), public, dimension(:,:), allocatable:: vh

Heliocentric velocity

Finalizations Procedures

final :: rmvs_final_tp

Finalizes the RMVS test particle object - deallocates all allocatables

Type-Bound Procedures

procedure, public :: accel => rmvs_kick_getacch_tp

Calculates either the standard or modified version of the acceleration depending if the

Read more…
procedure, public :: accel_gr => whm_gr_kick_getacch_tp

Acceleration term arising from the post-Newtonian correction

procedure, public :: accel_int => swiftest_kick_getacch_int_tp

Compute direct cross (third) term heliocentric accelerations of test particles by massive bodies

procedure, public :: accel_non_spherical_cb => swiftest_non_spherical_cb_acc_tp

Compute the barycentric accelerations of bodies due to the oblateness of the central body

procedure, public :: accel_user => swiftest_user_kick_getacch_body

Add user-supplied heliocentric accelerations to planets

procedure, public :: append => rmvs_util_append_tp

Appends elements from one structure to another

procedure, public :: b2h => swiftest_util_coord_b2h_tp

Convert test particles from barycentric to heliocentric coordinates (position and velocity)

procedure, public :: dealloc => rmvs_util_dealloc_tp

Deallocates all allocatable arrays

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 :: drift => swiftest_drift_body

Loop through bodies and call Danby drift routine on heliocentric variables

procedure, public :: el2xv => swiftest_orbel_el2xv_vec

Convert orbital elements to position and velocity vectors

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 UNPACK intrinsic)

procedure, public :: get_peri => swiftest_util_peri_body

Determine nbody_system pericenter passages for test particles

procedure, public :: gr_pos_kick => whm_gr_p4_tp

Position kick due to p**4 term in the post-Newtonian correction

procedure, public :: h2b => swiftest_util_coord_h2b_tp

Convert test particles from heliocentric to barycentric coordinates (position and velocity)

procedure, public :: kick => whm_kick_vh_tp

Kick heliocentric velocities of test particles

procedure, public :: pv2v => swiftest_gr_pv2vh_body

Converts from psudeovelocity to velocity for GR calculations using symplectic integrators

generic, public :: read_frame => read_frame_bin

Add the generic read frame for Fortran binary files

procedure, public :: read_frame_bin => swiftest_io_read_frame_body

I/O routine for writing out a single frame of time-series data for the central body

procedure, public :: read_in => swiftest_io_read_in_body

Read in body initial conditions from an ascii file

procedure, public :: rearrange => rmvs_util_sort_rearrange_tp

Rearranges the order of array elements of body based on an input index array. Used in sorting methods

procedure, public :: rearray => swiftest_util_rearray_tp

Clean up the test particle structures to remove discarded bodies

procedure, public :: resize => rmvs_util_resize_tp

Checks the current size of a Swiftest body against the requested size and resizes it if it is too small.

procedure, public :: rh2rb => swiftest_util_coord_rh2rb_tp

Convert test particles from heliocentric to barycentric coordinates (position only)

procedure, public :: save_discard => swiftest_util_save_discard_body

Saves a snapshot of the this body to the collision storage object

procedure, public :: set_ir3 => swiftest_util_set_ir3h

Sets the inverse heliocentric radius term (1/rh**3)

procedure, public :: set_mu => swiftest_util_set_mu_tp

Method used to construct the vectorized form of the central body mass

procedure, public :: setup => rmvs_util_setup_tp

Constructor method - Allocates space for the input number of bodiess

procedure, public :: sort => rmvs_util_sort_tp

Sorts body arrays by a sortable componen

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, public :: step => whm_step_tp

Steps the particle forward one stepsize

procedure, public :: v2pv => swiftest_gr_vh2pv_body

Converts from velocity to psudeovelocity for GR calculations using symplectic integrators

procedure, public :: vb2vh => swiftest_util_coord_vb2vh_tp

Convert test particles from barycentric to heliocentric coordinates (velocity only)

procedure, public :: vh2vb => swiftest_util_coord_vh2vb_tp

Convert test particles from heliocentric to barycentric coordinates (velocity only)

procedure, public :: write_frame => swiftest_io_netcdf_write_frame_body

I/O routine for writing out a single frame of time-series data for all bodies in the nbody_system in NetCDF format

procedure, public :: write_info => swiftest_io_netcdf_write_info_body

Dump contents of particle information metadata to file

procedure, public :: xv2el => swiftest_orbel_xv2el_vec

Convert position and velocity vectors to orbital elements


Subroutines

public subroutine rmvs_coarray_coclone_tp(tp)

Author
David A. Minton

Broadcasts the image 1 object to all other images in a coarray

Arguments

TypeIntentOptionalAttributesName
type(rmvs_tp), intent(inout), codimension[*]:: tp

RMVS pl object

public subroutine rmvs_coarray_cocollect_tp(tp)

Author
David A. Minton

Broadcasts the image 1 object to all other images in a coarray

Arguments

TypeIntentOptionalAttributesName
type(rmvs_tp), intent(inout), codimension[*]:: tp

RMVS pl object

public subroutine rmvs_final_cb(self)

Author
David A. Minton

Finalize the RMVS massive body object - deallocates all allocatables

Arguments

TypeIntentOptionalAttributesName
type(rmvs_cb), intent(inout) :: self

RMVS central body object

public subroutine rmvs_final_interp(self)

Author
David A. Minton

Finalize the RMVS nbody system object - deallocates all allocatables

Arguments

TypeIntentOptionalAttributesName
type(rmvs_interp), intent(inout) :: self

RMVS nbody system object

public subroutine rmvs_final_pl(self)

Author
David A. Minton

Finalize the RMVS massive body object - deallocates all allocatables

Arguments

TypeIntentOptionalAttributesName
type(rmvs_pl), intent(inout) :: self

RMVS massive body object

public subroutine rmvs_final_tp(self)

Author
David A. Minton

Finalize the RMVS test particle object - deallocates all allocatables

Arguments

TypeIntentOptionalAttributesName
type(rmvs_tp), intent(inout) :: self

RMVS test particle object