Main class for accessing a JPL ephemeris file.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | namfil |
name of the binary ephemeris file |
||
integer, | public | :: | ksize | = | 2036 |
ksize must be set by the user according to the ephemeris to be read:
for de200, set |
|
integer, | public, | dimension(3,13) | :: | ipt | = | 0 |
ipt(39) |
real(kind=wp), | public, | dimension(nmax) | :: | cval | = | 0.0_wp | |
real(kind=wp), | public, | dimension(3) | :: | ss | = | 0.0_wp | |
real(kind=wp), | public | :: | au | = | 0.0_wp | ||
real(kind=wp), | public | :: | emrat | = | 0.0_wp | ||
integer, | public | :: | ncon | = | 0 | ||
integer, | public | :: | numde | = | 0 | ||
real(kind=wp), | public, | dimension(6) | :: | pvsun | = | 0.0_wp |
dp 6-word array containing the barycentric position and velocity of the sun. |
logical, | public | :: | km | = | .true. |
logical flag defining physical units of the output states. km = .true. : km and km/sec km = .false. : au and au/day for nutations and librations. angle unit is always radians. |
|
logical, | public | :: | bary | = | .false. |
logical flag defining output center. only the 9 planets are affected. bary = .true. : center is solar-system barycenter bary = .false. : center is sun |
|
character(len=6), | public, | dimension(14,3) | :: | ttl | = | '' | |
character(len=6), | public, | dimension(nmax) | :: | cnam | = | '' | |
logical, | public | :: | initialized | = | .false. |
is the ephemeris initialized? |
|
integer, | public | :: | nrfile | = | 0 |
file unit for the ephemeris file |
|
integer, | public | :: | nrl | = | -1 |
this was formerly in state |
|
integer, | public | :: | ncoeffs | = | 0 | ||
real(kind=wp), | public, | dimension(1500) | :: | buf | = | 0.0_wp | |
real(kind=wp), | public, | dimension(18) | :: | pc | = | 0.0_wp | |
real(kind=wp), | public, | dimension(18) | :: | vc | = | 0.0_wp | |
integer, | public | :: | np | = | 2 | ||
integer, | public | :: | nv | = | 3 | ||
real(kind=wp), | public | :: | twot | = | 0.0_wp |
Interface for the ephemeris_module.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jpl_ephemeris), | intent(inout) | :: | me | |||
real(kind=fat_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=fat_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 |
Initialize the ephemeris. This routine may be called to load a different ephemeris file. Otherwise, it is called on the first call to get_state, and loads the file specified in the module header.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jpl_ephemeris), | intent(inout) | :: | me | |||
character(len=*), | intent(in) | :: | filename |
ephemeris file name |
||
integer, | intent(in), | optional | :: | ksize |
corresponding |
|
logical, | intent(in), | optional | :: | km |
defining physical units of the output states.
|
|
logical, | intent(in), | optional | :: | bary |
logical flag defining output center.
only the 9 planets are affected.
|
|
logical, | intent(out) | :: | status_ok |
true if there were not problems. |
This subroutine reads the JPL planetary ephemeris
and gives the position and velocity of the point ntarg
with respect to ncent
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jpl_ephemeris), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in) | :: | jd |
d.p. Julian ephemeris date at which interpolation is wanted. |
||
integer, | intent(in) | :: | ntarg |
integer number of 'target' point. |
||
integer, | intent(in) | :: | ncent |
integer number of 'center' point. |
||
real(kind=wp), | intent(out), | dimension(6) | :: | rrd |
output 6-word d.p. array containing position and velocity
of point |
|
logical, | intent(out) | :: | status_ok |
true if there were no problems |
Obtain the constants from the ephemeris file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jpl_ephemeris), | intent(inout) | :: | me | |||
character(len=6), | intent(out), | dimension(:) | :: | nam |
array of constant names |
|
real(kind=wp), | intent(out), | dimension(:) | :: | val |
array of values of constants |
|
real(kind=wp), | intent(out), | dimension(3) | :: | sss |
jd start, jd stop, step of ephemeris |
|
integer, | intent(out) | :: | n |
number of entries in |
Close the ephemeris.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jpl_ephemeris), | intent(inout) | :: | me |
this subroutine differentiates and interpolates a set of chebyshev coefficients to give position and velocity.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jpl_ephemeris), | intent(inout) | :: | me | |||
real(kind=wp), | dimension(ncf,ncm,*) | :: | buf |
1st location of array of d.p. chebyshev coefficients of position |
||
real(kind=wp), | intent(in), | dimension(2) | :: | t | ||
integer, | intent(in) | :: | ncf |
|
||
integer, | intent(in) | :: | ncm |
|
||
integer, | intent(in) | :: | na |
(i.e., # of sub-intervals in full interval) |
||
integer, | intent(in) | :: | ifl |
integer flag = 1 for positions only = 2 for pos and vel |
||
real(kind=wp), | dimension(ncm,*) | :: | pv |
interpolated quantities requested. dimension expected is pv(ncm,ifl), dp. |
This subroutine reads and interpolates the JPL planetary ephemeris file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jpl_ephemeris), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in), | dimension(2) | :: | et2 |
2-word Julian ephemeris epoch at which interpolation
is wanted. any combination of |
|
integer, | intent(in), | dimension(12) | :: | list |
12-word integer array specifying what interpolation is wanted for each of the bodies on the file. list(i) = 0 : no interpolation for body i, list(i) = 1 : position only, list(i) = 2 : position and velocity. |
|
real(kind=wp), | intent(out), | dimension(6,11) | :: | pv |
dp 6 x 11 array that will contain requested interpolated
quantities (other than nutation, stored in |
|
real(kind=wp), | intent(out), | dimension(4) | :: | pnut |
dp 4-word array that will contain nutations and rates,
depending on the setting of |
|
logical, | intent(out) | :: | status_ok |
true if there were no problems |
type,extends(ephemeris_class),public :: jpl_ephemeris !! Main class for accessing a JPL ephemeris file. character(len=:),allocatable :: namfil !! name of the binary ephemeris file integer :: ksize = 2036 !! ksize must be set by the user according to the ephemeris to be read: !! for ***de200***, set `ksize=1652`, !! for ***de405***, set `ksize=2036`, !! for ***de406***, set `ksize=1456`, !! for ***de414***, set `ksize=2036`, !! for ***de418***, set `ksize=2036`, !! for ***de421***, set `ksize=2036`, !! for ***de422***, set `ksize=2036`, !! for ***de423***, set `ksize=2036`, !! for ***de424***, set `ksize=2036`, !! for ***de430***, set `ksize=2036`. !ephhdr integer,dimension(3,13) :: ipt = 0 !! ipt(39) real(wp),dimension(nmax) :: cval = 0.0_wp real(wp),dimension(3) :: ss = 0.0_wp real(wp) :: au = 0.0_wp real(wp) :: emrat = 0.0_wp integer :: ncon = 0 integer :: numde = 0 !stcomx real(wp),dimension(6) :: pvsun = 0.0_wp !! dp 6-word array containing the barycentric position and !! velocity of the sun. logical :: km = .true. !! logical flag defining physical units of the output states. !! km = .true. : km and km/sec !! km = .false. : au and au/day !! for nutations and librations. angle unit is always radians. logical :: bary = .false. !! logical flag defining output center. !! only the 9 planets are affected. !! bary = .true. : center is solar-system barycenter !! bary = .false. : center is sun !chrhdr character(len=6),dimension(14,3) :: ttl = '' character(len=6),dimension(nmax) :: cnam = '' logical :: initialized = .false. !! is the ephemeris initialized? integer :: nrfile = 0 !! file unit for the ephemeris file integer :: nrl = -1 !! this was formerly in state integer :: ncoeffs = 0 ! formerly in state: real(wp),dimension(1500) :: buf = 0.0_wp ! formerly in interp: real(wp),dimension(18) :: pc = 0.0_wp real(wp),dimension(18) :: vc = 0.0_wp integer :: np = 2 integer :: nv = 3 real(wp) :: twot = 0.0_wp contains procedure,public :: get_rv => get_rv_from_jpl_ephemeris procedure,public :: initialize => initialize_ephemeris procedure,public :: get_state procedure,public :: get_constants procedure,public :: close => close_ephemeris procedure :: interp procedure :: state end type jpl_ephemeris