splined_ephemeris_module Module

Simple splined ephemeris model for Earth/Sun wrt Moon.


Uses

  • module~~splined_ephemeris_module~~UsesGraph module~splined_ephemeris_module splined_ephemeris_module bspline_module bspline_module module~splined_ephemeris_module->bspline_module fortran_astrodynamics_toolkit fortran_astrodynamics_toolkit module~splined_ephemeris_module->fortran_astrodynamics_toolkit iso_fortran_env iso_fortran_env module~splined_ephemeris_module->iso_fortran_env module~halo_kinds_module halo_kinds_module module~splined_ephemeris_module->module~halo_kinds_module module~halo_kinds_module->iso_fortran_env

Used by

  • module~~splined_ephemeris_module~~UsedByGraph module~splined_ephemeris_module splined_ephemeris_module module~halo_module halo_module module~halo_module->module~splined_ephemeris_module module~halo_utilities_module halo_utilities_module module~halo_module->module~halo_utilities_module module~halo_utilities_module->module~splined_ephemeris_module

Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: kx = bspline_order_cubic

spline interpolation order

integer, private, parameter :: iknot = 0

use default knots

type(celestial_body), public, parameter :: body_ssb = celestial_body(0, 'SSB', 0.0_wp)

solar-system barycenter

type(body_eph), private, target :: earth_eph
type(body_eph), private, target :: sun_eph
type(body_eph), private, target :: ssb_eph

Derived Types

type, private ::  body_eph

Components

Type Visibility Attributes Name Initial
integer, public :: id = 0
real(kind=wp), public, dimension(:,:), allocatable :: f

function evals. not needed once the spline has been computed

real(kind=wp), public, dimension(:,:), allocatable :: tx
real(kind=wp), public, dimension(:,:), allocatable :: bcoef
integer, public :: nx = 0

Type-Bound Procedures

procedure, public :: destroy => destroy_body_eph

type, private ::  body_eph_interface

the interface to a splined ephemeris for a body used for calls to db1val.

Components

Type Visibility Attributes Name Initial
integer, private :: inbvx = 0
real(kind=wp), private, dimension(:), allocatable :: w0

work array - dimension(3_ip*kx)

type(body_eph), private, pointer :: eph => null()

points to the ephemeris

Type-Bound Procedures

procedure, public :: get_r
procedure, public :: get_rv
procedure, public :: destroy => destroy_body_eph_interface

type, public, extends(jpl_ephemeris) ::  jpl_ephemeris_splined

make this an extension of the jpl_ephemeris, since it is also needed in tranformations. also, has the extra feature of a get_r method, since we don't need velocity for the gravity calculation.

Components

Type Visibility Attributes Name Initial
type(body_eph_interface), public :: earth_eph_interface

splined version of earth ephemeris

type(body_eph_interface), public :: sun_eph_interface

splined version of sun ephemeris

type(body_eph_interface), public :: ssb_eph_interface

splined version of ssb ephemeris

Type-Bound Procedures

procedure, public :: initialize_splinded_ephemeris
procedure, public :: initialize_globals ../../

this is done once to initialize the global ephemeris vars

procedure, public :: get_r => get_r_splined
procedure, public :: get_rv => get_rv_splined

Functions

private function get_rv(me, et) result(rv)

Arguments

Type IntentOptional Attributes Name
class(body_eph_interface), intent(inout) :: me
real(kind=wp), intent(in) :: et

ephemeris time (sec)

Return Value real(kind=wp), dimension(6)

position/velocity vector

private function get_r(me, et) result(r)

Arguments

Type IntentOptional Attributes Name
class(body_eph_interface), intent(inout) :: me
real(kind=wp), intent(in) :: et

ephemeris time (sec)

Return Value real(kind=wp), dimension(3)

position vector


Subroutines

private subroutine destroy_body_eph(me)

Arguments

Type IntentOptional Attributes Name
class(body_eph), intent(out) :: me

private subroutine destroy_body_eph_interface(me)

Arguments

Type IntentOptional Attributes Name
class(body_eph_interface), intent(out) :: me

private subroutine initialize_globals(me, et0, dt, etf)

initialize the earth and sun ephemeris.

Arguments

Type IntentOptional Attributes Name
class(jpl_ephemeris_splined), intent(inout) :: me
real(kind=wp), intent(in) :: et0

initial ephemeris time [sec]

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

ephemeris time step [sec]

real(kind=wp), intent(in) :: etf

final ephemeris time [sec]

private subroutine initialize_splinded_ephemeris(me, filename, ksize, km, bary, status_ok, et0, dt, etf)

the ephemeris must be initialized before this is called

Arguments

Type IntentOptional Attributes Name
class(jpl_ephemeris_splined), intent(inout) :: me
character(len=*), intent(in) :: filename

ephemeris file name

integer, intent(in), optional :: ksize

corresponding ksize

logical, intent(in), optional :: km

defining physical units of the output states. km = .true. : km and km/sec [default], km = .false. : au and au/day.

logical, intent(in), optional :: bary

logical flag defining output center. only the 9 planets are affected. bary = .true. : center is solar-system barycenter, bary = .false. : center is sun [default].

logical, intent(out) :: status_ok

true if there were no problems.

real(kind=wp), intent(in) :: et0

initial ephemeris time [sec]

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

ephemeris time step [sec]

real(kind=wp), intent(in) :: etf

final ephemeris time [sec]

private subroutine get_rv_splined(me, et, targ, obs, rv, status_ok)

Arguments

Type IntentOptional Attributes Name
class(jpl_ephemeris_splined), intent(inout) :: me
real(kind=wp), intent(in) :: et

ephemeris time [sec]

type(celestial_body), intent(in) :: targ

target body

type(celestial_body), intent(in) :: obs

observer body

real(kind=wp), intent(out), dimension(6) :: rv

state of targ w.r.t. obs [km,km/s] in ICRF frame

logical, intent(out) :: status_ok

true if there were no problems

private subroutine get_r_splined(me, et, targ, obs, r, status_ok)

Arguments

Type IntentOptional Attributes Name
class(jpl_ephemeris_splined), intent(inout) :: me
real(kind=wp), intent(in) :: et

ephemeris time [sec]

type(celestial_body), intent(in) :: targ

target body

type(celestial_body), intent(in) :: obs

observer body

real(kind=wp), intent(out), dimension(3) :: r

r of targ w.r.t. obs [km] in ICRF frame

logical, intent(out) :: status_ok

true if there were no problems