symba Module

  • The Purdue Swiftest Team - David A. Minton, Carlisle A. Wishard, Jennifer L.L. Pouplin, and Jacob R. Elliott
  • 338 statements
  • Source File

Definition of classes and methods specific to the SyMBA integrator Adapted from David E. Kaufmann’s Swifter routine: module_symba.f90


Uses

  • module~~symba~~UsesGraph module~symba symba module~helio helio module~symba->module~helio module~swiftest swiftest module~symba->module~swiftest module~helio->module~swiftest module~whm whm module~helio->module~whm module~encounter encounter module~swiftest->module~encounter module~collision collision module~swiftest->module~collision globals globals module~swiftest->globals 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~whm->module~swiftest module~encounter->globals module~encounter->module~base module~encounter->module~netcdf_io module~collision->module~encounter module~collision->globals 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


Contents


Interfaces

interface

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

    Arguments

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

    SyMBA 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 subroutine symba_drift_pl(self, nbody_system, param, dt)

    Arguments

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

    Helio massive body object

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

    Swiftest nbody system object

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

    Current run configuration parameters

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

    Stepsize

interface

  • public module module subroutine symba_drift_tp(self, nbody_system, param, dt)

    Arguments

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

    Helio massive body object

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

    Swiftest nbody system object

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

    Current run configuration parameters

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

    Stepsize

interface

  • public module module function symba_encounter_check_list_plpl(self, param, nbody_system, dt, irec) result(lany_encounter)

    Arguments

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

    SyMBA pl-pl encounter list object

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

    Current Swiftest run configuration parameters

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

    SyMBA nbody system object

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

    step size

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

    Current recursion level

    Return Value logical

    Returns true if there is at least one close encounter

interface

  • public module module function symba_encounter_check_list_pltp(self, param, nbody_system, dt, irec) result(lany_encounter)

    Arguments

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

    SyMBA pl-tp encounter list object

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

    Current Swiftest run configuration parameters

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

    SyMBA nbody system object

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

    step size

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

    Current recursion level

    Return Value logical

    Returns true if there is at least one close encounter

interface

  • public module module function symba_encounter_check_pl(self, param, nbody_system, dt, irec) result(lany_encounter)

    Arguments

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

    SyMBA test particle object

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

    Current Swiftest run configuration parameters

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

    SyMBA nbody system object

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

    step size

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

    Current recursion level

    Return Value logical

    Returns true if there is at least one close encounter

interface

  • public module module function symba_encounter_check_tp(self, param, nbody_system, dt, irec) result(lany_encounter)

    Arguments

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

    SyMBA test particle object

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

    Current Swiftest run configuration parameters

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

    SyMBA nbody system object

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

    step size

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

    Current recursion level

    Return Value logical

    Returns true if there is at least one close encounter

interface

  • public pure module module subroutine symba_gr_p4_pl(self, nbody_system, param, dt)

    Arguments

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

    SyMBA massive body object

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

    Swiftest nbody system object

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

    Current run configuration parameters

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

    Step size

interface

  • public pure module module subroutine symba_gr_p4_tp(self, nbody_system, param, dt)

    Arguments

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

    SyMBA test particle object

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

    Swiftest nbody system object

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

    Current run configuration parameters

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

    Step size

interface

  • public module subroutine symba_io_param_writer(self, unit, iotype, v_list, iostat, iomsg)

    Arguments

    TypeIntentOptionalAttributesName
    class(swiftest_parameters), intent(in) :: self

    Current run configuration parameters with SyMBA additions

    integer, intent(in) :: unit

    File unit number

    character(len=*), intent(in) :: iotype

    Dummy argument passed to the input/output procedure contains the text from the char-literal-constant, prefixed with DT.

    If you do not include a char-literal-constant, the iotype argument contains only DT.

    integer, intent(in) :: v_list(:)

    Not used in this procedure

    integer, intent(out) :: iostat

    IO status code

    character(len=*), intent(inout) :: iomsg

    Message to pass if iostat /= 0

interface

  • public module module subroutine symba_kick_getacch_int_pl(self, param)

    Arguments

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

    SyMBA massive body object

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

    Current Swiftest run configuration parameters

interface

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

    Arguments

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

    SyMBA massive body particle data structure

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

    Swiftest nbody system object

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

    Current run configuration parameters

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

    Current simulation 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 symba_kick_getacch_tp(self, nbody_system, param, t, lbeg)

    Arguments

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

    SyMBA test particle data structure

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

    Swiftest nbody system object

    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 symba_kick_list_plpl(self, nbody_system, dt, irec, sgn)

    Arguments

    TypeIntentOptionalAttributesName
    class(symba_list_plpl), intent(in) :: self

    SyMBA pl-tp encounter list object

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

    SyMBA nbody system object

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

    step size

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

    Current recursion level

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

    sign to be applied to acceleration

interface

  • public module module subroutine symba_kick_list_pltp(self, nbody_system, dt, irec, sgn)

    Arguments

    TypeIntentOptionalAttributesName
    class(symba_list_pltp), intent(in) :: self

    SyMBA pl-tp encounter list object

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

    SyMBA nbody system object

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

    step size

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

    Current recursion level

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

    sign to be applied to acceleration

interface

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

    Arguments

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

    SyMBA 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 recursive module module subroutine symba_step_recur_system(self, param, t, ireci)

    Arguments

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

    SyMBA nbody system object

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

    Current run configuration parameters

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

    Current simulation time

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

    input recursion level

interface

  • public module module subroutine symba_step_reset_system(self, param)

    Arguments

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

    SyMBA nbody system object

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

    Current run configuration parameters with SyMBA additions

interface

  • public module module subroutine symba_step_set_recur_levels_system(self, ireci)

    Arguments

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

    SyMBA nbody system objec

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

    Input recursion level

interface

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

    Arguments

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

    SyMBA 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 symba_util_append_pl(self, source, lsource_mask)

    Arguments

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

    SyMBA 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 symba_util_append_tp(self, source, lsource_mask)

    Arguments

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

    SyMBA 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 symba_util_dealloc_pl(self)

    Arguments

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

    SyMBA massive body object

interface

  • public module module subroutine symba_util_dealloc_system(self)

    Arguments

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

interface

  • public module module subroutine symba_util_dealloc_tp(self)

    Arguments

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

    SyMBA test particle object

interface

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

    Arguments

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

    SyMBA 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 symba_util_fill_tp(self, inserts, lfill_list)

    Arguments

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

    SyMBA test particle 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 symba_util_flatten_eucl_plpl(self, param)

    Arguments

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

    SyMBA massive body object

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

    Current run configuration parameters

interface

  • public module module subroutine symba_util_resize_pl(self, nnew)

    Arguments

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

    SyMBA massive body object

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

    New size neded

interface

  • public module module subroutine symba_util_resize_tp(self, nnew)

    Arguments

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

    SyMBA massive body object

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

    New size neded

interface

  • public module module subroutine symba_util_set_renc(self, scale)

    Arguments

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

    SyMBA massive body object

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

    Current recursion depth

interface

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

    Arguments

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

    SyMBA nbody_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 symba_util_setup_pl(self, n, param)

    Arguments

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

    SyMBA 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 symba_util_setup_tp(self, n, param)

    Arguments

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

    SyMBA 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 parameter

interface

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

    Arguments

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

    SyMBA 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 symba_util_sort_rearrange_pl(self, ind)

    Arguments

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

    SyMBA 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 symba_util_sort_rearrange_tp(self, ind)

    Arguments

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

    SyMBA 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 symba_util_sort_tp(self, sortby, ascending)

    Arguments

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

    SyMBA 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 symba_util_spill_pl(self, discards, lspill_list, ldestructive)

    Arguments

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

    SyMBA 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 symba_util_spill_tp(self, discards, lspill_list, ldestructive)

    Arguments

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

    SyMBA 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(helio_cb) :: symba_cb

SyMBA 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

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

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

Central body mass (units MU)

real(kind=DP), public, dimension(NDIM):: ptbeg

negative barycentric velocity of the central body at the beginning of time step

real(kind=DP), public, dimension(NDIM):: ptend

negative barycentric velocity of the central body at the end of time step

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)

Type-Bound Procedures

procedure, public :: dealloc => swiftest_util_dealloc_cb

Deallocates all allocatables and resets all values to defaults

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, extends(collision_list_plpl) :: symba_list_plpl

SyMBA class for tracking close encounters in a step

Components

TypeVisibilityAttributesNameInitial
integer(kind=I4B), public, dimension(:), allocatable:: id1

id of the first body in the encounter

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

id of the second body in the encounter

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

position of the first body in the encounter

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

position of the second body in the encounter

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

indicates that thie pair of bodies is in currently at its closest approach point

logical, public :: lcollision

Indicates if the encounter resulted in at least one collision

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

Recursion level (used in SyMBA)

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

relative vdotr flag

integer(kind=I8B), public :: nenc =0

Total number of encounters

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

the position of body 1 in the encounter

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

the position of body 2 in the encounter

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

status of the interaction

real(kind=DP), public :: t

Time of encounter

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

Time of collision

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

the velocity of body 1 in the encounter

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

the velocity of body 2 in the encounter

Type-Bound Procedures

procedure, public :: append => encounter_util_append_list

Appends elements from one structure to another

procedure, public :: collision_check => collision_check_plpl

Checks if a test particle is going to collide with a massive body

procedure, public :: copy => encounter_util_copy_list

Copies elements from the source encounter list into self.

procedure, public :: dealloc => encounter_util_dealloc_list

Deallocates all allocatables

procedure, public :: encounter_check => symba_encounter_check_list_plpl

Checks if massive bodies are going through close encounters with each other

procedure, public :: extract_collisions => collision_resolve_extract_plpl

Processes the pl-pl encounter list remove only those encounters that led to a collision

procedure, public :: kick => symba_kick_list_plpl

Kick barycentric velocities of active massive bodies within SyMBA recursion

procedure, public :: resize => encounter_util_resize_list

Checks the current size of the encounter list against the required size and extends it by a factor of 2 more than requested if it is too small.

procedure, public :: resolve_collision => collision_resolve_plpl

Process the pl-pl collision list, then modifiy the massive bodies based on the outcome of the collision

procedure, public :: setup => encounter_util_setup_list

A constructor that sets the number of encounters and allocates and initializes all arrays

procedure, public :: spill => encounter_util_spill_list

“Spills” bodies from one object to another depending on the results of a mask (uses the PACK intrinsic)

type, public, extends(collision_list_pltp) :: symba_list_pltp

SyMBA class for tracking close encounters in a step

Components

TypeVisibilityAttributesNameInitial
integer(kind=I4B), public, dimension(:), allocatable:: id1

id of the first body in the encounter

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

id of the second body in the encounter

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

position of the first body in the encounter

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

position of the second body in the encounter

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

indicates that thie pair of bodies is in currently at its closest approach point

logical, public :: lcollision

Indicates if the encounter resulted in at least one collision

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

Recursion level (used in SyMBA)

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

relative vdotr flag

integer(kind=I8B), public :: nenc =0

Total number of encounters

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

the position of body 1 in the encounter

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

the position of body 2 in the encounter

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

status of the interaction

real(kind=DP), public :: t

Time of encounter

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

Time of collision

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

the velocity of body 1 in the encounter

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

the velocity of body 2 in the encounter

Type-Bound Procedures

procedure, public :: append => encounter_util_append_list

Appends elements from one structure to another

procedure, public :: collision_check => collision_check_pltp

Checks if a test particle is going to collide with a massive body

procedure, public :: copy => encounter_util_copy_list

Copies elements from the source encounter list into self.

procedure, public :: dealloc => encounter_util_dealloc_list

Deallocates all allocatables

procedure, public :: encounter_check => symba_encounter_check_list_pltp

Checks if massive bodies are going through close encounters with test particles

procedure, public :: extract_collisions => collision_resolve_extract_pltp

Processes the pl-tp encounter list remove only those encounters that led to a collision

procedure, public :: kick => symba_kick_list_pltp

Kick barycentric velocities of active test particles within SyMBA recursion

procedure, public :: resize => encounter_util_resize_list

Checks the current size of the encounter list against the required size and extends it by a factor of 2 more than requested if it is too small.

procedure, public :: resolve_collision => collision_resolve_pltp

Process the pl-tp collision list

procedure, public :: setup => encounter_util_setup_list

A constructor that sets the number of encounters and allocates and initializes all arrays

procedure, public :: spill => encounter_util_spill_list

“Spills” bodies from one object to another depending on the results of a mask (uses the PACK intrinsic)

type, public, extends(helio_nbody_system) :: symba_nbody_system

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

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

nbody_system recursion level

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

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 :: 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

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 => swiftest_util_dealloc_system

Deallocates all allocatables and resets all values to defaults. Acts as a base for a finalizer

procedure, public :: dealloic => symba_util_dealloc_system

Deallocates all allocatables

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 => symba_util_setup_initialize_system

Performs SyMBA-specific initilization steps

procedure, public :: initialize_output_file => swiftest_io_initialize_output_file_system

Write a frame of input data from file

procedure, public :: interp => symba_step_interp_system

Perform an interpolation step on the SymBA nbody system

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 :: 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 :: rescale => swiftest_util_rescale_system

Rescales the nbody_system into a new set of units

procedure, public :: reset => symba_step_reset_system

Resets pl, tp,and encounter structures at the start of a new step

procedure, public :: set_msys => swiftest_util_set_msys

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

procedure, public :: set_recur_levels => symba_step_set_recur_levels_system

Sets recursion levels of bodies and encounter lists to the current nbody_system level

procedure, public :: step => symba_step_system

Advance the SyMBA 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(helio_pl) :: symba_pl

SyMBA massive body 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

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

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

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

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

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

level at which this body should be moved

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

deepest encounter level achieved 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

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

Body mass (units MU)

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 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

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

perihelion distance

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

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

Type-Bound Procedures

procedure, public :: accel => symba_kick_getacch_pl

Compute heliocentric accelerations of massive bodies

procedure, public :: accel_gr => helio_gr_kick_getacch_pl

Acceleration term arising from the post-Newtonian correction

procedure, public :: accel_int => symba_kick_getacch_int_pl

Compute direct cross (third) term heliocentric accelerations of massive bodiess, with no mutual interactions between bodies below GMTINY

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 => symba_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 => symba_util_dealloc_pl

Deallocates all allocatable arrays

procedure, public :: discard => symba_discard_pl

Process massive body discards

procedure, public :: drift => symba_drift_pl

Method for Danby drift in Democratic Heliocentric coordinates. Sets the mask to the current recursion level

procedure, public :: el2xv => swiftest_orbel_el2xv_vec

Convert orbital elements to position and velocity vectors

procedure, public :: encounter_check => symba_encounter_check_pl

Checks if massive bodies are going through close encounters with each other

procedure, public :: fill => symba_util_fill_pl

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

procedure, public :: flatten => symba_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 => symba_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 :: kick => helio_kick_vb_pl

Kicks the barycentric velocities

procedure, public :: lindrift => helio_drift_linear_pl

Method for linear drift of massive bodies due to barycentric momentum of Sun

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 => symba_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 => symba_util_resize_pl

Checks the current size of a SyMBA massive 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 => swiftest_util_set_ir3h

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

procedure, public :: set_mu => swiftest_util_set_mu_pl

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

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 => symba_util_set_renc

Sets the critical radius for encounter given an input recursion depth

procedure, public :: set_rhill => swiftest_util_set_rhill

Calculates the Hill’s radii for each body

procedure, public :: setup => symba_util_setup_pl

Constructor method - Allocates space for the input number of bodies

procedure, public :: sort => symba_util_sort_pl

Sorts body arrays by a sortable componen

procedure, public :: spill => symba_util_spill_pl

“Spills” bodies from one object to another depending on the results of a mask (uses the PACK intrinsic)

procedure, public :: step => helio_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 :: 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(helio_tp) :: symba_tp

SyMBA test particle class

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

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

Eccentricity

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

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

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

level at which this particle should be moved

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

deepest encounter level achieved 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.)

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

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

Barycentric position

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

Heliocentric position

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

Type-Bound Procedures

procedure, public :: accel => symba_kick_getacch_tp

Compute heliocentric accelerations of test particles

procedure, public :: accel_gr => helio_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 => symba_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 => symba_util_dealloc_tp

Deallocates all allocatable arrays

procedure, public :: discard => swiftest_discard_tp

Check to see if test particles should be discarded based on their positions relative to the massive bodies

procedure, public :: drift => symba_drift_tp

Method for Danby drift in Democratic Heliocentric coordinates. Sets the mask to the current recursion level

procedure, public :: el2xv => swiftest_orbel_el2xv_vec

Convert orbital elements to position and velocity vectors

procedure, public :: encounter_check => symba_encounter_check_tp

Checks if any test particles are undergoing a close encounter with a massive body

procedure, public :: fill => symba_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 => symba_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 => helio_kick_vb_tp

Kicks the barycentric velocities

procedure, public :: lindrift => helio_drift_linear_tp

Method for linear drift of massive bodies due to barycentric momentum of Sun

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 => symba_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 => symba_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 => symba_util_setup_tp

Constructor method - Allocates space for the input number of bodies

procedure, public :: sort => symba_util_sort_tp

Sorts body arrays by a sortable componen

procedure, public :: spill => symba_util_spill_tp

“Spills” bodies from one object to another depending on the results of a mask (uses the PACK intrinsic)

procedure, public :: step => helio_step_tp

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_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