els3pv Subroutine

public pure subroutine els3pv(gm, e, pv)

Algorithm for three-dimensional conversion from orbital elements to position and velocity

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: gm

grav. parameter [km^3/sec^2]

real(kind=wp), intent(in), dimension(6) :: e

[al, q, ei, bom, om, tau]

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

[x, y, z, xdot, ydot, zdot]


Calls

proc~~els3pv~~CallsGraph proc~els3pv gooding_module::els3pv proc~els2pv gooding_module::els2pv proc~els3pv->proc~els2pv proc~dcbsol gooding_module::dcbsol proc~els2pv->proc~dcbsol proc~ekepl gooding_module::ekepl proc~els2pv->proc~ekepl proc~shkepl gooding_module::shkepl proc~els2pv->proc~shkepl proc~dcubrt gooding_module::dcubrt proc~dcbsol->proc~dcubrt proc~ekepl->proc~dcbsol proc~emkep gooding_module::emkep proc~ekepl->proc~emkep proc~shkepl->proc~dcubrt proc~shmkep gooding_module::shmkep proc~shkepl->proc~shmkep

Called by

proc~~els3pv~~CalledByGraph proc~els3pv gooding_module::els3pv proc~propagate gooding_module::propagate proc~propagate->proc~els3pv

Source Code

    pure subroutine els3pv (gm, e, pv)

    implicit none

    real(wp),intent(in)               :: gm   !! grav. parameter [km^3/sec^2]
    real(wp),dimension(6),intent(in)  :: e    !! [al, q, ei, bom, om, tau]
    real(wp),dimension(6),intent(out) :: pv   !! [x, y, z, xdot, ydot, zdot]

    real(wp) :: x,y,z,xdot,ydot,zdot,al,q,ei,bom,om,tau
    real(wp) :: r,u,vr,vt,c,s,x1,x2,y1,y2

    if (all(e==zero)) then

        pv = zero

    else

        al  = e(1)
        q   = e(2)
        ei  = e(3)
        bom = e(4)
        om  = e(5)
        tau = e(6)

        call els2pv (gm, al, q, om, tau, r, u, vr, vt)

        c = cos(u)
        s = sin(u)
        x1 = r*c
        y1 = r*s
        x2 = vr*c - vt*s
        y2 = vr*s + vt*c
        c = cos(ei)
        s = sin(ei)
        z = y1*s
        y1 = y1*c
        zdot = y2*s
        y2 = y2*c
        c = cos(bom)
        s = sin(bom)
        x = x1*c - y1*s
        y = x1*s + y1*c
        xdot = x2*c - y2*s
        ydot = x2*s + y2*c

        pv(1) = x
        pv(2) = y
        pv(3) = z
        pv(4) = xdot
        pv(5) = ydot
        pv(6) = zdot

    end if

    end subroutine els3pv