get_rv_derivative_splined Subroutine

private subroutine get_rv_derivative_splined(me, et, targ, obs, rvdot, status_ok)

The time derivative of the splined state returned by get_rv_splined (the derivative of each component's spline: so rvdot(1:3) is the derivative of the position spline, which is close to, but not exactly, the velocity spline). Only the Earth/Moon pairs are available.

Type Bound

jpl_ephemeris_splined

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

d/dt of the state of targ w.r.t. obs [km/s, km/s^2]

logical, intent(out) :: status_ok

true if there were no problems


Calls

proc~~get_rv_derivative_splined~~CallsGraph proc~get_rv_derivative_splined jpl_ephemeris_splined%get_rv_derivative_splined proc~get_rv_dot body_eph_interface%get_rv_dot proc~get_rv_derivative_splined->proc~get_rv_dot db1val db1val proc~get_rv_dot->db1val

Source Code

    subroutine get_rv_derivative_splined(me,et,targ,obs,rvdot,status_ok)

        !! The time derivative of the splined state returned by [[get_rv_splined]]
        !! (the derivative of each component's spline: so `rvdot(1:3)` is the derivative of
        !! the position spline, which is close to, but not exactly, the velocity spline).
        !! Only the Earth/Moon pairs are available.

        class(jpl_ephemeris_splined),intent(inout) :: me
        real(wp),intent(in)                :: et         !! ephemeris time [sec]
        type(celestial_body),intent(in)    :: targ       !! target body
        type(celestial_body),intent(in)    :: obs        !! observer body
        real(wp),dimension(6),intent(out)  :: rvdot      !! d/dt of the state of targ w.r.t. obs [km/s, km/s^2]
        logical,intent(out)                :: status_ok  !! true if there were no problems

        status_ok = .true.
        if (targ==body_earth .and. obs==body_moon) then
            rvdot = me%earth_eph_interface%get_rv_dot(et)
        elseif (targ==body_moon .and. obs==body_earth) then
            rvdot = -me%earth_eph_interface%get_rv_dot(et)
        else
            write(*,*) 'targ = ', targ
            write(*,*) 'obs  = ', obs
            error stop 'error in get_rv_derivative_splined: this combo is not available'
        end if

    end subroutine get_rv_derivative_splined