whm Module

Definition of classes and methods specific to the Democratic Heliocentric Method Partially adapted from David E. Kaufmann’s Swifter module: module_whm.f90


Uses

  • module~~whm~~UsesGraph module~whm whm module~swiftest swiftest module~whm->module~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~~whm~~UsedByGraph module~whm whm module~helio helio module~helio->module~whm module~rmvs rmvs module~rmvs->module~whm module~s_swiftest_util s_swiftest_util module~s_swiftest_util->module~whm module~s_swiftest_util->module~helio module~s_swiftest_util->module~rmvs module~symba symba module~s_swiftest_util->module~symba module~s_whm_coord s_whm_coord module~s_whm_coord->module~whm module~s_whm_gr s_whm_gr module~s_whm_gr->module~whm module~s_whm_kick s_whm_kick module~s_whm_kick->module~whm module~s_whm_step s_whm_step module~s_whm_step->module~whm module~s_whm_util s_whm_util module~s_whm_util->module~whm module~whm_drift whm_drift module~whm_drift->module~whm module~s_helio_drift s_helio_drift module~s_helio_drift->module~helio module~s_helio_gr s_helio_gr module~s_helio_gr->module~helio module~s_helio_kick s_helio_kick module~s_helio_kick->module~helio module~s_helio_step s_helio_step module~s_helio_step->module~helio module~s_helio_util s_helio_util module~s_helio_util->module~helio module~s_rmvs_discard s_rmvs_discard module~s_rmvs_discard->module~rmvs module~s_rmvs_encounter_check s_rmvs_encounter_check module~s_rmvs_encounter_check->module~rmvs module~s_rmvs_kick s_rmvs_kick module~s_rmvs_kick->module~rmvs module~s_rmvs_step s_rmvs_step module~s_rmvs_step->module~rmvs module~s_rmvs_util s_rmvs_util module~s_rmvs_util->module~rmvs module~symba->module~helio module~s_collision_check s_collision_check module~s_collision_check->module~symba module~s_fraggle_generate s_fraggle_generate module~s_fraggle_generate->module~symba module~s_swiftest_io s_swiftest_io module~s_swiftest_io->module~symba module~s_symba_discard s_symba_discard module~s_symba_discard->module~symba module~s_symba_drift s_symba_drift module~s_symba_drift->module~symba module~s_symba_encounter_check s_symba_encounter_check module~s_symba_encounter_check->module~symba module~s_symba_gr s_symba_gr module~s_symba_gr->module~symba module~s_symba_kick s_symba_kick module~s_symba_kick->module~symba module~s_symba_step s_symba_step module~s_symba_step->module~symba module~s_symba_util s_symba_util module~s_symba_util->module~symba

Interfaces

public interface coclone

  • public subroutine whm_coarray_coclone_tp(tp)

    Author
    David A. Minton

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

    Arguments

    Type IntentOptional Attributes Name
    type(whm_tp), intent(inout), codimension[*] :: tp

    WHM tp object

public interface cocollect

  • public subroutine whm_coarray_cocollect_tp(tp)

    Author
    David A. Minton

    Collects all object array components from all images and combines them into the image 1 object

    Arguments

    Type IntentOptional Attributes Name
    type(whm_tp), intent(inout), codimension[*] :: tp

    Swiftest body object

interface

  • public module subroutine whm_coord_h2j_pl(self, cb)

    Arguments

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

    WHM massive body particle data structure

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

    Swiftest central body particle data structuree

interface

  • public module subroutine whm_coord_j2h_pl(self, cb)

    Arguments

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

    WHM massive body particle data structure

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

    Swiftest central body particle data structuree

interface

  • public module subroutine whm_coord_vh2vj_pl(self, cb)

    Arguments

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

    WHM massive body particle data structure

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

    Swiftest central body particle data structuree

interface

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

    Arguments

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

    WHM massive body particle data structure

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

    WHM nbody system object

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

    Current run configuration parameters

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

    Stepsize

interface

  • public pure module subroutine whm_gr_kick_getacch_pl(self, param)

    Arguments

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

    WHM massive body particle data structure

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

    Current run configuration parameters

interface

  • public pure module subroutine whm_gr_kick_getacch_tp(self, param)

    Arguments

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

    WHM test particle data structure

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

    Current run configuration parameters

interface

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

    Arguments

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

    WHM massive body object

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

    Swiftest nbody system

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

    Current run configuration parameters

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

    Step size

interface

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

    Arguments

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

    WHM test particle object

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

    Swiftest nbody system

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

    Current run configuration parameters

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

    Step size

interface

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

    Get heliocentric accelration of massive bodies

    Arguments

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

    WHM massive body particle data structure

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

    WHM nbody system object

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

    Current run configuration parameters

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

    Current simulation time

    logical, intent(in) :: lbeg

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

interface

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

    Get heliocentric accelration of the test particle

    Arguments

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

    WHM test particle data structure

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

    WHM nbody system object

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

    Current run configuration parameters

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

    Current time

    logical, intent(in) :: lbeg

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

interface

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

    Arguments

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

    WHM 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

    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.

interface

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

    Arguments

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

    WHM 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

    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.

interface

  • public module subroutine whm_step_pl(self, nbody_system, param, t, dt)

    Arguments

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

    WHM 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

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

    Simulation time

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

    Current stepsize

interface

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

    Arguments

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

    WHM nbody_system object

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

    Current run configuration parameters

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

    Simulation time

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

    Current stepsize

interface

  • public module subroutine whm_step_tp(self, nbody_system, param, t, dt)

    Arguments

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

    WHM test particle data structure

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

    Swiftest nbody system object

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

    Current run configuration parameters

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

    Current simulation time

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

    Stepsize

interface

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

    Arguments

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

    WHM 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 whm_util_dealloc_pl(self)

    Arguments

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

    WHM massive body object

interface

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

    Arguments

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

    WHM massive body object

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

    inserted object

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

    Logical array of bodies to merge into the keeps

interface

  • public module subroutine whm_util_resize_pl(self, nnew)

    Arguments

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

    WHM massive body object

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

    New size neded

interface

  • public module subroutine whm_util_set_ir3j(self)

    Arguments

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

    WHM massive body object

interface

  • public module subroutine whm_util_set_mu_eta_pl(self, cb)

    Arguments

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

    WHM massive body object

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

    Swiftest central body object

interface

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

    Arguments

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

    WHM 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 whm_util_setup_pl(self, n, param)

    Reads WHM massive body object in from file

    Arguments

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

    WHM massive body objectobject

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

    Arguments

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

    WHM massive 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 whm_util_sort_rearrange_pl(self, ind)

    Arguments

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

    WHM 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 whm_util_spill_pl(self, discards, lspill_list, ldestructive)

    Arguments

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

    WHM 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


Derived Types

type, public, extends(swiftest_cb) ::  whm_cb

Swiftest central body particle class

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(swiftest_nbody_system) ::  whm_nbody_system

An abstract class for the WHM integrator nbody system

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

Finalizations Procedures

final :: whm_final_system

Finalizes the WHM nbody_system object - deallocates all allocatables

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 => whm_util_setup_initialize_system ../../../../

Performs WHM-specific initilization steps, like calculating the Jacobi masses

procedure, public :: initialize_output_file => swiftest_io_initialize_output_file_system ../../../../

Write a frame of input data from file

procedure, public :: obl_pot => swiftest_obl_pot_system ../../../../

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

procedure, public :: read_frame => swiftest_io_netcdf_read_frame_system ../../../../

Read in a frame of input data from file

procedure, public :: read_hdr => swiftest_io_netcdf_read_hdr_system ../../../../

Read a header for an output frame in NetCDF format

procedure, public :: read_in => swiftest_io_read_in_system ../../../../

Reads the initial conditions for an nbody system

procedure, public :: read_particle_info => swiftest_io_netcdf_read_particle_info_system ../../../../

Read in particle metadata from file

procedure, public :: rescale => swiftest_util_rescale_system ../../../../

Rescales the nbody_system into a new set of units

procedure, public :: set_msys => swiftest_util_set_msys ../../../../

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

procedure, public :: step => whm_step_system ../../../../

Advance the WHM nbody system forward in time by one step

procedure, public :: validate_ids => swiftest_util_valid_id_system ../../../../

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

procedure, public :: write_frame => swiftest_io_netcdf_write_frame_system ../../../../

Write a frame of input data from file

procedure, public :: write_hdr => swiftest_io_netcdf_write_hdr_system ../../../../

Write a header for an output frame in NetCDF format

type, public, extends(swiftest_pl) ::  whm_pl

WHM massive body particle class

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

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

Jacobi mass

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

Identifier

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

Inclination

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

Particle metadata information

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

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

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

Third term of heliocentric acceleration

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

perihelion passage flag

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

Tidal Love number

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

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

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

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

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

flag indicating whether body has merged with another this time step

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

Body should be discarded

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

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

logical, public :: lfirst = .true.

Run the current step as a first

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

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

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

flag indicating whether this body is below the GMTINY cutoff value

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

Body mass (units MU)

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

G * (Mcb + [m])

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

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

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

Number of bodies

integer(kind=I4B), public, dimension(:), allocatable :: 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

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

Jacobi velocity

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

Jacobi position

Finalizations Procedures

final :: whm_final_pl

Finalizes the WHM massive body object - deallocates all allocatables

Type-Bound Procedures

procedure, public :: accel => whm_kick_getacch_pl ../../../../

Compute heliocentric accelerations of massive bodies

procedure, public :: accel_gr => whm_gr_kick_getacch_pl ../../../../

Acceleration term arising from the post-Newtonian correction

procedure, public :: accel_int => swiftest_kick_getacch_int_pl ../../../../

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

procedure, public :: accel_non_spherical_cb => swiftest_non_spherical_cb_acc_pl ../../../../

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

procedure, public :: accel_user => swiftest_user_kick_getacch_body ../../../../

Add user-supplied heliocentric accelerations to planets

procedure, public :: append => whm_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 => whm_util_dealloc_pl ../../../../

Deallocates all allocatable arrays

procedure, public :: discard => swiftest_discard_pl ../../../../

Placeholder method for discarding massive bodies

procedure, public :: drift => whm_drift_pl ../../../../

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

procedure, public :: el2xv => swiftest_orbel_el2xv_vec ../../../../

Convert orbital elements to position and velocity vectors

procedure, public :: fill => whm_util_fill_pl ../../../../

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

procedure, public :: flatten => swiftest_util_flatten_eucl_plpl ../../../../

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

procedure, public :: get_peri => swiftest_util_peri_body ../../../../

Determine nbody_system pericenter passages for test particles

procedure, public :: gr_pos_kick => whm_gr_p4_pl ../../../../

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

procedure, public :: h2b => swiftest_util_coord_h2b_pl ../../../../

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

procedure, public :: h2j => whm_coord_h2j_pl ../../../../

Convert position and velcoity vectors from heliocentric to Jacobi coordinates

procedure, public :: j2h => whm_coord_j2h_pl ../../../../

Convert position and velcoity vectors from Jacobi to helliocentric coordinates

procedure, public :: kick => whm_kick_vh_pl ../../../../

Kick heliocentric velocities of massive bodies

procedure, public :: make_impactors => swiftest_util_make_impactors_pl ../../../../

Make impactors out of the current kinship relationships

procedure, public :: pv2v => swiftest_gr_pv2vh_body ../../../../

Converts from psudeovelocity to velocity for GR calculations using symplectic integrators

generic, public :: read_frame => read_frame_bin ../../../../

Add the generic read frame for Fortran binary files

procedure, public :: read_frame_bin => swiftest_io_read_frame_body ../../../../

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

procedure, public :: read_in => swiftest_io_read_in_body ../../../../

Read in body initial conditions from an ascii file

procedure, public :: rearrange => whm_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 => whm_util_resize_pl ../../../../

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

procedure, public :: rh2rb => swiftest_util_coord_rh2rb_pl ../../../../

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

procedure, public :: save_discard => swiftest_util_save_discard_body ../../../../

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

procedure, public :: set_beg_end => swiftest_util_set_beg_end_pl ../../../../

Sets the beginning and ending positions and velocities of planets.

procedure, public :: set_ir3 => whm_util_set_ir3j ../../../../

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

procedure, public :: set_mu => whm_util_set_mu_eta_pl ../../../../

Sets the Jacobi mass value for all massive bodies.

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

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

procedure, public :: set_renc_I4B => swiftest_util_set_renc_I4B ../../../../

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

procedure, public :: set_rhill => swiftest_util_set_rhill ../../../../

Calculates the Hill’s radii for each body

procedure, public :: setup => whm_util_setup_pl ../../../../

Constructor method - Allocates space for the input number of bodiess

procedure, public :: sort => whm_util_sort_pl ../../../../

Sort a WHM massive body object in-place.

procedure, public :: spill => whm_util_spill_pl ../../../../

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

procedure, public :: step => whm_step_pl ../../../../

Steps the body forward one stepsize

procedure, public :: v2pv => swiftest_gr_vh2pv_body ../../../../

Converts from velocity to psudeovelocity for GR calculations using symplectic integrators

procedure, public :: vb2vh => swiftest_util_coord_vb2vh_pl ../../../../

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

procedure, public :: vh2vb => swiftest_util_coord_vh2vb_pl ../../../../

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

procedure, public :: vh2vj => whm_coord_vh2vj_pl ../../../../

Convert velocity vectors from heliocentric to Jacobi coordinates

procedure, public :: write_frame => swiftest_io_netcdf_write_frame_body ../../../../

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

procedure, public :: write_info => swiftest_io_netcdf_write_info_body ../../../../

Dump contents of particle information metadata to file

procedure, public :: xv2el => swiftest_orbel_xv2el_vec ../../../../

Convert position and velocity vectors to orbital elements

type, public, extends(swiftest_tp) ::  whm_tp

WHM test particle class

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

Finalizations Procedures

final :: whm_final_tp

Finalizes the WHM test particle object - deallocates all allocatables

Type-Bound Procedures

procedure, public :: accel => whm_kick_getacch_tp ../../../../

Compute heliocentric accelerations of test particles

procedure, public :: accel_gr => whm_gr_kick_getacch_tp ../../../../

Acceleration term arising from the post-Newtonian correction

procedure, public :: accel_int => swiftest_kick_getacch_int_tp ../../../../

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

procedure, public :: accel_non_spherical_cb => swiftest_non_spherical_cb_acc_tp ../../../../

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

procedure, public :: accel_user => swiftest_user_kick_getacch_body ../../../../

Add user-supplied heliocentric accelerations to planets

procedure, public :: append => 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 :: gr_pos_kick => whm_gr_p4_tp ../../../../

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

procedure, public :: h2b => swiftest_util_coord_h2b_tp ../../../../

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

procedure, public :: kick => whm_kick_vh_tp ../../../../

Kick heliocentric velocities of test particles

procedure, public :: pv2v => swiftest_gr_pv2vh_body ../../../../

Converts from psudeovelocity to velocity for GR calculations using symplectic integrators

generic, public :: read_frame => read_frame_bin ../../../../

Add the generic read frame for Fortran binary files

procedure, public :: read_frame_bin => swiftest_io_read_frame_body ../../../../

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

procedure, public :: read_in => swiftest_io_read_in_body ../../../../

Read in body initial conditions from an ascii file

procedure, public :: rearrange => 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, public :: step => whm_step_tp ../../../../

Steps the particle forward one stepsize

procedure, public :: v2pv => swiftest_gr_vh2pv_body ../../../../

Converts from velocity to psudeovelocity for GR calculations using symplectic integrators

procedure, public :: vb2vh => swiftest_util_coord_vb2vh_tp ../../../../

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

procedure, public :: vh2vb => swiftest_util_coord_vh2vb_tp ../../../../

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

procedure, public :: write_frame => swiftest_io_netcdf_write_frame_body ../../../../

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

procedure, public :: write_info => swiftest_io_netcdf_write_info_body ../../../../

Dump contents of particle information metadata to file

procedure, public :: xv2el => swiftest_orbel_xv2el_vec ../../../../

Convert position and velocity vectors to orbital elements


Subroutines

public subroutine whm_coarray_coclone_tp(tp)

Author
David A. Minton

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

Arguments

Type IntentOptional Attributes Name
type(whm_tp), intent(inout), codimension[*] :: tp

WHM tp object

public subroutine whm_coarray_cocollect_tp(tp)

Author
David A. Minton

Collects all object array components from all images and combines them into the image 1 object

Arguments

Type IntentOptional Attributes Name
type(whm_tp), intent(inout), codimension[*] :: tp

Swiftest body object

public subroutine whm_final_pl(self)

Author
David A. Minton

Finalize the WHM massive body object - deallocates all allocatables

Arguments

Type IntentOptional Attributes Name
type(whm_pl), intent(inout) :: self

WHM massive body object

public subroutine whm_final_system(self)

Author
David A. Minton

Finalize the WHM nbody system object - deallocates all allocatables

Arguments

Type IntentOptional Attributes Name
type(whm_nbody_system), intent(inout) :: self

WHM nbody system object

public subroutine whm_final_tp(self)

Author
David A. Minton

Finalize the WHM test particle object - deallocates all allocatables

Arguments

Type IntentOptional Attributes Name
type(whm_tp), intent(inout) :: self

WHM test particle object