initialize_splinded_ephemeris Subroutine

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

the ephemeris must be initialized before this is called

Type Bound

jpl_ephemeris_splined

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]


Calls

proc~~initialize_splinded_ephemeris~~CallsGraph proc~initialize_splinded_ephemeris jpl_ephemeris_splined%initialize_splinded_ephemeris initialize initialize proc~initialize_splinded_ephemeris->initialize proc~initialize_globals jpl_ephemeris_splined%initialize_globals proc~initialize_splinded_ephemeris->proc~initialize_globals db1ink db1ink proc~initialize_globals->db1ink get_rv get_rv proc~initialize_globals->get_rv proc~destroy_body_eph_interface body_eph_interface%destroy_body_eph_interface proc~initialize_globals->proc~destroy_body_eph_interface

Source Code

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

        !! the ephemeris must be initialized before this is called

        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(wp),intent(in) :: et0 !! initial ephemeris time [sec]
        real(wp),intent(in) :: dt  !! ephemeris time step [sec]
        real(wp),intent(in) :: etf !! final ephemeris time [sec]

        write(*,'(A)') ' * Using splined ephemeris'

        ! have to first initialize the base one:
        call me%jpl_ephemeris%initialize(filename,ksize,km,bary,status_ok)

        status_ok = (etf>et0 .and. dt>0.0_wp)
        if (.not. status_ok) return

        ! initialize the global spline coefficients
        call me%initialize_globals(et0, abs(dt), etf)

        ! now, the local variables in this class
        allocate(me%earth_eph_interface%w0(3*kx))
        allocate(me%sun_eph_interface%w0(3*kx))
        allocate(me%ssb_eph_interface%w0(3*kx))
        me%earth_eph_interface%inbvx = 0
        me%sun_eph_interface%inbvx = 0
        me%ssb_eph_interface%inbvx = 0

        ! point to the global ephemeris:
        me%earth_eph_interface%eph => earth_eph
        me%sun_eph_interface%eph => sun_eph
        me%ssb_eph_interface%eph => ssb_eph

    end subroutine initialize_splinded_ephemeris