swiftest Module

This module serves to combine all of the Swiftest project modules under a single umbrella so that they can be accessed from individual submodule implementations with a simple “use swiftest” line.

The project structure is divided into a heirarchy of modules. The lowest level of the heirarchy are the modules called in the “use” statements below. Next the “swiftest” modules (this one), and finally each individual integrator (and potential future integrators) sit at the top. This structure is a consequence of two competing constraints: 1) The desire that much of the basic functionality of the code is modular, such that new functionality can be easily added without altering too much of the basic code. 2) Adhering to Modern Fortran’s typing rules.

A set of “base” types is defined in the base module. These define classes of objects, (i.e. central body, massive body, and test particles) and other major types used throughout the project. However, none of the derived data types are defined with concrete type-bound procedures attached (only abstract procedures). However, the interfaces of type-bound procedures are defined using the base types as arguments. Because of the typing rules of Modern Fortran’s type-bound procedure overrides, any non-pass arguments(i.e. arguments not named self) must be identical in all extended types. Because some of the basic functionality in the project is split across multiple modules, we cannot define type-bound procedures in base class objects until the all interfaces are defined. In order to avoid these dependency issues and not end up with a massive base class with every possibly type-bound procedure interface in the project (thus reducing the modularity of the project), the type-bound procedures are added to the base types here.

Structuring this code this way adds somewhat to the verbosity of the code. The main thing that has to happen is that for any procedures where one wishes to make use of an type-bound procedures defined for arguments at the swiftest-type level or higher, but that are passsed to base-level procedures, must have their arguments wrapped in a select type(…); class is(…) construct in order to “reveal” the procedures. This is done throughout the project at the beginning of many procedures (along with copious amounts of associate(…) statements, in order to help with code readibility)

Adapted from David E. Kaufmann’s Swifter routine: module_swifter.f90


Uses

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

Used by

  • module~~swiftest~~UsedByGraph module~swiftest swiftest module~bindings_module bindings_module module~bindings_module->module~swiftest module~fraggle fraggle module~fraggle->module~swiftest module~helio helio module~helio->module~swiftest module~whm whm module~helio->module~whm module~rmvs rmvs module~rmvs->module~swiftest module~rmvs->module~whm module~s_coarray_clone s_coarray_clone module~s_coarray_clone->module~swiftest module~s_coarray_collect s_coarray_collect module~s_coarray_collect->module~swiftest module~s_collision_check s_collision_check module~s_collision_check->module~swiftest module~symba symba module~s_collision_check->module~symba module~s_collision_generate s_collision_generate module~s_collision_generate->module~swiftest module~s_collision_io s_collision_io module~s_collision_io->module~swiftest module~s_collision_regime s_collision_regime module~s_collision_regime->module~swiftest module~s_collision_resolve s_collision_resolve module~s_collision_resolve->module~swiftest module~s_collision_util s_collision_util module~s_collision_util->module~swiftest module~s_encounter_check s_encounter_check module~s_encounter_check->module~swiftest module~s_encounter_io s_encounter_io module~s_encounter_io->module~swiftest module~s_encounter_util s_encounter_util module~s_encounter_util->module~swiftest module~s_fraggle_generate s_fraggle_generate module~s_fraggle_generate->module~swiftest module~s_fraggle_generate->module~fraggle module~s_fraggle_generate->module~symba module~s_fraggle_util s_fraggle_util module~s_fraggle_util->module~swiftest module~s_fraggle_util->module~fraggle module~s_helio_drift s_helio_drift module~s_helio_drift->module~swiftest module~s_helio_drift->module~helio module~s_helio_gr s_helio_gr module~s_helio_gr->module~swiftest module~s_helio_gr->module~helio module~s_helio_kick s_helio_kick module~s_helio_kick->module~swiftest module~s_helio_kick->module~helio module~s_helio_step s_helio_step module~s_helio_step->module~swiftest module~s_helio_step->module~helio module~s_helio_util s_helio_util module~s_helio_util->module~swiftest module~s_helio_util->module~helio module~s_operator_cross s_operator_cross module~s_operator_cross->module~swiftest module~s_rmvs_discard s_rmvs_discard module~s_rmvs_discard->module~swiftest module~s_rmvs_discard->module~rmvs module~s_rmvs_encounter_check s_rmvs_encounter_check module~s_rmvs_encounter_check->module~swiftest module~s_rmvs_encounter_check->module~rmvs module~s_rmvs_kick s_rmvs_kick module~s_rmvs_kick->module~swiftest module~s_rmvs_kick->module~rmvs module~s_rmvs_step s_rmvs_step module~s_rmvs_step->module~swiftest module~s_rmvs_step->module~rmvs module~s_rmvs_util s_rmvs_util module~s_rmvs_util->module~swiftest module~s_rmvs_util->module~rmvs module~s_shgrav_accel s_shgrav_accel module~s_shgrav_accel->module~swiftest module~shgrav shgrav module~s_shgrav_accel->module~shgrav module~s_shgrav_pot s_shgrav_pot module~s_shgrav_pot->module~swiftest module~s_shgrav_pot->module~shgrav module~s_swiftest_coarray s_swiftest_coarray module~s_swiftest_coarray->module~swiftest module~s_swiftest_discard s_swiftest_discard module~s_swiftest_discard->module~swiftest module~s_swiftest_drift s_swiftest_drift module~s_swiftest_drift->module~swiftest module~s_swiftest_driver s_swiftest_driver module~s_swiftest_driver->module~swiftest module~s_swiftest_gr s_swiftest_gr module~s_swiftest_gr->module~swiftest module~s_swiftest_io s_swiftest_io module~s_swiftest_io->module~swiftest module~s_swiftest_io->module~symba module~s_swiftest_kick s_swiftest_kick module~s_swiftest_kick->module~swiftest module~s_swiftest_obl s_swiftest_obl module~s_swiftest_obl->module~swiftest module~s_swiftest_obl->module~shgrav module~s_swiftest_orbel s_swiftest_orbel module~s_swiftest_orbel->module~swiftest module~s_swiftest_user s_swiftest_user module~s_swiftest_user->module~swiftest module~s_swiftest_util s_swiftest_util module~s_swiftest_util->module~swiftest module~s_swiftest_util->module~fraggle module~s_swiftest_util->module~helio module~s_swiftest_util->module~rmvs module~s_swiftest_util->module~symba module~s_swiftest_util->module~whm module~s_symba_discard s_symba_discard module~s_symba_discard->module~swiftest module~s_symba_discard->module~symba module~s_symba_drift s_symba_drift module~s_symba_drift->module~swiftest module~s_symba_drift->module~symba module~s_symba_encounter_check s_symba_encounter_check module~s_symba_encounter_check->module~swiftest module~s_symba_encounter_check->module~symba module~s_symba_gr s_symba_gr module~s_symba_gr->module~swiftest module~s_symba_gr->module~symba module~s_symba_kick s_symba_kick module~s_symba_kick->module~swiftest module~s_symba_kick->module~symba module~s_symba_step s_symba_step module~s_symba_step->module~swiftest module~s_symba_step->module~symba module~s_symba_util s_symba_util module~s_symba_util->module~swiftest module~s_symba_util->module~fraggle module~s_symba_util->module~symba module~s_tides_kick_getacch s_tides_kick_getacch module~s_tides_kick_getacch->module~swiftest module~s_tides_step_rot s_tides_step_rot module~s_tides_step_rot->module~swiftest module~s_walltime s_walltime module~s_walltime->module~swiftest module~s_whm_coord s_whm_coord module~s_whm_coord->module~swiftest module~s_whm_coord->module~whm module~s_whm_gr s_whm_gr module~s_whm_gr->module~swiftest module~s_whm_gr->module~whm module~s_whm_kick s_whm_kick module~s_whm_kick->module~swiftest module~s_whm_kick->module~whm module~s_whm_step s_whm_step module~s_whm_step->module~swiftest module~s_whm_step->module~whm module~s_whm_util s_whm_util module~s_whm_util->module~swiftest module~s_whm_util->module~whm module~shgrav->module~swiftest module~symba->module~swiftest module~symba->module~helio module~whm->module~swiftest module~whm_drift whm_drift module~whm_drift->module~swiftest module~whm_drift->module~whm program~main main program~main->module~swiftest

Interfaces

public interface coclone

  • public module subroutine swiftest_coarray_coclone_param(param)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_parameters), intent(inout), codimension[*] :: param
  • public module subroutine swiftest_coarray_component_clone_info(var, src_img)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout) :: var
    integer(kind=I4B), intent(in), optional :: src_img
  • public module subroutine swiftest_coarray_component_clone_info_arr1D(var, src_img)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: var
    integer(kind=I4B), intent(in), optional :: src_img

public interface cocollect

  • public module subroutine swiftest_coarray_component_collect_info_arr1D(var, dest_img)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: var
    integer(kind=I4B), intent(in), optional :: dest_img

public interface io_param_writer_one

  • public module subroutine swiftest_io_param_writer_one_DP(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

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

    Value of parameter to print

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

    Open file unit number to print parameter to

  • public module subroutine swiftest_io_param_writer_one_DParr(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

    real(kind=DP), intent(in), dimension(:) :: param_value

    Value of parameter to print

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

    Open file unit number to print parameter to

  • public module subroutine swiftest_io_param_writer_one_I4B(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

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

    Value of parameter to print

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

    Open file unit number to print parameter to

  • public module subroutine swiftest_io_param_writer_one_I4Barr(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

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

    Value of parameter to print

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

    Open file unit number to print parameter to

  • public module subroutine swiftest_io_param_writer_one_I8B(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

    integer(kind=I8B), intent(in) :: param_value

    Value of parameter to print

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

    Open file unit number to print parameter to

  • public module subroutine swiftest_io_param_writer_one_QP(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

    real(kind=QP), intent(in) :: param_value

    Value of parameter to print

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

    Open file unit number to print parameter to

  • public module subroutine swiftest_io_param_writer_one_char(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

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

    Value of parameter to print

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

    Open file unit number to print parameter to

  • public module subroutine swiftest_io_param_writer_one_logical(param_name, param_value, unit)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: param_name

    Name of parameter to print

    logical, intent(in) :: param_value

    Value of parameter to print

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

    Open file unit number to print parameter to

interface

  • public module subroutine swiftest_coarray_balance_system(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_coarray_collect_system(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_coarray_distribute_system(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system

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

    Current run configuration parameters

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    Swiftest nbody system object

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

    Current run configuration parameter

interface

  • public module subroutine swiftest_discard_system(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody_system object

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

    Current run configuration parameters

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest 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 subroutine swiftest_drift_all(mu, x, v, n, param, dt, lmask, iflag)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in), dimension(:) :: mu

    Vector of gravitational constants

    real(kind=DP), intent(inout), dimension(:,:) :: x

    Position and velocity vectors

    real(kind=DP), intent(inout), dimension(:,:) :: v

    Position and velocity vectors

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

    number of bodies

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

    Current run configuration parameters

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

    Stepsize

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

    Logical mask of size self%nbody that determines which bodies to drift.

    integer(kind=I4B), intent(out), dimension(:) :: iflag

    Vector of error flags. 0 means no problem

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest particle data structure

    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 subroutine swiftest_drift_cb_rotphase_update(self, param, dt)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_cb), intent(inout) :: self

    Swiftest central body data structure

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

    Current run configuration parameters

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

    Stepsize

interface

  • public pure elemental module subroutine swiftest_drift_one(mu, rx, ry, rz, vx, vy, vz, dt, iflag)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: mu

    G * (Mcb + m), G = gravitational constant, Mcb = mass of central body, m = mass of body to drift

    real(kind=DP), intent(inout) :: rx

    Position and velocity of body to drift

    real(kind=DP), intent(inout) :: ry

    Position and velocity of body to drift

    real(kind=DP), intent(inout) :: rz

    Position and velocity of body to drift

    real(kind=DP), intent(inout) :: vx

    Position and velocity of body to drift

    real(kind=DP), intent(inout) :: vy

    Position and velocity of body to drift

    real(kind=DP), intent(inout) :: vz

    Position and velocity of body to drift

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

    Step size

    integer(kind=I4B), intent(out) :: iflag

    iflag : error status flag for Danby drift (0 = OK, nonzero = ERROR)

interface

  • public module subroutine swiftest_driver(integrator, param_file_name, display_style)

    Arguments

    Type IntentOptional Attributes Name
    character(len=:), intent(in), allocatable :: integrator

    Symbolic code of the requested integrator

    character(len=:), intent(in), allocatable :: param_file_name

    Name of the input parameters file

    character(len=:), intent(in), allocatable :: display_style

    {“PROGRESS”, “CLASSIC”, “QUIET”, “COMPACT”}). Default is “PROGRESS”

interface

  • public pure module subroutine swiftest_gr_kick_getaccb_ns_body(self, nbody_system, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest generic body object

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

    Swiftest nbody system object

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

    Current run configuration parameters

interface

  • public pure module subroutine swiftest_gr_kick_getacch(mu, x, lmask, n, inv_c2, agr)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in), dimension(:) :: mu

    Gravitational constant

    real(kind=DP), intent(in), dimension(:,:) :: x

    Position vectors

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

    Logical mask indicating which bodies to compute

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

    Total number of bodies

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

    Inverse speed of light squared: 1 / c**2

    real(kind=DP), intent(out), dimension(:,:) :: agr

    Accelerations

interface

  • public pure elemental module subroutine swiftest_gr_p4_pos_kick(inv_c2, rx, ry, rz, vx, vy, vz, dt)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: inv_c2

    One over speed of light squared (1/c**2)

    real(kind=DP), intent(inout) :: rx

    Position vector

    real(kind=DP), intent(inout) :: ry

    Position vector

    real(kind=DP), intent(inout) :: rz

    Position vector

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

    Velocity vector

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

    Velocity vector

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

    Velocity vector

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

    Step size

interface

  • public pure module subroutine swiftest_gr_pseudovel2vel(param, mu, rh, pv, vh)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(in) :: param

    Current run configuration parameters

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

    G * (Mcb + m), G = gravitational constant, Mcb = mass of central body, m = mass of body

    real(kind=DP), intent(in), dimension(:) :: rh

    Swiftestcentric position vector

    real(kind=DP), intent(in), dimension(:) :: pv

    Pseudovelocity velocity vector - see Saha & Tremain (1994), eq. (32)

    real(kind=DP), intent(out), dimension(:) :: vh

    Swiftestcentric velocity vector

interface

  • public pure module subroutine swiftest_gr_pv2vh_body(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest particle object

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

    Current run configuration parameters

interface

  • public pure module subroutine swiftest_gr_vel2pseudovel(param, mu, rh, vh, pv)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(in) :: param

    Current run configuration parameters

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

    G * (Mcb + m), G = gravitational constant, Mcb = mass of central body, m = mass of body

    real(kind=DP), intent(in), dimension(:) :: rh

    Swiftestcentric position vector

    real(kind=DP), intent(in), dimension(:) :: vh

    Swiftestcentric velocity vector

    real(kind=DP), intent(out), dimension(:) :: pv

    Pseudovelocity vector - see Saha & Tremain (1994), eq. (32)

interface

  • public pure module subroutine swiftest_gr_vh2pv_body(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest particle object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_compact_output(self, param, timer)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(in) :: self

    Swiftest nbody system object

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

    Input colleciton of user-defined parameters

    class(*), intent(in) :: timer

    Object used for computing elapsed wall time

interface

  • public module subroutine swiftest_io_conservation_report(self, param, lterminal)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

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

    Input colleciton of user-defined parameters

    logical, intent(in) :: lterminal

    Indicates whether to output information to the terminal screen

interface

  • public module subroutine swiftest_io_display_run_information(self, param, integration_timer, phase)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

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

    Current run configuration parameters

    type(walltimer), intent(inout) :: integration_timer

    Object used for computing elapsed wall time

    character(len=*), intent(in), optional :: phase

    One of “first” or “last”

interface

  • public module subroutine swiftest_io_dump_param(self, param_file_name)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(in) :: self

    Output collection of parameters

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

    Parameter input file name (i.e. param.in)

interface

  • public module subroutine swiftest_io_dump_storage(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_storage), intent(inout) :: self

    Swiftest simulation history storage object

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

    Current run configuration parameters

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody_system object

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

    Current run configuration parameters

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

    Stores the system history between output dumps

interface

  • public module subroutine swiftest_io_get_args(integrator, param_file_name, display_style, from_cli)

    Arguments

    Type IntentOptional Attributes Name
    character(len=:), intent(inout), allocatable :: integrator

    Symbolic code of the requested integrator

    character(len=:), intent(inout), allocatable :: param_file_name

    Name of the input parameters file

    character(len=:), intent(inout), allocatable :: display_style

    {“PROGRESS”, “CLASSIC”, “QUIET”, “COMPACT”}. Default is “PROGRESS”

    logical, intent(in) :: from_cli

    If true, get command-line arguments. Otherwise, use the values of the input variables

interface

  • public module function swiftest_io_get_token(buffer, ifirst, ilast, ierr) result(token)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: buffer

    Input string buffer

    integer(kind=I4B), intent(inout) :: ifirst

    Index of the buffer at which to start the search for a token

    integer(kind=I4B), intent(out) :: ilast

    Index of the buffer at the end of the returned token

    integer(kind=I4B), intent(out) :: ierr

    Error code

    Return Value character(len=:), allocatable

    Returned token string

interface

  • public module subroutine swiftest_io_initialize_output_file_system(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody_system object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to identify a particular NetCDF dataset

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_log_one_message(file, message)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: file

    Name of file to log

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

interface

  • public module subroutine swiftest_io_log_start(param, file, header)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(in) :: param

    Current Swiftest run configuration parameters

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

    Name of file to log

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

    Header to print at top of log file

interface

  • public module subroutine swiftest_io_netcdf_flush(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_netcdf_parameters), intent(inout) :: self

    Parameters used to identify a particular NetCDF dataset

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_get_t0_values_system(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to identify a particular NetCDF dataset

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_get_valid_masks(self, plmask, tpmask, plmmask, Gmtiny)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_netcdf_parameters), intent(inout) :: self

    Parameters used to identify a particular NetCDF dataset

    logical, intent(out), dimension(:), allocatable :: plmask

    Logical mask indicating which bodies are massive bodies

    logical, intent(out), dimension(:), allocatable :: tpmask

    Logical mask indicating which bodies are test particles

    logical, intent(out), optional, dimension(:), allocatable :: plmmask

    Logical mask indicating which bodies are fully interacting massive bodies

    real(kind=DP), intent(in), optional :: Gmtiny

    The cutoff G*mass between semi-interacting and fully interacting massive bodies

interface

  • public module subroutine swiftest_io_netcdf_initialize_output(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_netcdf_parameters), intent(inout) :: self

    Parameters used to for writing a NetCDF dataset to file

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_open(self, param, readonly)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_netcdf_parameters), intent(inout) :: self

    Parameters used to identify a particular NetCDF dataset

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

    Current run configuration parameters

    logical, intent(in), optional :: readonly

    Logical flag indicating that this should be open read only

interface

  • public module function swiftest_io_netcdf_read_frame_system(self, nc, param) result(ierr)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody_system object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to for reading a NetCDF dataset to file

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

    Current run configuration parameters

    Return Value integer(kind=I4B)

    Error code: returns 0 if the read is successful

interface

  • public module subroutine swiftest_io_netcdf_read_hdr_system(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to for reading a NetCDF dataset to file

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_read_particle_info_system(self, nc, param, plmask, tpmask)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to identify a particular NetCDF dataset

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

    Current run configuration parameters

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

    Logical array indicating which index values belong to massive bodies

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

    Logical array indicating which index values belong to test particles

interface

  • public module subroutine swiftest_io_netcdf_write_frame_body(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(in) :: self

    Swiftest base object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to for writing a NetCDF dataset to file

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_write_frame_cb(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_cb), intent(inout) :: self

    Swiftest base object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to for writing a NetCDF dataset to file

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_write_frame_system(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody_system object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to for writing a NetCDF dataset to file

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_write_hdr_system(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(in) :: self

    Swiftest nbody system object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to for writing a NetCDF dataset to file

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_write_info_body(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(in) :: self

    Swiftest particle object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to identify a particular NetCDF dataset

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_netcdf_write_info_cb(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_cb), intent(in) :: self

    Swiftest particle object

    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to identify a particular NetCDF dataset

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

    Current run configuration parameters

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(inout) :: self

    Collection of parameters

    integer(kind=I4B), 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.

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

    The first element passes the integrator code to the reader

    integer(kind=I4B), intent(out) :: iostat

    IO status code

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

    Message to pass if iostat /= 0

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(in) :: self

    Collection of parameters

    integer(kind=I4B), 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(kind=I4B), intent(in) :: v_list(:)

    Not used in this procedure

    integer(kind=I4B), intent(out) :: iostat

    IO status code

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

    Message to pass if iostat /= 0

interface

  • public module function swiftest_io_read_frame_body(self, iu, param) result(ierr)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

    integer(kind=I4B), intent(inout) :: iu

    Unit number for the output file to write frame to

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

    Current run configuration parameters

    Return Value integer(kind=I4B)

    Error code: returns 0 if the read is successful

interface

  • public module function swiftest_io_read_frame_system(self, iu, param) result(ierr)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody_system object

    integer(kind=I4B), intent(inout) :: iu

    Unit number for the output file to read frame from

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

    Current run configuration parameters

    Return Value integer(kind=I4B)

    Error code: returns 0 if the read is successful

interface

  • public module subroutine swiftest_io_read_in_body(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest base object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_read_in_cb(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_cb), intent(inout) :: self

    Swiftest base object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_io_read_in_param(self, param_file_name)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(inout) :: self

    Current run configuration parameters

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

    Parameter input file name (i.e. param.in)

interface

  • public module subroutine swiftest_io_read_in_system(self, nc, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self
    class(swiftest_netcdf_parameters), intent(inout) :: nc

    Parameters used to identify a particular NetCDF dataset

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

interface

  • public module subroutine swiftest_io_remove_nul_char(string)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(inout) :: string

    String to remove nul characters from

interface

  • public module subroutine swiftest_io_set_display_param(self, display_style)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_parameters), intent(inout) :: self

    Current run configuration parameters

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

    Style of the output display

interface

  • public module subroutine swiftest_io_toupper(string)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(inout) :: string

    String to make upper case

  • public module subroutine swiftest_kick_getacch_int_all_flat_norad_pl(npl, nplpl, k_plpl, r, Gmass, acc)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: npl

    Number of massive bodies

    integer(kind=I8B), intent(in) :: nplpl

    Number of massive body interactions to compute

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

    Array of interaction pair indices (flattened upper triangular matrix)

    real(kind=DP), intent(in), dimension(:,:) :: r

    Position vector array

    real(kind=DP), intent(in), dimension(:) :: Gmass

    Array of massive body G*mass

    real(kind=DP), intent(inout), dimension(:,:) :: acc

    Acceleration vector array

  • public module subroutine swiftest_kick_getacch_int_all_flat_rad_pl(npl, nplpl, k_plpl, r, Gmass, radius, acc)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: npl

    Number of massive bodies

    integer(kind=I8B), intent(in) :: nplpl

    Number of massive body interactions to compute

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

    Array of interaction pair indices (flattened upper triangular matrix)

    real(kind=DP), intent(in), dimension(:,:) :: r

    Position vector array

    real(kind=DP), intent(in), dimension(:) :: Gmass

    Array of massive body G*mass

    real(kind=DP), intent(in), dimension(:) :: radius

    Array of massive body radii

    real(kind=DP), intent(inout), dimension(:,:) :: acc

    Acceleration vector array

  • public module subroutine swiftest_kick_getacch_int_all_tp(ntp, npl, rtp, rpl, GMpl, lmask, acc)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: ntp

    Number of test particles

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

    Number of massive bodies

    real(kind=DP), intent(in), dimension(:,:) :: rtp

    Test particle position vector array

    real(kind=DP), intent(in), dimension(:,:) :: rpl

    Massive body particle position vector array

    real(kind=DP), intent(in), dimension(:) :: GMpl

    Array of massive body G*mass

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

    Logical mask indicating which test particles should be computed

    real(kind=DP), intent(inout), dimension(:,:) :: acc

    Acceleration vector array

  • public module subroutine swiftest_kick_getacch_int_all_tri_norad_pl(npl, nplm, r, Gmass, acc)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: npl

    Total number of massive bodies

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

    Number of fully interacting massive bodies

    real(kind=DP), intent(in), dimension(:,:) :: r

    Position vector array

    real(kind=DP), intent(in), dimension(:) :: Gmass

    Array of massive body G*mass

    real(kind=DP), intent(inout), dimension(:,:) :: acc

    Acceleration vector array

  • public module subroutine swiftest_kick_getacch_int_all_tri_rad_pl(npl, nplm, r, Gmass, radius, acc)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: npl

    Total number of massive bodies

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

    Number of fully interacting massive bodies

    real(kind=DP), intent(in), dimension(:,:) :: r

    Position vector array

    real(kind=DP), intent(in), dimension(:) :: Gmass

    Array of massive body G*mass

    real(kind=DP), intent(in), dimension(:) :: radius

    Array of massive body radii

    real(kind=DP), intent(inout), dimension(:,:) :: acc

    Acceleration vector array

interface

  • public pure module subroutine swiftest_kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmi, Gmj, axi, ayi, azi, axj, ayj, azj)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: rji2

    Square of distance between the two bodies

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

    Distances between the two bodies in x, y, and z directions

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

    Distances between the two bodies in x, y, and z directions

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

    Distances between the two bodies in x, y, and z directions

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

    G*mass of body i

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

    G*mass of body j

    real(kind=DP), intent(inout) :: axi

    Acceleration vector components of body i

    real(kind=DP), intent(inout) :: ayi

    Acceleration vector components of body i

    real(kind=DP), intent(inout) :: azi

    Acceleration vector components of body i

    real(kind=DP), intent(inout) :: axj

    Acceleration vector components of body j

    real(kind=DP), intent(inout) :: ayj

    Acceleration vector components of body j

    real(kind=DP), intent(inout) :: azj

    Acceleration vector components of body j

interface

  • public pure module subroutine swiftest_kick_getacch_int_one_tp(rji2, xr, yr, zr, Gmpl, ax, ay, az)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: rji2

    Square of distance between the test particle and massive body

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

    Distances between the two bodies in x, y, and z directions

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

    Distances between the two bodies in x, y, and z directions

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

    Distances between the two bodies in x, y, and z directions

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

    G*mass of massive body

    real(kind=DP), intent(inout) :: ax

    Acceleration vector components of test particle

    real(kind=DP), intent(inout) :: ay

    Acceleration vector components of test particle

    real(kind=DP), intent(inout) :: az

    Acceleration vector components of test particle

interface

  • public module subroutine swiftest_kick_getacch_int_pl(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    Current swiftest run configuration parameters

interface

  • public module subroutine swiftest_kick_getacch_int_tp(self, param, GMpl, rhp, npl)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

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

    Current swiftest run configuration parameters

    real(kind=DP), intent(in), dimension(:) :: GMpl

    Massive body masses

    real(kind=DP), intent(in), dimension(:,:) :: rhp

    Massive body position vectors

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

    Number of active massive bodies

interface

  • public module subroutine swiftest_non_spherical_cb_acc_pl(self, nbody_system)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    Swiftest nbody system object

interface

  • public module subroutine swiftest_non_spherical_cb_acc_tp(self, nbody_system)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

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

    Swiftest nbody system object

interface

  • public module subroutine swiftest_obl_acc(n, GMcb, j2rp2, j4rp4, rh, lmask, aobl, rot, GMpl, aoblcb)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: n

    Number of bodies

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

    Central body G*Mass

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

    J2 * R**2 for the central body

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

    J4 * R**4 for the central body

    real(kind=DP), intent(in), dimension(:,:) :: rh

    Heliocentric positions of bodies

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

    Logical mask of bodies to compute aobl

    real(kind=DP), intent(out), dimension(:,:) :: aobl

    Barycentric acceleration of bodies due to central body oblateness

    real(kind=DP), intent(in), dimension(NDIM) :: rot

    Central body rotation matrix

    real(kind=DP), intent(in), optional, dimension(:) :: GMpl

    Masses of input bodies if they are not test particles

    real(kind=DP), intent(out), optional, dimension(:) :: aoblcb

    Barycentric acceleration of central body (only needed if input bodies are massive)

interface

  • public module subroutine swiftest_obl_pot_system(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

interface

  • public module subroutine swiftest_obl_rot_matrix(n, rot, rot_matrix, rot_matrix_inv)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: n

    Number of bodies

    real(kind=DP), intent(in), dimension(NDIM) :: rot

    Central body rotation vector

    real(kind=DP), intent(inout), dimension(NDIM, NDIM) :: rot_matrix

    rotation matrix

    real(kind=DP), intent(inout), dimension(NDIM, NDIM) :: rot_matrix_inv

    inverse of the rotation matrix

interface

  • public pure elemental module subroutine swiftest_orbel_el2xv(mu, a, ie, inc_deg, capom_deg, omega_deg, capm_deg, rx, ry, rz, vx, vy, vz)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: mu

    Gravitational constant

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

    semimajor axis

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

    eccentricity input. If <0 then 0.0 is used

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

    inclination (degrees)

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

    longitude of ascending node (degrees)

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

    argument of periapsis (degrees)

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

    mean anomaly (degrees)

    real(kind=DP), intent(out) :: rx

    Position vector

    real(kind=DP), intent(out) :: ry

    Position vector

    real(kind=DP), intent(out) :: rz

    Position vector

    real(kind=DP), intent(out) :: vx

    Velocity vector

    real(kind=DP), intent(out) :: vy

    Velocity vector

    real(kind=DP), intent(out) :: vz

    Velocity vector

interface

  • public module subroutine swiftest_orbel_el2xv_vec(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public pure module subroutine swiftest_orbel_scget(angle, sx, cx)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: angle
    real(kind=DP), intent(out) :: sx
    real(kind=DP), intent(out) :: cx

interface

  • public pure elemental module subroutine swiftest_orbel_xv2aeq(mu, rx, ry, rz, vx, vy, vz, a, e, q)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: mu

    Gravitational constant

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

    Position vector

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

    Position vector

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

    Position vector

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

    Velocity vector

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

    Velocity vector

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

    Velocity vector

    real(kind=DP), intent(out) :: a

    semimajor axis

    real(kind=DP), intent(out) :: e

    eccentricity

    real(kind=DP), intent(out) :: q

    periapsis

interface

  • public pure module subroutine swiftest_orbel_xv2aqt(mu, rx, ry, rz, vx, vy, vz, a, q, capm, tperi)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: mu

    Gravitational constant

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

    Position vector

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

    Position vector

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

    Position vector

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

    Velocity vector

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

    Velocity vector

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

    Velocity vector

    real(kind=DP), intent(out) :: a

    semimajor axis

    real(kind=DP), intent(out) :: q

    periapsis

    real(kind=DP), intent(out) :: capm

    mean anomaly

    real(kind=DP), intent(out) :: tperi

    time of pericenter passage

interface

  • public pure elemental module subroutine swiftest_orbel_xv2el(mu, rx, ry, rz, vx, vy, vz, a, e, inc, capom, omega, capm, varpi, lam, f, cape, capf)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: mu

    Gravitational constant

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

    Position vector

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

    Position vector

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

    Position vector

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

    Velocity vector

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

    Velocity vector

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

    Velocity vector

    real(kind=DP), intent(out) :: a

    semimajor axis

    real(kind=DP), intent(out) :: e

    eccentricity

    real(kind=DP), intent(out) :: inc

    inclination

    real(kind=DP), intent(out) :: capom

    longitude of ascending node

    real(kind=DP), intent(out) :: omega

    argument of periapsis

    real(kind=DP), intent(out) :: capm

    mean anomaly

    real(kind=DP), intent(out) :: varpi

    longitude of periapsis

    real(kind=DP), intent(out) :: lam

    mean longitude

    real(kind=DP), intent(out) :: f

    true anomaly

    real(kind=DP), intent(out) :: cape

    eccentric anomaly (eccentric orbits)

    real(kind=DP), intent(out) :: capf

    hyperbolic anomaly (hyperbolic orbits)

interface

  • public module subroutine swiftest_orbel_xv2el_vec(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

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

    logical, intent(in) :: lbeg

    Optional argument that determines whether or not this is the beginning or end of the step

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_append_pl(self, source, lsource_mask)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_append_tp(self, source, lsource_mask)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_coord_b2h_pl(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_b2h_tp(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

    class(swiftest_cb), intent(in) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_h2b_pl(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_h2b_tp(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

    class(swiftest_cb), intent(in) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_rh2rb_pl(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_rh2rb_tp(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

    class(swiftest_cb), intent(in) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_vb2vh_pl(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_vb2vh_tp(self, vbcb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

    real(kind=DP), intent(in), dimension(:) :: vbcb

    Barycentric velocity of the central body

interface

  • public module subroutine swiftest_util_coord_vh2vb_pl(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_coord_vh2vb_tp(self, vbcb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

    real(kind=DP), intent(in), dimension(:) :: vbcb

    Barycentric velocity of the central body

interface

  • public module subroutine swiftest_util_copy_particle_info(self, source)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_particle_info), intent(inout) :: self
    class(swiftest_particle_info), intent(in) :: source

interface

  • public module subroutine swiftest_util_copy_particle_info_arr(source, dest, idx)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_particle_info), intent(in), dimension(:) :: source

    Source object to copy into

    class(swiftest_particle_info), intent(inout), dimension(:) :: dest

    Swiftest body object with particle metadata information object

    integer(kind=I4B), intent(in), optional, dimension(:) :: idx

    Optional array of indices to draw the source object

interface

  • public module subroutine swiftest_util_dealloc_body(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

interface

  • public module subroutine swiftest_util_dealloc_cb(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_cb), intent(inout) :: self

    Swiftest central body object

interface

  • public module subroutine swiftest_util_dealloc_kin(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_kinship), intent(inout) :: self

    Swiftest kinship object

interface

  • public module subroutine swiftest_util_dealloc_pl(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

interface

  • public module subroutine swiftest_util_dealloc_storage(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_storage), intent(inout) :: self

    Swiftest storage object

interface

  • public module subroutine swiftest_util_dealloc_system(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

interface

  • public module subroutine swiftest_util_dealloc_tp(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

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

    Swiftest body object to be inserted

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

    Logical array of bodies to merge into the keeps

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    Swiftest body object to be inserted

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

    Logical array of bodies to merge into the keeps

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

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

    Swiftest body object to be inserted

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

    Logical array of bodies to merge into the keeps

interface

  • public pure module subroutine swiftest_util_flatten_eucl_ij_to_k(n, i, j, k)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: n

    Number of bodies

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

    Index of the ith body

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

    Index of the jth body

    integer(kind=I8B), intent(out) :: k

    Index of the flattened matrix

interface

  • public pure module subroutine swiftest_util_flatten_eucl_k_to_ij(n, k, i, j)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: n

    Number of bodies

    integer(kind=I8B), intent(in) :: k

    Index of the flattened matrix

    integer(kind=I4B), intent(out) :: i

    Index of the ith body

    integer(kind=I4B), intent(out) :: j

    Index of the jth body

interface

  • public module subroutine swiftest_util_flatten_eucl_plpl(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_util_flatten_eucl_pltp(self, pl, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

    class(swiftest_pl), intent(in) :: pl

    Swiftest massive body object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_util_get_energy_and_momentum_system(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_util_get_idvalues_system(self, idvals)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(in) :: self

    Encounter snapshot object

    integer(kind=I4B), intent(out), dimension(:), allocatable :: idvals

    Array of all id values saved in this snapshot

  • public module subroutine swiftest_util_get_potential_energy_flat(npl, nplpl, k_plpl, lmask, GMcb, Gmass, mass, rb, pe)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: npl
    integer(kind=I8B), intent(in) :: nplpl
    integer(kind=I4B), intent(in), dimension(:,:) :: k_plpl
    logical, intent(in), dimension(:) :: lmask
    real(kind=DP), intent(in) :: GMcb
    real(kind=DP), intent(in), dimension(:) :: Gmass
    real(kind=DP), intent(in), dimension(:) :: mass
    real(kind=DP), intent(in), dimension(:,:) :: rb
    real(kind=DP), intent(out) :: pe
  • public module subroutine swiftest_util_get_potential_energy_triangular(npl, lmask, GMcb, Gmass, mass, rb, pe)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: npl
    logical, intent(in), dimension(:) :: lmask
    real(kind=DP), intent(in) :: GMcb
    real(kind=DP), intent(in), dimension(:) :: Gmass
    real(kind=DP), intent(in), dimension(:) :: mass
    real(kind=DP), intent(in), dimension(:,:) :: rb
    real(kind=DP), intent(out) :: pe

interface

  • public module subroutine swiftest_util_get_vals_storage(self, idvals, tvals)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_storage), intent(in) :: self

    Swiftest storage object

    integer(kind=I4B), intent(out), dimension(:), allocatable :: idvals

    Array of all id values in all snapshots

    real(kind=DP), intent(out), dimension(:), allocatable :: tvals

    Array of all time values in all snapshots

interface

  • public module subroutine swiftest_util_index_array(ind_arr, n)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(inout), dimension(:), allocatable :: ind_arr

    Index array. Input is a pre-existing index array where n /= size(ind_arr). Output is a new index array ind_arr = [1, 2, … n]

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

    The new size of the index array

interface

  • public module subroutine swiftest_util_index_map_storage(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_storage), intent(inout) :: self

    Swiftest storage object

interface

  • public module subroutine swiftest_util_make_impactors_pl(self, idx)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Massive body object

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

    Array holding the indices of the two bodies involved in the collision)

interface

  • public module subroutine swiftest_util_peri(n, m, r, v, atp, q, isperi)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=I4B), intent(in) :: n

    Number of bodies

    real(kind=DP), intent(in), dimension(:) :: m

    Mass term (mu for HELIO coordinates, and Gmtot for BARY)

    real(kind=DP), intent(in), dimension(:,:) :: r

    Position vectors (rh for HELIO coordinates, rb for BARY)

    real(kind=DP), intent(in), dimension(:,:) :: v

    Position vectors (vh for HELIO coordinates, rb for BARY)

    real(kind=DP), intent(out), dimension(:) :: atp

    Semimajor axis

    real(kind=DP), intent(out), dimension(:) :: q

    Periapsis

    integer(kind=I4B), intent(inout), dimension(:) :: isperi

    Periapsis passage flag

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), 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

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest 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

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body 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 subroutine swiftest_util_rearray_tp(self, nbody_system, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_rescale_system(self, param, mscale, dscale, tscale)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

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

    Current run configuration parameters. Returns with new values of the scale vactors and GU

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

    Scale factors for mass, distance, and time units, respectively.

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

    Scale factors for mass, distance, and time units, respectively.

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

    Scale factors for mass, distance, and time units, respectively.

interface

  • public module subroutine swiftest_util_reset_kinship_pl(self, idx)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    SyMBA massive body object

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

    Index array of bodies to reset

interface

  • public module subroutine swiftest_util_resize_body(self, nnew)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

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

    New size neded

interface

  • public module subroutine swiftest_util_resize_pl(self, nnew)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    New size neded

interface

  • public module subroutine swiftest_util_resize_storage(storage, nold, nnew)

    Arguments

    Type IntentOptional Attributes Name
    class(base_storage), intent(inout), allocatable :: storage

    Original storage object

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

    Old size

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

    New size

interface

  • public module subroutine swiftest_util_resize_tp(self, nnew)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

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

    New size neded

interface

  • public module subroutine swiftest_util_save_discard_body(self, ldiscard_mask, nbody_system, snapshot)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

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

    Logical mask indicating which elements to discard

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

    Swiftest nbody system object

    class(base_nbody_system), intent(inout) :: snapshot

    Nbody system object to store the snapshot of the discard system

interface

  • public module subroutine swiftest_util_set_beg_end_pl(self, rbeg, rend, vbeg)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    real(kind=DP), intent(in), optional, dimension(:,:) :: rbeg

    Position vectors at beginning of step

    real(kind=DP), intent(in), optional, dimension(:,:) :: rend

    Positions vectors at end of step

    real(kind=DP), intent(in), optional, dimension(:,:) :: vbeg

    vbeg is an unused variable to keep this method forward compatible with RMVS

interface

  • public module subroutine swiftest_util_set_ir3h(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

interface

  • public module subroutine swiftest_util_set_msys(self)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody_system object

interface

  • public module subroutine swiftest_util_set_mu_pl(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_set_mu_tp(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest test particle object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_set_particle_info(self, name, particle_type, status, origin_type, origin_time, collision_id, origin_rh, origin_vh, discard_time, discard_rh, discard_vh, discard_body_id)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_particle_info), intent(inout) :: self
    character(len=*), intent(in), optional :: name

    Non-unique name

    character(len=*), intent(in), optional :: particle_type

    String containing a description of the particle type (e.g. Central Body, Massive Body, Test Particle)

    character(len=*), intent(in), optional :: status

    Particle status description: Active, Merged, Fragmented, etc.

    character(len=*), intent(in), optional :: origin_type

    String containing a description of the origin of the particle (e.g. Initial Conditions, Disruption, etc.)

    real(kind=DP), intent(in), optional :: origin_time

    The time of the particle’s formation

    integer(kind=I4B), intent(in), optional :: collision_id

    The ID fo the collision that formed the particle

    real(kind=DP), intent(in), optional, dimension(:) :: origin_rh

    The heliocentric distance vector at the time of the particle’s formation

    real(kind=DP), intent(in), optional, dimension(:) :: origin_vh

    The heliocentric velocity vector at the time of the particle’s formation

    real(kind=DP), intent(in), optional :: discard_time

    The time of the particle’s discard

    real(kind=DP), intent(in), optional, dimension(:) :: discard_rh

    The heliocentric distance vector at the time of the particle’s discard

    real(kind=DP), intent(in), optional, dimension(:) :: discard_vh

    The heliocentric velocity vector at the time of the particle’s discard

    integer(kind=I4B), intent(in), optional :: discard_body_id

    The id of the other body involved in the discard (0 if no other body involved)

interface

  • public module subroutine swiftest_util_set_renc_DP(self, scale)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    Input scale factor (multiplier of Hill’s sphere size)

interface

  • public module subroutine swiftest_util_set_renc_I4B(self, scale)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

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

    Input scale factor (multiplier of Hill’s sphere size)

interface

  • public module subroutine swiftest_util_set_rhill(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

  • public module subroutine swiftest_util_set_rhill_approximate(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest massive body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_setup_construct_system(nbody_system, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout), allocatable :: nbody_system

    Swiftest nbody_system object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_util_setup_initialize_particle_info_system(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

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

    Current run configuration parameters

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_setup_pl(self, n, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_setup_tp(self, n, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

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

interface

  • public module subroutine swiftest_util_snapshot_save(storage, snapshot)

    Arguments

    Type IntentOptional Attributes Name
    class(base_storage), intent(inout), allocatable :: storage

    Storage ncounter storage object

    class(*), intent(in) :: snapshot

    Object to snapshot

interface

  • public module subroutine swiftest_util_snapshot_system(self, param, nbody_system, t, arg)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_storage), intent(inout) :: self

    Swiftest storage object

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

    Current run configuration parameters

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

    Swiftest nbody system object to store

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

    Time of snapshot if different from nbody_system time

    character(len=*), intent(in), optional :: arg

    Optional argument (needed for extended storage type used in collision snapshots)

interface

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

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

    character(len=*), 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 subroutine swiftest_util_sort_pl(self, sortby, ascending)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest body object

    character(len=*), 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 subroutine swiftest_util_sort_rearrange_body(self, ind)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_sort_rearrange_pl(self, ind)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_sort_rearrange_tp(self, ind)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_sort_tp(self, sortby, ascending)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest body object

    character(len=*), 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 subroutine swiftest_util_spill_body(self, discards, lspill_list, ldestructive)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_spill_pl(self, discards, lspill_list, ldestructive)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_pl), intent(inout) :: self

    Swiftest 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 subroutine swiftest_util_spill_tp(self, discards, lspill_list, ldestructive)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_tp), intent(inout) :: self

    Swiftest 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

interface

  • public module subroutine swiftest_util_valid_id_system(self, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest nbody system object

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

    Current run configuration parameters

interface

  • public module subroutine swiftest_util_version()

    Arguments

    None

public interface util_append

  • public module subroutine swiftest_util_append_arr_info(arr, source, nold, lsource_mask)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: arr

    Destination array

    type(swiftest_particle_info), intent(in), dimension(:), allocatable :: source

    Array to append

    integer(kind=I4B), intent(in), optional :: nold

    Extent of original array. If passed, the source array will begin at arr(nold+1). Otherwise, the size of arr will be used.

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

    Logical mask indicating which elements to append to

  • public module subroutine swiftest_util_append_arr_kin(arr, source, nold, lsource_mask)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_kinship), intent(inout), dimension(:), allocatable :: arr

    Destination array

    type(swiftest_kinship), intent(in), dimension(:), allocatable :: source

    Array to append

    integer(kind=I4B), intent(in), optional :: nold

    Extent of original array. If passed, the source array will begin at arr(nold+1). Otherwise, the size of arr will be used.

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

    Logical mask indicating which elements to append to

public interface util_fill

  • public module subroutine swiftest_util_fill_arr_info(keeps, inserts, lfill_list)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: keeps

    Array of values to keep

    type(swiftest_particle_info), intent(in), dimension(:), allocatable :: inserts

    Array of values to insert into keep

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

    Logical array of bodies to merge into the keeps

  • public module subroutine swiftest_util_fill_arr_kin(keeps, inserts, lfill_list)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_kinship), intent(inout), dimension(:), allocatable :: keeps

    Array of values to keep

    type(swiftest_kinship), intent(in), dimension(:), allocatable :: inserts

    Array of values to insert into keep

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

    Logical array of bodies to merge into the keeps

public interface util_resize

  • public module subroutine swiftest_util_resize_arr_info(arr, nnew)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: arr

    Array to resize

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

    New size

  • public module subroutine swiftest_util_resize_arr_kin(arr, nnew)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_kinship), intent(inout), dimension(:), allocatable :: arr

    Array to resize

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

    New size

public interface util_sort_rearrange

  • public module subroutine swiftest_util_sort_rearrange_arr_info(arr, ind, n)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: arr

    Destination array

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

    Index to rearrange against

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

    Number of elements in arr and ind to rearrange

  • public pure module subroutine swiftest_util_sort_rearrange_arr_kin(arr, ind, n)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_kinship), intent(inout), dimension(:), allocatable :: arr

    Destination array

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

    Index to rearrange against

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

    Number of elements in arr and ind to rearrange

public interface util_spill

  • public module subroutine swiftest_util_spill_arr_info(keeps, discards, lspill_list, ldestructive)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: keeps

    Array of values to keep

    type(swiftest_particle_info), intent(inout), dimension(:), allocatable :: discards

    Array of discards

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

    Logical array of bodies to spill into the discardss

    logical, intent(in) :: ldestructive

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

  • public module subroutine swiftest_util_spill_arr_kin(keeps, discards, lspill_list, ldestructive)

    Arguments

    Type IntentOptional Attributes Name
    type(swiftest_kinship), intent(inout), dimension(:), allocatable :: keeps

    Array of values to keep

    type(swiftest_kinship), intent(inout), dimension(:), allocatable :: discards

    Array of discards

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

    Logical array of bodies to spill into the discardss

    logical, intent(in) :: ldestructive

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


Abstract Interfaces

abstract interface

  • public subroutine abstract_accel(self, nbody_system, param, t, lbeg)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

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

    Optional argument that determines whether or not this is the beginning or end of the step

abstract interface

  • public subroutine abstract_discard_body(self, nbody_system, param)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

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

    Swiftest nbody system object

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

    Current run configuration parameters

abstract interface

  • public subroutine abstract_kick_body(self, nbody_system, param, t, dt, lbeg)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest generic body object

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

    Swiftest nbody system objec

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

    Current run configuration parameters

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

    Current time

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

    Stepsize

    logical, intent(in) :: lbeg

    Logical flag indicating whether this is the beginning of the half step or not.

abstract interface

  • public subroutine abstract_set_mu(self, cb)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

    class(swiftest_cb), intent(inout) :: cb

    Swiftest central body object

abstract interface

  • public subroutine abstract_step_body(self, nbody_system, param, t, dt)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_body), intent(inout) :: self

    Swiftest body object

    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

    Simulation time

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

    Current stepsize

abstract interface

  • public subroutine abstract_step_system(self, param, t, dt)

    Arguments

    Type IntentOptional Attributes Name
    class(swiftest_nbody_system), intent(inout) :: self

    Swiftest 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


Derived Types

type, public, abstract, extends(base_object) ::  swiftest_body

An abstract class for a generic collection of Swiftest bodies Superclass that defines the generic elements of a Swiftest particle

Components

Type Visibility Attributes Name Initial
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

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

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

G * (Mcb + [m])

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

Number of bodies

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(abstract_accel), public, deferred :: accel
procedure, public :: accel_user => swiftest_user_kick_getacch_body

Add user-supplied heliocentric accelerations to planets

procedure, public :: append => swiftest_util_append_body

Appends elements from one structure to another

procedure, public :: dealloc => swiftest_util_dealloc_body

Deallocates all allocatable arrays

procedure(abstract_discard_body), public, deferred :: discard
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 :: fill => swiftest_util_fill_body

“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(abstract_kick_body), public, deferred :: kick
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 => swiftest_util_sort_rearrange_body

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

procedure, public :: resize => swiftest_util_resize_body

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

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(abstract_set_mu), public, deferred :: set_mu
procedure, public :: setup => swiftest_util_setup_body

A constructor that sets the number of bodies and allocates all allocatable arrays

procedure, public :: sort => swiftest_util_sort_body

Sorts body arrays by a sortable componen

procedure, public :: spill => swiftest_util_spill_body

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

procedure(abstract_step_body), public, deferred :: step
procedure, public :: v2pv => swiftest_gr_vh2pv_body

Converts from velocity to psudeovelocity for GR calculations using symplectic integrators

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, abstract, extends(base_object) ::  swiftest_cb

Components

Type Visibility Attributes Name Initial
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 :: 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(base_kinship) ::  swiftest_kinship

Class definition for the kinship relationships used in bookkeeping multiple collisions bodies in a single time step.

Components

Type Visibility Attributes Name Initial
integer(kind=I4B), public, dimension(:), allocatable :: child

Index of children particles

integer(kind=I4B), public :: nchild

number of children in merger list

integer(kind=I4B), public :: parent

Index of parent particle

Finalizations Procedures

final :: swiftest_final_kin

Finalizes the Swiftest kinship object - deallocates all allocatables

Type-Bound Procedures

procedure, public :: dealloc => swiftest_util_dealloc_kin

Deallocates all allocatable arrays

type, public, abstract, extends(base_nbody_system) ::  swiftest_nbody_system

An abstract class for a basic Swiftest nbody system This superclass contains a minimial nbody_system of a set of test particles (tp), massive bodies (pl), and a central body (cb).

Components

Type Visibility Attributes Name Initial
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

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

Initialize the nbody_system from input files

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(abstract_step_system), public, deferred :: step

Each integrator will have its own version of the 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(netcdf_parameters) ::  swiftest_netcdf_parameters

Components

Type Visibility Attributes Name Initial
integer(kind=I4B), public :: BE_varid

ID for the system binding energy variable

integer(kind=I4B), public :: E_collisions_varid

ID for the energy lost in collisions variable

character(len=NAMELEN), public :: E_collisions_varname = "E_collisions"

name of the escaped angular momentum y variable

integer(kind=I4B), public :: E_untracked_varid

ID for the energy that is untracked due to loss (due to mergers and body energy for escaped bodies)

character(len=NAMELEN), public :: E_untracked_varname = "E_untracked"

name of the energy that is untracked due to loss (due to mergers and body energy for escaped bodies)

integer(kind=I4B), public :: GMescape_varid

ID for the G*Mass of bodies that escape the system

character(len=NAMELEN), public :: GMescape_varname = "GMescape"

name of the G*Mass of bodies that escape the system

integer(kind=I4B), public :: Gmass_varid

ID for the G*mass variable

character(len=NAMELEN), public :: Gmass_varname = "Gmass"

name of the G*mass variable

integer(kind=I4B), public :: Ip_varid

ID for the axis principal moment of inertia variable

character(len=NAMELEN), public :: Ip_varname = "Ip"

name of the principal moment of inertial variable

integer(kind=I4B), public :: KE_orb_varid

ID for the system orbital kinetic energy variable

integer(kind=I4B), public :: KE_rot_varid

ID for the system rotational kinetic energy variable

integer(kind=I4B), public :: L_escape_varid

ID for the escaped angular momentum vector variable

character(len=NAMELEN), public :: L_escape_varname = "L_escape"

name of the escaped angular momentum vector variable

integer(kind=I4B), public :: L_orbit_varid

ID for the system orbital angular momentum vector variable

character(len=NAMELEN), public :: L_orbit_varname = "L_orbit"

name of the orbital angular momentum vector variable

integer(kind=I4B), public :: L_rot_varid

ID for the system rotational angular momentum vector variable

character(len=NAMELEN), public :: L_rot_varname = "L_rot"

name of the rotational angular momentum vector variable

integer(kind=I4B), public :: PE_varid

ID for the system potential energy variable

integer(kind=I4B), public :: Q_varid

ID for the energy dissipation variable

integer(kind=I4B), public :: TE_varid

ID for the system binding energy variable

integer(kind=I4B), public :: a_varid

ID for the semimajor axis variable

character(len=NAMELEN), public :: a_varname = "a"

name of the semimajor axis variable

character(len=NAMELEN), public :: be_varname = "BE"

name of the system binding energy variable

integer(kind=I4B), public :: c_lm_varid

ID for the c_lm aqrray

character(len=NAMELEN), public :: c_lm_varname = "c_lm"

name for the c_lm array

integer(kind=I4B), public :: cape_varid

ID for the eccentric/hyperbolic anomaly variable

character(len=NAMELEN), public :: cape_varname = "cape"

name of the eccentric/hyperbolic anomaly variable

integer(kind=I4B), public :: capm_varid

ID for the mean anomaly variable

character(len=NAMELEN), public :: capm_varname = "capm"

name of the mean anomaly variable

integer(kind=I4B), public :: capom_varid

ID for the long. asc. node variable

character(len=NAMELEN), public :: capom_varname = "capom"

name of the long. asc. node variable

character(len=NAMELEN), public :: collision_id_dimname = "collision_id"

name of the collision id variable

integer(kind=I4B), public :: collision_id_varid

Netcdf ID for the origin collision ID

integer(kind=I4B), public :: discard_body_id_varid

ID for the id of the other body involved in the discard

character(len=NAMELEN), public :: discard_body_id_varname = "discard_body_id"

name of the id of the other body involved in the discard

integer(kind=I4B), public :: discard_rh_varid

ID for the heliocentric position vector of the body at the time of discard variable

character(len=NAMELEN), public :: discard_rh_varname = "discard_rh"

name of the heliocentric position vector of the body at the time of discard variable

integer(kind=I4B), public :: discard_time_varid

ID for the time of discard variable

character(len=NAMELEN), public :: discard_time_varname = "discard_time"

name of the time of discard variable

integer(kind=I4B), public :: discard_vh_varid

ID for the heliocentric velocity vector of the body at the time of discard variable

character(len=NAMELEN), public :: discard_vh_varname = "discard_vh"

name of the heliocentric velocity vector of the body at the time of discard variable

integer(kind=I4B), public :: e_varid

ID for the eccentricity variable

character(len=NAMELEN), public :: e_varname = "e"

name of the eccentricity variable

integer(kind=I4B), public :: f_varid

ID for the true anomaly variable

character(len=NAMELEN), public :: f_varname = "f"

name of the true anomaly variable

character(len=STRMAX), public :: file_name

Name of the output file

integer(kind=I4B), public :: gr_pseudo_vh_varid

ID for the heliocentric pseudovelocity vector variable (used in GR)

character(len=NAMELEN), public :: gr_pseudo_vh_varname = "gr_pseudo_vh"

name of the heliocentric pseudovelocity vector variable (GR)

integer(kind=I4B), public :: id

ID for the output file

integer(kind=I4B), public :: id_varid

ID for the id variable

character(len=NAMELEN), public :: id_varname = "id"

name of the particle id variable

integer(kind=I4B), public :: idslot = 1

The current id slot that gets passed to the NetCDF reader/writer

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

Array of id values in this NetCDF file

integer(kind=I4B), public :: inc_varid

ID for the inclination variable

character(len=NAMELEN), public :: inc_varname = "inc"

name of the inclination variable

integer(kind=I4B), public :: j2rp2_varid

ID for the j2 variable

character(len=NAMELEN), public :: j2rp2_varname = "j2rp2"

name of the j2rp2 variable

integer(kind=I4B), public :: j4rp4_varid

ID for the j4 variable

character(len=NAMELEN), public :: j4rp4_varname = "j4rp4"

name of the j4pr4 variable

integer(kind=I4B), public :: k2_varid

ID for the Love number variable

character(len=NAMELEN), public :: k2_varname = "k2"

name of the Love number variable

character(len=NAMELEN), public :: ke_orbit_varname = "KE_orbit"

name of the system orbital kinetic energy variable

character(len=NAMELEN), public :: ke_rot_varname = "KE_rot"

name of the system rotational kinetic energy variable

integer(kind=I4B), public :: l_dim_max = 6

Maximum value of the l dimension

integer(kind=I4B), public :: l_dimid

ID for the l dimension for c_lm

character(len=NAMELEN), public :: l_dimname = "l"

name of l dimension for c_lm

integer(kind=I4B), public :: l_varid

ID for the l variable

integer(kind=I4B), public :: lam_varid

ID for the mean longitude variable

character(len=NAMELEN), public :: lam_varname = "lam"

name of the mean longitude variable

logical, public :: lc_lm_exists = .false.

Logical flag to indicate whether or not the c_lm array was present in an old file.

logical, public :: lfile_is_open = .false.

Flag indicating that the linked file is currently open

logical, public :: lpseudo_vel_exists = .false.

Logical flag to indicate whether or not the pseudovelocity vectors were present in an old file.

integer(kind=I4B), public :: m_dim_max = 6

Maximum value of the m dimension

integer(kind=I4B), public :: m_dimid

ID for the m dimension for c_lm

character(len=NAMELEN), public :: m_dimname = "m"

name of m dimension for c_lm

integer(kind=I4B), public :: m_varid

ID for the m variable

integer(kind=I4B), public :: mass_varid

ID for the mass variable

character(len=NAMELEN), public :: mass_varname = "mass"

name of the mass variable

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

Records the last index value of id in the NetCDF file

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

Records the last index value of time in the NetCDF file

integer(kind=I4B), public :: name_dimid

ID for the particle name dimension

character(len=NAMELEN), public :: name_dimname = "name"

name of the particle name dimension

integer(kind=I4B), public :: name_varid

ID for the particle name variable

integer(kind=I4B), public :: npl_varid

ID for the number of active massive bodies variable

character(len=NAMELEN), public :: npl_varname = "npl"

name of the number of active massive bodies variable

integer(kind=I4B), public :: nplm_varid

ID for the number of active fully interacting massive bodies variable (SyMBA)

character(len=NAMELEN), public :: nplm_varname = "nplm"

name of the number of active fully interacting massive bodies variable (SyMBA)

integer(kind=I4B), public :: ntp_varid

ID for the number of active test particles variable

character(len=NAMELEN), public :: ntp_varname = "ntp"

name of the number of active test particles variable

integer(kind=I4B), public :: omega_varid

ID for the arg. of periapsis variable

character(len=NAMELEN), public :: omega_varname = "omega"

name of the arg. of periapsis variable

integer(kind=I4B), public :: origin_rh_varid

ID for the origin position vector variable

character(len=NAMELEN), public :: origin_rh_varname = "origin_rh"

name of the heliocentric position vector of the body at the time of origin variable

integer(kind=I4B), public :: origin_time_varid

ID for the origin time

character(len=NAMELEN), public :: origin_time_varname = "origin_time"

name of the time of origin variable

integer(kind=I4B), public :: origin_type_varid

ID for the origin type

character(len=NAMELEN), public :: origin_type_varname = "origin_type"

name of the origin type variable

integer(kind=I4B), public :: origin_vh_varid

ID for the origin velocity vector component

character(len=NAMELEN), public :: origin_vh_varname = "origin_vh"

name of the heliocentric velocity vector of the body at the time of origin variable

integer(kind=I4B), public :: out_type

output type (will be assigned either NF90_DOUBLE or NF90_FLOAT, depending on the user parameter)

character(len=NAMELEN), public :: pe_varname = "PE"

name of the system potential energy variable

integer(kind=I4B), public :: ptype_varid

ID for the particle type variable

character(len=NAMELEN), public :: ptype_varname = "particle_type"

name of the particle type variable

character(len=NAMELEN), public :: q_varname = "Q"

name of the energy dissipation variable

integer(kind=I4B), public :: radius_varid

ID for the radius variable

character(len=NAMELEN), public :: radius_varname = "radius"

name of the radius variable

integer(kind=I4B), public :: rh_varid

ID for the heliocentric position vector variable

character(len=NAMELEN), public :: rh_varname = "rh"

name of the heliocentric position vector variable

integer(kind=I4B), public :: rhill_varid

ID for the hill radius variable

character(len=NAMELEN), public :: rhill_varname = "rhill"

name of the hill radius variable

integer(kind=I4B), public :: rot_varid

ID for the rotation vector variable

character(len=NAMELEN), public :: rot_varname = "rot"

name of the rotation vector variable

integer(kind=I4B), public :: rotphase_varid

ID for the rotation phase variable

character(len=NAMELEN), public :: rotphase_varname = "rotphase"

name of the rotation phase variable

integer(kind=I4B), public, dimension(2) :: sign_coords = [-1, 1]

The sign dimension coordinate labels

integer(kind=I4B), public :: sign_dimid

ID for sign dimension

character(len=NAMELEN), public :: sign_dimname = "sign"

name of the sign dimension for c_lm

integer(kind=I4B), public :: sign_varid

ID for sign variable

character(len=1), public, dimension(3) :: space_coords = ["x", "y", "z"]

The space dimension coordinate labels

integer(kind=I4B), public :: space_dimid

ID for the space dimension

character(len=NAMELEN), public :: space_dimname = "space"

name of the space dimension

integer(kind=I4B), public :: space_varid

ID for the space variable

integer(kind=I4B), public :: status_varid

ID for the status variable

character(len=NAMELEN), public :: status_varname = "status"

name of the particle status variable

integer(kind=I4B), public :: str_dimid

ID for the character string dimension

character(len=NAMELEN), public :: str_dimname = "string32"

name of the character string dimension

character(len=NAMELEN), public :: te_varname = "TE"

name of the system binding energy variable

integer(kind=I4B), public :: time_dimid

ID for the time dimension

character(len=NAMELEN), public :: time_dimname = "time"

name of the time dimension

integer(kind=I4B), public :: time_varid

ID for the time variable

integer(kind=I4B), public :: tslot = 1

The current time slot that gets passed to the NetCDF reader/writer

integer(kind=I4B), public :: varpi_varid

ID for the long. of periapsis variable

character(len=NAMELEN), public :: varpi_varname = "varpi"

name of the long. of periapsis variable

integer(kind=I4B), public :: vh_varid

ID for the heliocentric velocity vector variable

character(len=NAMELEN), public :: vh_varname = "vh"

name of the heliocentric velocity vector variable

Type-Bound Procedures

procedure, public :: close => netcdf_io_close

Closes an open NetCDF file

procedure, public :: find_idslot => netcdf_io_find_idslot

Finds the id dimension index for a given value of id

procedure, public :: find_tslot => netcdf_io_find_tslot

Finds the time dimension index for a given value of t

procedure, public :: flush => swiftest_io_netcdf_flush

Flushes a NetCDF file by closing it then opening it again

procedure, public :: get_idvals => netcdf_io_get_idvals

Gets the valid id numbers currently stored in this dataset

procedure, public :: get_valid_masks => swiftest_io_netcdf_get_valid_masks

Gets logical masks indicating which bodies are valid pl and tp type at the current time

procedure, public :: initialize => swiftest_io_netcdf_initialize_output

Initialize a set of parameters used to identify a NetCDF output object

procedure, public :: open => swiftest_io_netcdf_open

Opens a NetCDF file and does the variable inquiries to activate variable ids

procedure, public :: sync => netcdf_io_sync

Syncrhonize the disk and memory buffer of the NetCDF file (e.g. commit the frame files stored in memory to disk)

type, public, extends(base_parameters) ::  swiftest_parameters

Components

Type Visibility Attributes Name Initial
real(kind=QP), public :: DU2M = -1.0_QP

Converts distance unit to centimeters

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

Energy lost from system due to collisions

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 system due to escaped bodies

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

Smallest G*mass that is fully gravitating

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

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

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

Initial system mass

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

Universal gravitational constant in the system units

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

Angular momentum of escaped bodies (used for bookeeping)

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

Initial orbital angular momentum

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_orig = 0.0_DP

Initial total angular momentum vector

real(kind=QP), public :: MU2KG = -1.0_QP

Converts mass units to grams

real(kind=QP), public :: TU2S = -1.0_QP

Converts time units to seconds

character(len=STRMAX), public :: collision_model = "MERGE"

The Coll

character(len=NAMELEN), public :: display_style

Style of the output display [{“PROGRESS”}, “CLASSIC”, “QUIET”, “COMPACT”]).

integer(kind=I4B), public :: display_unit = OUTPUT_UNIT

File unit number for display (either to stdout or to a log file)

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

Time step

integer(kind=I4B), public :: dump_cadence = 10

Number of output steps between dumping simulation data to file

character(len=NAMELEN), public :: encounter_check_plpl = "ADAPTIVE"

Method used to compute pl-pl encounter checks.
Options are “TRIANGULAR”, “SORTSWEEP”, or “ADAPTIVE”

character(len=NAMELEN), public :: encounter_check_pltp = "ADAPTIVE"

Method used to compute pl-tp encounter checks.
Options are “TRIANGULAR”, “SORTSWEEP”, or “ADAPTIVE”

character(len=STRMAX), public :: encounter_save = "NONE"

Indicate if and how encounter data should be saved

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

The output step time stretching factor

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

Dump cadence counter

integer(kind=I8B), public :: iloop = 0_I8B

Main loop counter

character(len=STRMAX), public :: in_form = "XV"

Format of input data files (“EL” or [“XV”])

character(len=STRMAX), public :: in_type = "NETCDF_DOUBLE"

Data representation type of input data files

character(len=STRMAX), public :: incbfile = CB_INFILE

Name of input file for the central body

character(len=STRMAX), public :: inplfile = PL_INFILE

Name of input file for massive bodies

character(len=STRMAX), public :: integrator

Name of the nbody integrator used

character(len=NAMELEN), public :: interaction_loops = "ADAPTIVE"

Method used to compute interaction loops.
Options are “TRIANGULAR”, “FLAT”, or “ADAPTIVE”

character(len=STRMAX), public :: intpfile = TP_INFILE

Name of input file for test particles

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

Inverse speed of light squared in the system units

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

Output cadence counter

integer(kind=I8B), public :: istart = 0_I8B

Starting index for loop counter

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

Current value of istep (used for time stretching)

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

Number of time steps between saved outputs

logical, public :: lbig_discard = .false.

Save big bodies on every discard

logical, public :: lclose = .false.

Turn on close encounters

logical, public :: lcoarray = .false.

Use Coarrays for test particle parallelization.

logical, public :: lenc_save_closest = .false.

Indicates that when encounters are saved, the closest approach distance between pairs of bodies is saved

logical, public :: lenc_save_trajectory = .false.

Indicates that when encounters are saved, the full trajectory through recursion steps are saved

logical, public :: lencounter_sas_plpl = .false.

Use the Sort and Sweep algorithm to prune the encounter list before checking for close encounters

logical, public :: lencounter_sas_pltp = .false.

Use the Sort and Sweep algorithm to prune the encounter list before checking for close encounters

logical, public :: lenergy = .false.

Track the total energy of the system

logical, public :: lextra_force = .false.

User defined force function turned on

logical, public :: lfirstenergy = .true.

This is the first time computing energe

logical, public :: lfirstkick = .true.

Initiate the first kick in a symplectic step

logical, public :: lflatten_interactions = .false.

Use the flattened upper triangular matrix for pl-pl interaction loops

logical, public :: lgr = .false.

Turn on GR

logical, public :: lmtiny_pl = .false.

Include semi-interacting massive bodies

logical, public :: lnon_spherical_cb = .false.

Calculate acceleration from oblate central body (automatically turns true if nonzero J2, J4, or c_lm is input)

logical, public :: log_output = .false.

Logs the output to file instead of displaying it on the terminal

logical, public :: lrestart = .false.

Indicates whether or not this is a restarted run

logical, public :: lrhill_present = .false.

Hill radii are given as an input rather than calculated by the code (can be used to inflate close encounter regions manually)

logical, public :: lrotation = .false.

Include rotation states of big bodies

logical, public :: ltides = .false.

Include tidal dissipation

logical, public :: ltstretch = .false.

Whether to employ time stretching or not

logical, public :: lyarkovsky = .false.

Turn on Yarkovsky effect

logical, public :: lyorp = .false.

Turn on YORP effect

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

Smallest G*mass that can be produced in a fragmentation event

character(len=STRMAX), public :: nc_in = NC_INFILE

Name of system input file for NetCDF input

real(kind=DP), public :: nfrag_reduction = 30.0_DP

Reduction factor for limiting the number of collision fragments

integer(kind=I8B), public :: nloops = 0_I8B

Total number of loops to execute

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

Current output step

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

Total number of saved outputs

character(len=STRMAX), public :: out_form = "XVEL"

Data to write to output file

character(len=STRMAX), public :: out_stat = 'NEW'

Open status for output binary file

character(len=STRMAX), public :: out_type = "NETCDF_DOUBLE"

Binary format of output file

character(len=STRMAX), public :: outfile = BIN_OUTFILE

Name of output binary file

character(len=STRMAX), public :: param_file_name

The name of the parameter file

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

Minimum pericenter distance for test particle

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

Maximum semimajor axis for qmin

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

Minimum semimajor axis for qmin

character(len=STRMAX), public :: qmin_coord = "HELIO"

Coordinate frame to use for qmin ([“HELIO”] or “BARY”)

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

Maximum heliocentric radius for test particle

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

Maximum unbound heliocentric radius for test particle

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

Minimum heliocentric radius for test particle

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

Random seeds for fragmentation modeling

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

Integration reference time

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

Integration start time

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

Integration stop time

Type-Bound Procedures

procedure, public :: dealloc => base_util_dealloc_param
procedure, public :: dump => swiftest_io_dump_param
procedure, public :: read_in => swiftest_io_read_in_param
procedure, public :: reader => swiftest_io_param_reader
procedure, public :: set_display => swiftest_io_set_display_param
procedure, public :: writer => swiftest_io_param_writer

type, public, extends(base_particle_info) ::  swiftest_particle_info

Components

Type Visibility Attributes Name Initial
integer(kind=I4B), public :: collision_id = 0

The ID of the collision that formed the particle

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

The id of the other body involved in the discard (0 if no other body involved)

real(kind=DP), public, dimension(NDIM) :: discard_rh = [0.0_DP, 0.0_DP, 0.0_DP]

The heliocentric distance vector at the time of the particle’s discard

real(kind=DP), public :: discard_time = huge(1.0_DP)

The time of the particle’s discard

real(kind=DP), public, dimension(NDIM) :: discard_vh = [0.0_DP, 0.0_DP, 0.0_DP]

The heliocentric velocity vector at the time of the particle’s discard

character(len=NAMELEN), public :: name

Non-unique name

real(kind=DP), public, dimension(NDIM) :: origin_rh = [0.0_DP, 0.0_DP, 0.0_DP]

The heliocentric distance vector at the time of the particle’s formation

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

The time of the particle’s formation

character(len=NAMELEN), public :: origin_type

String containing a description of the origin of the particle (e.g. Initial Conditions, Disruption, etc.)

real(kind=DP), public, dimension(NDIM) :: origin_vh = [0.0_DP, 0.0_DP, 0.0_DP]

The heliocentric velocity vector at the time of the particle’s formation

character(len=NAMELEN), public :: particle_type

String containing a description of the particle type (e.g. Central Body, Massive Body, Test Particle)

character(len=NAMELEN), public :: status

Particle status description: Active, Merged, Fragmented, etc.

Type-Bound Procedures

procedure, public :: copy => swiftest_util_copy_particle_info

Copies one set of information object components into another, component-by-component

procedure, public :: set_value => swiftest_util_set_particle_info

Sets one or more values of the particle information metadata object

type, public, abstract, extends(swiftest_body) ::  swiftest_pl

Superclass that defines the generic elements of a Swiftest particle

Components

Type Visibility Attributes Name Initial
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

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(abstract_accel), public, deferred :: accel
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 => swiftest_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 => swiftest_util_dealloc_pl

Deallocates all allocatable arrays

procedure, public :: discard => swiftest_discard_pl

Placeholder method for discarding massive bodies

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 :: fill => swiftest_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 :: h2b => swiftest_util_coord_h2b_pl

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

procedure(abstract_kick_body), public, deferred :: kick
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 => swiftest_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 => swiftest_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 => 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 => 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 => swiftest_util_setup_pl

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

Read more…
procedure, public :: sort => swiftest_util_sort_pl

Sorts body arrays by a sortable component

procedure, public :: spill => swiftest_util_spill_pl

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

procedure(abstract_step_body), public, deferred :: step
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(base_storage) ::  swiftest_storage

Components

Type Visibility Attributes Name Initial
type(base_storage_frame), public, dimension(:), allocatable :: frame

Array of stored frames

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

The id value -> index map

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

The set of unique id values contained in the snapshots

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

Index of the last frame stored in the system

class(swiftest_netcdf_parameters), public, allocatable :: nc

NetCDF object attached to this storage object

integer(kind=I4B), public :: nframes

Total number of frames that can be stored An class that establishes the pattern for various storage objects

integer(kind=I4B), public :: nid

Number of unique id values in all saved snapshots

integer(kind=I4B), public :: nt

Number of unique time values in all saved snapshots

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

The t value -> index map

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

The set of unique time values contained in the snapshots

Finalizations Procedures

final :: swiftest_final_storage

Type-Bound Procedures

procedure, public :: dealloc => swiftest_util_dealloc_storage

Resets a storage object by deallocating all items and resetting the frame counter to 0

procedure, public :: dump => swiftest_io_dump_storage

Dumps storage object contents to file

procedure, public :: get_index_values => swiftest_util_get_vals_storage

Gets the unique values of the indices of a storage object (i.e. body id or time value)

procedure, public :: make_index_map => swiftest_util_index_map_storage

Maps body id values to storage index values so we don’t have to use unlimited dimensions for id

procedure, public :: reset => base_util_reset_storage

Resets the storage object back to its original state by removing all of the saved items from the storage frames

procedure, public :: resize => base_util_resize_storage

Resizes storage if it is too small

procedure, public :: save => base_util_snapshot_save

Takes a snapshot of the current system

procedure, public :: setup => base_util_setup_storage

Sets up a storage system with a set number of frames

procedure, public :: take_snapshot => swiftest_util_snapshot_system

Takes a snapshot of the nbody_system for later file storage

type, public, abstract, extends(swiftest_body) ::  swiftest_tp

Superclass that defines the generic elements of a Swiftest test particle

Components

Type Visibility Attributes Name Initial
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

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(abstract_accel), public, deferred :: accel
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 => swiftest_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 => swiftest_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 => 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 :: fill => swiftest_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 :: h2b => swiftest_util_coord_h2b_tp

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

procedure(abstract_kick_body), public, deferred :: kick
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 => swiftest_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 => swiftest_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 => swiftest_util_setup_tp

A base constructor that sets the number of bodies and

procedure, public :: sort => swiftest_util_sort_tp

Sorts body arrays by a sortable component

procedure, public :: spill => swiftest_util_spill_tp

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

procedure(abstract_step_body), public, deferred :: step
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 swiftest_final_kin(self)

Author
David A. Minton

Finalize the swiftest kinship object - deallocates all allocatables

Arguments

Type IntentOptional Attributes Name
type(swiftest_kinship), intent(inout) :: self

SyMBA kinship object

public subroutine swiftest_final_storage(self)

Author
David A. Minton

Finalizer for the storage data type

Arguments

Type IntentOptional Attributes Name
type(swiftest_storage) :: self

Swiftest storage object