-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjplint.f
200 lines (174 loc) · 7.56 KB
/
jplint.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
C-----------------------------------------------------------------------
C Naval Observatory Vector Astrometry Software (NOVAS)
C C Edition, Version 3.1
C
C jplint.f: Interface to JPL ephemeris-access software use w/ solsys2.c
C
C U. S. Naval Observatory
C Astronomical Applications Dept.
C Washington, DC
C http://www.usno.navy.mil/USNO/astronomical-applications
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
SUBROUTINE jplint (tjdtdb,target,center, posvel,error)
C
C---PURPOSE: To serve as the interface between the JPL Fortran
C code that accesses the solar system ephemerides; returns
C the position and velocity of the body at the input time.
C
C---REFERENCES: JPL. 2007, "JPL Planetary and Lunar Ephemerides: Export
C Information," (Pasadena, CA: JPL)
C http://ssd.jpl.nasa.gov/?planet_eph_export.
C
C---INPUT
C ARGUMENTS: tjdtdb = TDB Julian date at which the body's position
C and velocity is desired.
C (Double precision)
C target = Body identification number for the "target"
C point; Mercury = 1,...,Pluto = 9,
C Moon = 10, Sun = 11, Solar system barycenter =
C 12, Earth-Moon barycenter = 13.
C (Integer)
C center = Body identification number for the "origin"
C point; Mercury = 1,...,Pluto = 9,
C Moon = 10, Sun = 11, Solar system barycenter =
C 12, Earth-Moon barycenter = 13.
C (Integer)
C
C---OUTPUT
C ARGUMENTS: posvel = Array containing the position and velocity
C components (rectangular coordinates on the
C equator and equinox of J2000.0) of 'target'
C relative to 'origin'. The units are AU and
C AU/day, respectively.
C
C---COMMON
C BLOCKS: None.
C
C---ROUTINES
C CALLED: SUBROUTINE const (JPL supplied)
C SUBROUTINE pleph (JPL supplied)
C
C---VER./DATE/
C PROGRAMMER: V1.0/10-97/JAB (USNO/AA)
C V1.1/10-10/JLB (USNO/AA) update references
C
C---NOTES: 1. The arguments of JPL subroutine 'pleph' have changed
C several times over the course of years. This
C subroutine ('jplint') supports the version supplied by
C JPL in their software package provided on the 1997
C CD-ROM (see reference).
C 2. Any future changes to the JPL arguments should be
C accomodated in this subroutine ('jplint'), keeping
C its arguments constant. This should minimize impact
C on the calling program.
C
C-----------------------------------------------------------------------
C-----'cdim' is simply an upper limit on the number of constants stored
C in the ephemeris header. It can be adjusted when the actual value
C ('nvals') is known.
INTEGER cdim
PARAMETER (cdim = 400)
CHARACTER name(cdim)*6
INTEGER target, center, nvals, error, i
DOUBLE PRECISION tjdtdb, limits(3), value(cdim), posvel(6)
C-----Call JPL subroutine 'const' to get the time limits of the
C ephemeris.
CALL const ( name,value,limits,nvals)
C-----Check that the input time is within the ephemeris limits.
C Return the position and velocity of the body if it is.
IF ((tjdtdb .LT. limits(1)) .OR. (tjdtdb .GT. limits(2))) THEN
error = 1
DO 10 i = 1,6
posvel(i) = 0.0d0
10 CONTINUE
ELSE
error = 0
CALL pleph (tjdtdb,target,center, posvel)
END IF
RETURN
END
C-----------------------------------------------------------------------
SUBROUTINE jplihp (tjdtdb,target,center, posvel,error)
C
C---PURPOSE: To serve as the interface between the JPL Fortran
C code that accesses the solar system ephemerides; returns
C the position and velocity of the body at the input time.
C
C---REFERENCES: JPL. 2007, "JPL Planetary and Lunar Ephemerides: Export
C Information," (Pasadena, CA: JPL)
C http://ssd.jpl.nasa.gov/?planet_eph_export.
C
C---INPUT
C ARGUMENTS: tjdtdb = Array containing the TDB Julian date at which
C the body's position and velocity is desired.
C The Julian date may be split any way (although
C the first element is usually the "integer"
C part, and the second element is the
C "fractional" part). (Double precision)
C target = Body identification number for the "target"
C point; Mercury = 1,...,Pluto = 9,
C Moon = 10, Sun = 11, Solar system barycenter =
C 12, Earth-Moon barycenter = 13.
C (Integer)
C center = Body identification number for the "origin"
C point; Mercury = 1,...,Pluto = 9,
C Moon = 10, Sun = 11, Solar system barycenter =
C 12, Earth-Moon barycenter = 13.
C (Integer)
C
C---OUTPUT
C ARGUMENTS: posvel = Array containing the position and velocity
C components (rectangular coordinates on the
C equator and equinox of J2000.0) of 'target'
C relative to 'origin'. The units are AU and
C AU/day, respectively.
C
C---COMMON
C BLOCKS: None.
C
C---ROUTINES
C CALLED: SUBROUTINE const (JPL supplied)
C SUBROUTINE dpleph (JPL supplied)
C
C---VER./DATE/
C PROGRAMMER: V1.0/12-06/JAB (USNO/AA)
C V1.1/10-10/JLB (USNO/AA) update references
C
C---NOTES: 1. The arguments of JPL subroutine 'pleph' have changed
C several times over the course of years. This
C subroutine ('jplihp') supports the version supplied by
C JPL in their software package provided on the 1997
C CD-ROM (see reference).
C 2. Any future changes to the JPL arguments should be
C accomodated in this subroutine ('jplihp'), keeping
C its arguments constant. This should minimize impact
C on the calling program.
C
C-----------------------------------------------------------------------
C-----'cdim' is simply an upper limit on the number of constants stored
C in the ephemeris header. It can be adjusted when the actual value
C ('nvals') is known.
INTEGER cdim
PARAMETER (cdim = 400)
CHARACTER name(cdim)*6
INTEGER target, center, nvals, error, i
DOUBLE PRECISION tjdtdb(2), tjd, limits(3), value(cdim),
. posvel(6)
C-----Call JPL subroutine 'const' to get the time limits of the
C ephemeris.
CALL const ( name,value,limits,nvals)
C-----Check that the input time is within the ephemeris limits.
C Return the position and velocity of the body if it is.
tjd = tjdtdb(1) + tjdtdb(2)
IF ((tjd .LT. limits(1)) .OR. (tjd .GT. limits(2))) THEN
error = 1
DO 10 i = 1,6
posvel(i) = 0.0d0
10 CONTINUE
ELSE
error = 0
CALL dpleph (tjdtdb,target,center, posvel)
END IF
RETURN
END