get_pos Subroutine

private subroutine get_pos(eph, et, b_target, b_obs, r, status_ok)

ephemeris wrapper to just return position vector see also: ballistic_derivs

Arguments

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

ephemeris time (sec)

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

target body

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

observer body

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

j2000 state (km, km/s)

logical, intent(out) :: status_ok

true if no problems


Calls

proc~~get_pos~~CallsGraph proc~get_pos get_pos get_r get_r proc~get_pos->get_r get_rv get_rv proc~get_pos->get_rv

Called by

proc~~get_pos~~CalledByGraph proc~get_pos get_pos proc~apparent_position apparent_position proc~apparent_position->proc~get_pos proc~get_sun_fraction get_sun_fraction proc~get_sun_fraction->proc~apparent_position proc~generate_eclipse_data mission_type%generate_eclipse_data proc~generate_eclipse_data->proc~get_sun_fraction proc~halo_solver_main halo_solver_main proc~halo_solver_main->proc~generate_eclipse_data

Source Code

    subroutine get_pos(eph,et,b_target,b_obs,r,status_ok)

        !! ephemeris wrapper to just return position vector
        !! see also: [[ballistic_derivs]]

        class(jpl_ephemeris),intent(inout) :: eph
        real(wp),intent(in) :: et !! ephemeris time (sec)
        type(celestial_body),intent(in) :: b_target !! target body
        type(celestial_body),intent(in) :: b_obs !! observer body
        real(wp),dimension(3),intent(out) :: r !! j2000 state (km, km/s)
        logical,intent(out) :: status_ok !! true if no problems

        real(wp),dimension(6) :: rv !! r,v vector

        select type (eph)
        type is (jpl_ephemeris)
            call eph%get_rv(et,b_target,b_obs,rv,status_ok)
            r = rv(1:3)
        type is (jpl_ephemeris_splined)
            ! for this, we can just get position vector only
            call eph%get_r(et,b_target,b_obs,r,status_ok)
        class default
            error stop 'error in get_pos: invalid eph class'
        end select

    end subroutine get_pos