OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
coord.f
Go to the documentation of this file.
1  SUBROUTINE coord(X,GM,Y)
2 C VERSION OF 4/1/85
3 C PURPOSE
4 C TRANSFORM ORBITAL ELEMENT A,E,I,CAPW,W,EA TO CARTESIAN COORD
5 C X,Y,Z,XD,ZD,YD.
6 C INPUT
7 C X(1) = A, SEMI-MAJOR AXIS
8 C (2) = E, ECCENTRICITY
9 C (3) = I, INCLINATION (RAD)
10 C (4) = CAPW, LONGITUDE OF ASCENDING NODE (RAD)
11 C (5) = W, ARGUMENT OF PERIAPSIS (RAD)
12 C (6) = EA, ECCENTRIC ANOMALY (RAD)
13 C GM = GRAVITATIONAL CONSTANT * MASS OF PLANET (KM**3/SEC**2)
14 C OUTPUT
15 C Y(1) = X (KM)
16 C (2) = Y (KM)
17 C (3) = Z (KM)
18 C (4) = XD (KM/SEC)
19 C (5) = YD (KM/SEC)
20 C (6) = ZD (KM/SEC)
21 C CALL SUBROUTINES
22 C NONE
23 C REFERENCES
24 C JPL EM 312/87-153, 20 APRIL 1987
25 C ORBITAL MOTION, A. E. ROY, 1978, PAGE 102
26 C ANALYSIS
27 C J. H. KWOK - JPL
28 C PROGRAMMER
29 C J. H. KWOK - JPL
30 C PROGRAM MODIFICATIONS
31 C NONE
32 C
33  IMPLICIT DOUBLE PRECISION (a-h,o-z)
34  dimension x(6),y(6),td(8)
35  DATA one/1.d0/
36  cc=dcos(x(4))
37  sc=dsin(x(4))
38  cw=dcos(x(5))
39  sw=dsin(x(5))
40  ci=dcos(x(3))
41  si=dsin(x(3))
42  td(1)=cc*cw-sc*sw*ci
43  td(2)=sc*cw+cc*sw*ci
44  td(3)=sw*si
45  td(4)=-cc*sw-sc*cw*ci
46  td(5)=-sc*sw+cc*cw*ci
47  td(6)=cw*si
48  td(7)=dsqrt(one-x(2)**2)*x(1)
49  td(8)=dsqrt(gm/x(1)**3)
50  ce=dcos(x(6))
51  se=dsin(x(6))
52  r=x(1)*(one-x(2)*ce)
53  DO 10 i=1,3
54  y(i)=x(1)*td(i)*(ce-x(2))+td(7)*td(i+3)*se
55  10 y(i+3)=x(1)*td(8)*(td(7)*ce*td(i+3)-x(1)*se*td(i))/r
56  RETURN
57  END
58 
Definition: dataday.h:40