globals_module.f90 Source File

Copyright 2026 - The Minton Group at Purdue University This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Swiftest. If not, see: https://www.gnu.org/licenses.


Files dependent on this one

sourcefile~~globals_module.f90~~AfferentGraph sourcefile~globals_module.f90 globals_module.f90 sourcefile~base_module.f90 base_module.f90 sourcefile~base_module.f90->sourcefile~globals_module.f90 sourcefile~coarray_module.f90 coarray_module.f90 sourcefile~base_module.f90->sourcefile~coarray_module.f90 sourcefile~coarray_module.f90->sourcefile~globals_module.f90 sourcefile~collision_module.f90 collision_module.f90 sourcefile~collision_module.f90->sourcefile~globals_module.f90 sourcefile~collision_module.f90->sourcefile~base_module.f90 sourcefile~encounter_module.f90 encounter_module.f90 sourcefile~collision_module.f90->sourcefile~encounter_module.f90 sourcefile~encounter_module.f90->sourcefile~globals_module.f90 sourcefile~encounter_module.f90->sourcefile~base_module.f90 sourcefile~netcdf_io_module.f90 netcdf_io_module.f90 sourcefile~encounter_module.f90->sourcefile~netcdf_io_module.f90 sourcefile~io_progress_bar_module.f90 io_progress_bar_module.f90 sourcefile~io_progress_bar_module.f90->sourcefile~globals_module.f90 sourcefile~io_progress_bar_module.f90->sourcefile~base_module.f90 sourcefile~lambda_function_module.f90 lambda_function_module.f90 sourcefile~lambda_function_module.f90->sourcefile~globals_module.f90 sourcefile~laplace_coefficient_module.f90 laplace_coefficient_module.f90 sourcefile~laplace_coefficient_module.f90->sourcefile~globals_module.f90 sourcefile~netcdf_io_module.f90->sourcefile~globals_module.f90 sourcefile~netcdf_io_module.f90->sourcefile~base_module.f90 sourcefile~operator_module.f90 operator_module.f90 sourcefile~operator_module.f90->sourcefile~globals_module.f90 sourcefile~solver_module.f90 solver_module.f90 sourcefile~solver_module.f90->sourcefile~globals_module.f90 sourcefile~solver_module.f90->sourcefile~base_module.f90 sourcefile~solver_module.f90->sourcefile~lambda_function_module.f90 sourcefile~swiftest_module.f90 swiftest_module.f90 sourcefile~swiftest_module.f90->sourcefile~globals_module.f90 sourcefile~swiftest_module.f90->sourcefile~base_module.f90 sourcefile~swiftest_module.f90->sourcefile~collision_module.f90 sourcefile~swiftest_module.f90->sourcefile~encounter_module.f90 sourcefile~swiftest_module.f90->sourcefile~io_progress_bar_module.f90 sourcefile~swiftest_module.f90->sourcefile~lambda_function_module.f90 sourcefile~swiftest_module.f90->sourcefile~laplace_coefficient_module.f90 sourcefile~swiftest_module.f90->sourcefile~netcdf_io_module.f90 sourcefile~swiftest_module.f90->sourcefile~operator_module.f90 sourcefile~swiftest_module.f90->sourcefile~solver_module.f90 sourcefile~walltime_module.f90 walltime_module.f90 sourcefile~swiftest_module.f90->sourcefile~walltime_module.f90 sourcefile~walltime_module.f90->sourcefile~globals_module.f90 sourcefile~walltime_module.f90->sourcefile~base_module.f90 sourcefile~bindings_module.f90 bindings_module.f90 sourcefile~bindings_module.f90->sourcefile~swiftest_module.f90 sourcefile~coarray_clone.f90 coarray_clone.f90 sourcefile~coarray_clone.f90->sourcefile~coarray_module.f90 sourcefile~coarray_clone.f90->sourcefile~swiftest_module.f90 sourcefile~coarray_collect.f90 coarray_collect.f90 sourcefile~coarray_collect.f90->sourcefile~coarray_module.f90 sourcefile~coarray_collect.f90->sourcefile~swiftest_module.f90 sourcefile~collision_check.f90 collision_check.f90 sourcefile~collision_check.f90->sourcefile~collision_module.f90 sourcefile~collision_check.f90->sourcefile~swiftest_module.f90 sourcefile~symba_module.f90 symba_module.f90 sourcefile~collision_check.f90->sourcefile~symba_module.f90 sourcefile~collision_generate.f90 collision_generate.f90 sourcefile~collision_generate.f90->sourcefile~collision_module.f90 sourcefile~collision_generate.f90->sourcefile~swiftest_module.f90 sourcefile~collision_io.f90 collision_io.f90 sourcefile~collision_io.f90->sourcefile~collision_module.f90 sourcefile~collision_io.f90->sourcefile~swiftest_module.f90 sourcefile~collision_regime.f90 collision_regime.f90 sourcefile~collision_regime.f90->sourcefile~collision_module.f90 sourcefile~collision_regime.f90->sourcefile~swiftest_module.f90 sourcefile~collision_resolve.f90 collision_resolve.f90 sourcefile~collision_resolve.f90->sourcefile~collision_module.f90 sourcefile~collision_resolve.f90->sourcefile~swiftest_module.f90 sourcefile~collision_resolve.f90->sourcefile~symba_module.f90 sourcefile~collision_util.f90 collision_util.f90 sourcefile~collision_util.f90->sourcefile~collision_module.f90 sourcefile~collision_util.f90->sourcefile~swiftest_module.f90 sourcefile~dust_module.f90 dust_module.f90 sourcefile~dust_module.f90->sourcefile~swiftest_module.f90 sourcefile~helio_module.f90 helio_module.f90 sourcefile~dust_module.f90->sourcefile~helio_module.f90 sourcefile~dust_module.f90->sourcefile~symba_module.f90 sourcefile~whm_module.f90 whm_module.f90 sourcefile~dust_module.f90->sourcefile~whm_module.f90 sourcefile~encounter_check.f90 encounter_check.f90 sourcefile~encounter_check.f90->sourcefile~encounter_module.f90 sourcefile~encounter_check.f90->sourcefile~swiftest_module.f90 sourcefile~encounter_io.f90 encounter_io.f90 sourcefile~encounter_io.f90->sourcefile~encounter_module.f90 sourcefile~encounter_io.f90->sourcefile~swiftest_module.f90 sourcefile~encounter_util.f90 encounter_util.f90 sourcefile~encounter_util.f90->sourcefile~base_module.f90 sourcefile~encounter_util.f90->sourcefile~encounter_module.f90 sourcefile~encounter_util.f90->sourcefile~swiftest_module.f90 sourcefile~encounter_util.f90->sourcefile~symba_module.f90 sourcefile~fraggle_generate.f90 fraggle_generate.f90 sourcefile~fraggle_generate.f90->sourcefile~swiftest_module.f90 sourcefile~fraggle_module.f90 fraggle_module.f90 sourcefile~fraggle_generate.f90->sourcefile~fraggle_module.f90 sourcefile~fraggle_generate.f90->sourcefile~symba_module.f90 sourcefile~fraggle_module.f90->sourcefile~swiftest_module.f90 sourcefile~fraggle_util.f90 fraggle_util.f90 sourcefile~fraggle_util.f90->sourcefile~swiftest_module.f90 sourcefile~fraggle_util.f90->sourcefile~fraggle_module.f90 sourcefile~helio_drift.f90 helio_drift.f90 sourcefile~helio_drift.f90->sourcefile~swiftest_module.f90 sourcefile~helio_drift.f90->sourcefile~helio_module.f90 sourcefile~helio_gr.f90 helio_gr.f90 sourcefile~helio_gr.f90->sourcefile~swiftest_module.f90 sourcefile~helio_gr.f90->sourcefile~helio_module.f90 sourcefile~helio_kick.f90 helio_kick.f90 sourcefile~helio_kick.f90->sourcefile~swiftest_module.f90 sourcefile~helio_kick.f90->sourcefile~helio_module.f90 sourcefile~helio_module.f90->sourcefile~swiftest_module.f90 sourcefile~helio_module.f90->sourcefile~whm_module.f90 sourcefile~helio_step.f90 helio_step.f90 sourcefile~helio_step.f90->sourcefile~swiftest_module.f90 sourcefile~helio_step.f90->sourcefile~helio_module.f90 sourcefile~helio_util.f90 helio_util.f90 sourcefile~helio_util.f90->sourcefile~swiftest_module.f90 sourcefile~helio_util.f90->sourcefile~helio_module.f90 sourcefile~main.f90 main.f90 sourcefile~main.f90->sourcefile~swiftest_module.f90 sourcefile~netcdf_io_implementations.f90 netcdf_io_implementations.f90 sourcefile~netcdf_io_implementations.f90->sourcefile~netcdf_io_module.f90 sourcefile~operator_cross.f90 operator_cross.f90 sourcefile~operator_cross.f90->sourcefile~operator_module.f90 sourcefile~operator_cross.f90->sourcefile~swiftest_module.f90 sourcefile~operator_mag.f90 operator_mag.f90 sourcefile~operator_mag.f90->sourcefile~operator_module.f90 sourcefile~operator_unit.f90 operator_unit.f90 sourcefile~operator_unit.f90->sourcefile~operator_module.f90 sourcefile~ringmoons_io.f90 ringmoons_io.f90 sourcefile~ringmoons_io.f90->sourcefile~swiftest_module.f90 sourcefile~ringmoons_module.f90 ringmoons_module.f90 sourcefile~ringmoons_io.f90->sourcefile~ringmoons_module.f90 sourcefile~ringmoons_module.f90->sourcefile~swiftest_module.f90 sourcefile~ringmoons_module.f90->sourcefile~symba_module.f90 sourcefile~ringmoons_step.f90 ringmoons_step.f90 sourcefile~ringmoons_step.f90->sourcefile~swiftest_module.f90 sourcefile~ringmoons_step.f90->sourcefile~ringmoons_module.f90 sourcefile~ringmoons_torque.f90 ringmoons_torque.f90 sourcefile~ringmoons_torque.f90->sourcefile~swiftest_module.f90 sourcefile~ringmoons_torque.f90->sourcefile~ringmoons_module.f90 sourcefile~ringmoons_util.f90 ringmoons_util.f90 sourcefile~ringmoons_util.f90->sourcefile~swiftest_module.f90 sourcefile~ringmoons_util.f90->sourcefile~ringmoons_module.f90 sourcefile~rmvs_discard.f90 rmvs_discard.f90 sourcefile~rmvs_discard.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_module.f90 rmvs_module.f90 sourcefile~rmvs_discard.f90->sourcefile~rmvs_module.f90 sourcefile~rmvs_encounter_check.f90 rmvs_encounter_check.f90 sourcefile~rmvs_encounter_check.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_encounter_check.f90->sourcefile~rmvs_module.f90 sourcefile~rmvs_kick.f90 rmvs_kick.f90 sourcefile~rmvs_kick.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_kick.f90->sourcefile~rmvs_module.f90 sourcefile~rmvs_module.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_module.f90->sourcefile~whm_module.f90 sourcefile~rmvs_step.f90 rmvs_step.f90 sourcefile~rmvs_step.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_step.f90->sourcefile~rmvs_module.f90 sourcefile~shgrav_module.f90 shgrav_module.f90 sourcefile~rmvs_step.f90->sourcefile~shgrav_module.f90 sourcefile~rmvs_util.f90 rmvs_util.f90 sourcefile~rmvs_util.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_util.f90->sourcefile~rmvs_module.f90 sourcefile~shgrav_accel.f90 shgrav_accel.f90 sourcefile~shgrav_accel.f90->sourcefile~swiftest_module.f90 sourcefile~shgrav_accel.f90->sourcefile~shgrav_module.f90 sourcefile~shgrav_module.f90->sourcefile~swiftest_module.f90 sourcefile~shgrav_pot.f90 shgrav_pot.f90 sourcefile~shgrav_pot.f90->sourcefile~swiftest_module.f90 sourcefile~shgrav_pot.f90->sourcefile~shgrav_module.f90 sourcefile~swiftest_coarray.f90 swiftest_coarray.f90 sourcefile~swiftest_coarray.f90->sourcefile~coarray_module.f90 sourcefile~swiftest_coarray.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_coarray.f90->sourcefile~rmvs_module.f90 sourcefile~swiftest_coarray.f90->sourcefile~whm_module.f90 sourcefile~swiftest_discard.f90 swiftest_discard.f90 sourcefile~swiftest_discard.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_drift.f90 swiftest_drift.f90 sourcefile~swiftest_drift.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_driver.f90 swiftest_driver.f90 sourcefile~swiftest_driver.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_gr.f90 swiftest_gr.f90 sourcefile~swiftest_gr.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_io.f90 swiftest_io.f90 sourcefile~swiftest_io.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_io.f90->sourcefile~ringmoons_module.f90 sourcefile~swiftest_io.f90->sourcefile~symba_module.f90 sourcefile~swiftest_kick.f90 swiftest_kick.f90 sourcefile~swiftest_kick.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_obl.f90 swiftest_obl.f90 sourcefile~swiftest_obl.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_obl.f90->sourcefile~shgrav_module.f90 sourcefile~swiftest_orbel.f90 swiftest_orbel.f90 sourcefile~swiftest_orbel.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_radiation.f90 swiftest_radiation.f90 sourcefile~swiftest_radiation.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_user.f90 swiftest_user.f90 sourcefile~swiftest_user.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_util.f90 swiftest_util.f90 sourcefile~swiftest_util.f90->sourcefile~base_module.f90 sourcefile~swiftest_util.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_util.f90->sourcefile~fraggle_module.f90 sourcefile~swiftest_util.f90->sourcefile~helio_module.f90 sourcefile~swiftest_util.f90->sourcefile~ringmoons_module.f90 sourcefile~swiftest_util.f90->sourcefile~rmvs_module.f90 sourcefile~swiftest_util.f90->sourcefile~symba_module.f90 sourcefile~swiftest_util.f90->sourcefile~whm_module.f90 sourcefile~symba_discard.f90 symba_discard.f90 sourcefile~symba_discard.f90->sourcefile~swiftest_module.f90 sourcefile~symba_discard.f90->sourcefile~symba_module.f90 sourcefile~symba_drift.f90 symba_drift.f90 sourcefile~symba_drift.f90->sourcefile~swiftest_module.f90 sourcefile~symba_drift.f90->sourcefile~symba_module.f90 sourcefile~symba_encounter_check.f90 symba_encounter_check.f90 sourcefile~symba_encounter_check.f90->sourcefile~swiftest_module.f90 sourcefile~symba_encounter_check.f90->sourcefile~symba_module.f90 sourcefile~symba_gr.f90 symba_gr.f90 sourcefile~symba_gr.f90->sourcefile~swiftest_module.f90 sourcefile~symba_gr.f90->sourcefile~symba_module.f90 sourcefile~symba_kick.f90 symba_kick.f90 sourcefile~symba_kick.f90->sourcefile~swiftest_module.f90 sourcefile~symba_kick.f90->sourcefile~symba_module.f90 sourcefile~symba_module.f90->sourcefile~swiftest_module.f90 sourcefile~symba_module.f90->sourcefile~helio_module.f90 sourcefile~symba_step.f90 symba_step.f90 sourcefile~symba_step.f90->sourcefile~swiftest_module.f90 sourcefile~symba_step.f90->sourcefile~symba_module.f90 sourcefile~symba_util.f90 symba_util.f90 sourcefile~symba_util.f90->sourcefile~swiftest_module.f90 sourcefile~symba_util.f90->sourcefile~fraggle_module.f90 sourcefile~symba_util.f90->sourcefile~symba_module.f90 sourcefile~tides_getacch_pl.f90 tides_getacch_pl.f90 sourcefile~tides_getacch_pl.f90->sourcefile~swiftest_module.f90 sourcefile~tides_module.f90 tides_module.f90 sourcefile~tides_getacch_pl.f90->sourcefile~tides_module.f90 sourcefile~tides_module.f90->sourcefile~base_module.f90 sourcefile~tides_module.f90->sourcefile~lambda_function_module.f90 sourcefile~tides_spin_step.f90 tides_spin_step.f90 sourcefile~tides_spin_step.f90->sourcefile~swiftest_module.f90 sourcefile~tides_spin_step.f90->sourcefile~tides_module.f90 sourcefile~walltime_implementations.f90 walltime_implementations.f90 sourcefile~walltime_implementations.f90->sourcefile~swiftest_module.f90 sourcefile~walltime_implementations.f90->sourcefile~walltime_module.f90 sourcefile~whm_coord.f90 whm_coord.f90 sourcefile~whm_coord.f90->sourcefile~swiftest_module.f90 sourcefile~whm_coord.f90->sourcefile~whm_module.f90 sourcefile~whm_drift.f90 whm_drift.f90 sourcefile~whm_drift.f90->sourcefile~swiftest_module.f90 sourcefile~whm_drift.f90->sourcefile~whm_module.f90 sourcefile~whm_gr.f90 whm_gr.f90 sourcefile~whm_gr.f90->sourcefile~swiftest_module.f90 sourcefile~whm_gr.f90->sourcefile~whm_module.f90 sourcefile~whm_kick.f90 whm_kick.f90 sourcefile~whm_kick.f90->sourcefile~swiftest_module.f90 sourcefile~whm_kick.f90->sourcefile~whm_module.f90 sourcefile~whm_module.f90->sourcefile~swiftest_module.f90 sourcefile~whm_step.f90 whm_step.f90 sourcefile~whm_step.f90->sourcefile~swiftest_module.f90 sourcefile~whm_step.f90->sourcefile~whm_module.f90 sourcefile~whm_util.f90 whm_util.f90 sourcefile~whm_util.f90->sourcefile~swiftest_module.f90 sourcefile~whm_util.f90->sourcefile~whm_module.f90

Source Code

!! Copyright 2026 - The Minton Group at Purdue University
!! This file is part of Swiftest.
!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License 
!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
!! You should have received a copy of the GNU General Public License along with Swiftest. 
!! If not, see: https://www.gnu.org/licenses. 

module globals
   !! author: David A. Minton
   !! graph: false
   !!
   !! Basic parameters, definitions, and global type definitions used throughout the Swiftest project
   !! Adapted from David E. Kaufmann's Swifter routine: globals.f90 and module_swifter.f90
   use, intrinsic :: iso_c_binding  ! Use the intrinsic kind definitions
   use, intrinsic :: iso_fortran_env, only: OUTPUT_UNIT
   implicit none
   public

   integer, parameter :: I8B = c_int_least64_t !! Symbolic name for kind types of 8-byte integers
   integer, parameter :: I4B = c_int_least32_t !! Symbolic name for kind types of 4-byte integers
   integer, parameter :: I2B = c_int_least16_t !! Symbolic name for kind types of 2-byte integers
   integer, parameter :: I1B = c_int_least8_t  !! Symbolic name for kind types of 1-byte integers

   integer, parameter :: SP = c_float  !! Symbolic name for kind types of single-precision reals
   integer, parameter :: DP = c_double  !! Symbolic name for kind types of double-precision reals
#ifdef QUADPREC
   integer, parameter :: QP = c_float128 !! Symbolic name for kind types of quad-precision reals
#else
   integer, parameter :: QP = c_double !! No support for quad precision. Defining QP as the same as DP
#endif

   real(DP), parameter :: PIBY2  = 1.570796326794896619231321691639751442099_DP !! Definition of /(\pi / 2\)
   real(DP), parameter :: PI     = 3.141592653589793238462643383279502884197_DP !! Definition of /(\pi\)
   real(DP), parameter :: PI3BY2 = 4.712388980384689857693965074919254326296_DP !! Definition of /(3 \pi / 2\)
   real(DP), parameter :: TWOPI  = 6.283185307179586476925286766559005768394_DP !! Definition of 2 \pi
   real(DP), parameter :: THIRD  = 0.333333333333333333333333333333333333333_DP !! Definition of 1 / 3
   real(DP), parameter :: SIXTH  = 0.166666666666666666666666666666666666667_DP !! Definition of 1 / 3
   real(DP), parameter :: DEG2RAD = PI / 180.0_DP !! Definition of conversion factor from degrees to radians
   real(DP), parameter :: RAD2DEG = 180.0_DP / PI !! Definition of conversion factor from degrees to radians
   real(DP), parameter :: GC        = 6.6743E-11_DP   !! Universal gravitational constant in SI units
   real(DP), parameter :: einsteinC = 299792458.0_DP  !! Speed of light in SI units
   real(DP), parameter :: L_SUN     = 3.828e26_DP     !! Solar luminosity in SI units; Mamajek, et al (2015). IAU 2015 Resolution B3. https://doi.org/10.48550/arXiv.1510.07674
   real(DP), parameter :: SIGMA     = 5.670374419e-8_DP  !! Stefan-Boltzmann constant in SI units
   real(DP), parameter :: YARK_RADIUS_THRESHOLD = 2.5e4_DP !! Radius threshold for yarkovsky effects.Yarkovsky effect is negligible for bodies with R > 25 km = 2.5e4 m (Bottke, et al, 2006; doi:10.1146/annurev.earth.34.031405.125154)

   integer(I4B), parameter :: LOWERCASE_BEGIN  = iachar('a') !! ASCII character set parameter for lower to upper conversion - start 
                                                             !! of lowercase
   integer(I4B), parameter :: LOWERCASE_END    = iachar('z') !! ASCII character set parameter for lower to upper conversion - end of 
                                                             !! lowercase
   integer(I4B), parameter :: UPPERCASE_OFFSET = iachar('A') - iachar('a') !! ASCII character set parameter for lower to upper 
                                                                           !! conversion - offset between upper and lower

   character(*), parameter :: VERSION = "2026.7.0" !! Swiftest version

   !> Symbolic name for integrator types
   character(*), parameter :: UNKNOWN_INTEGRATOR = "UKNOWN INTEGRATOR"
   character(*), parameter :: INT_BS                 = "Bulirsch-Stoer"
   character(*), parameter :: INT_HELIO              = "Democratic Heliocentric"
   character(*), parameter :: INT_RA15               = "Radau 15th order"
   character(*), parameter :: INT_TU4                = "T+U 4th order"
   character(*), parameter :: INT_WHM                = "Wisdom-Holman Method"
   character(*), parameter :: INT_RMVS               = "Regularized Mixed Variable Symplectic"
   character(*), parameter :: INT_SYMBA              = "SyMBA"
   character(*), parameter :: INT_RINGMOONS          = "SyMBA-RINGMOONS"

   integer(I4B), parameter :: STRMAX = 512 !! Maximum size of character strings
   integer(I4B), parameter :: NAMELEN = 32 !! Maximum size of name strings

   character(*), parameter :: CB_TYPE_NAME = "Central Body"
   character(*), parameter :: PL_TYPE_NAME = "Massive Body"
   character(*), parameter :: TP_TYPE_NAME = "Test Particle"
   character(*), parameter :: PL_TINY_TYPE_NAME = "Semi-Interacting Massive Body"
   character(*), parameter :: SEED_TYPE_NAME = "Ringmoons Seed"

   ! OpenMP Parameters
   integer(I4B)            :: nthreads = 1 !! Number of OpenMP threads
   integer(I4B), parameter :: NTHERSHOLD = 1000 !! Threshold value for OpenMP loop parallelization

   integer(I4B), parameter :: SUCCESS =  0 !! Symbolic name for function return/flag code for success
   integer(I4B), parameter :: FAILURE = -1 !! Symbolic name for function return/flag code for failure
   integer(I4B), parameter :: USAGE = -2 !! Symbolic name for function return/flag code for printing the usage message
   integer(I4B), parameter :: HELP  = -3 !! Symbolic name for function return/flag code for printing the usage message

   integer(I4B), parameter :: ELLIPSE   = -1 !! Symbolic names for orbit types - ellipse
   integer(I4B), parameter :: PARABOLA  =  0 !! Symbolic names for orbit types - parabola
   integer(I4B), parameter :: HYPERBOLA =  1 !! Symbolic names for orbit types - hyperbola

   !> Symbolic names for body/particle status codes:
   integer(I4B), parameter :: ACTIVE              =  0
   integer(I4B), parameter :: INACTIVE            =  1
   integer(I4B), parameter :: DISCARDED_RMAX      = -1
   integer(I4B), parameter :: DISCARDED_RMIN      = -2
   integer(I4B), parameter :: DISCARDED_RMAXU     = -3
   integer(I4B), parameter :: DISCARDED_PERI      = -4
   integer(I4B), parameter :: DISCARDED_PLR       = -5
   integer(I4B), parameter :: DISCARDED_PLQ       = -6
   integer(I4B), parameter :: DISCARDED_DRIFTERR  = -7
   integer(I4B), parameter :: MERGED              = -8
   integer(I4B), parameter :: DISRUPTED           = -9
   integer(I4B), parameter :: SUPERCATASTROPHIC   = -10
   integer(I4B), parameter :: GRAZE_AND_MERGE     = -11
   integer(I4B), parameter :: HIT_AND_RUN_DISRUPT = -12
   integer(I4B), parameter :: HIT_AND_RUN_PURE    = -13
   integer(I4B), parameter :: COLLIDED            = -14
   integer(I4B), parameter :: NEW_PARTICLE        = -15
   integer(I4B), parameter :: OLD_PARTICLE        = -16

   !> String labels for body/particle addition/subtraction in discard file
   character(*), parameter :: ADD = '+1'
   character(*), parameter :: SUB = '-1'

   !> Standard file names
   integer(I4B), parameter :: NDUMPFILES = 2
   character(*), parameter :: PARAM_RESTART_FILE = "param.restart.in"
#ifdef COARRAY
   character(STRMAX)       :: SWIFTEST_LOG_FILE                  !! Name of file to use to log output when using "COMPACT" or 
                                                                 !! "PROGRESS" display style (each co-image gets its own log file)
#else
   character(*), parameter :: SWIFTEST_LOG_FILE = "swiftest.log" !! Name of file to use to log output when using "COMPACT" or 
                                                                 !! "PROGRESS" display style
#endif
   integer(I4B), parameter :: SWIFTEST_LOG_OUT = 33 !! File unit for log file when using "COMPACT" display style 

   !> Default file names that can be changed by the user in the parameters file
   character(*), parameter :: CB_INFILE        = 'cb.in'
   character(*), parameter :: PL_INFILE        = 'pl.in'
   character(*), parameter :: TP_INFILE        = 'tp.in'
   character(*), parameter :: NC_INFILE        = 'init_cond.nc'
   character(*), parameter :: BIN_OUTFILE      = 'data.nc'
   character(*), parameter :: RING_FILE        = 'ring.nc'
   integer(I4B), parameter :: BINUNIT          = 20 !! File unit number for the binary output file
   integer(I4B), parameter :: PARTICLEUNIT     = 44 !! File unit number for the binary particle info output file
   integer(I4B), parameter :: LUN              = 42 !! File unit number for files that are opened and closed within a single 
                                                    !! subroutine call, and therefore should not collide

   !> Miscellaneous constants:
   integer(I4B), parameter :: NDIM   = 3                  !! Number of dimensions in our reality
   integer(I4B), parameter :: NDIM2  = 2 * NDIM           !! 2x the number of dimensions
   real(DP),     parameter :: VSMALL = sqrt(TINY(1._DP)) !! Very small number used to prevent floating underflow

end module globals