OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
delm.f
Go to the documentation of this file.
1  SUBROUTINE delm(RE,GE,AJ2,X,DX)
2 C VERSION 4/17/87
3 C COMPUTES OSCULATING - MEAN ELEMENTS WHEN GIVEN MEAN ELEMENTS
4 C INPUT
5 C RE = RADIUS OF PLANET (KM)
6 C GE = GRAVITATIONAL CONSTANT * MASS OF PLANET (KM**3/SEC**2)
7 C AJ2 = J2, = -C20
8 C X = MEAN ELEMENTS
9 C X(1) = A, SEMI-MAJOR AXIS (KM)
10 C X(2) = E, ECCENTRICITY
11 C X(3) = I, INCLINATION (RAD)
12 C X(4) = NODE, LONGITUDE OF ASCENDING NODE (RAD)
13 C X(5) = W, ARGUMENT OF PERIAPSIS (RAD)
14 C X(6) = M, MEAN ANOMALY (RAD)
15 C OUTPUT
16 C DX = ARRAY OF 6 VALUES = OSCULATING - MEAN ELEMENTS
17 C CALL SUBROUTINES
18 C ANOMLY
19 C REFERENCES
20 C JPL IOM 312/85.2-927, 23 JANUARY 1985, BY C. UPHOFF
21 C JPL EM 312/87-153, 20 APRIL 1987
22 C ANALYSIS
23 C JOHNNY H. KWOK - JPL
24 C PROGRAMMER
25 C JOHNNY H. KWOK - JPL
26 C MODIFICATIONS
27 C NONE
28 C COMMENTS
29 C THIS PROGRAM USES AN ALGORITHM DERIVED BY C. UPHOFF (REF) WHICH
30 C USES A COMBINATION OF KOZAI'S AND IZSAK'S THEORY
31 C
32  IMPLICIT DOUBLE PRECISION (a-h,o-z)
33  dimension x(6),dx(6)
34  DATA half,one,two,three,four,five,six,seven
35  1 /0.5d0,1.d0,2.d0,3.d0,4.d0,5.d0,6.d0,7.d0/
36  DATA f14,f34,f32,f18/0.25d0,0.75d0,1.5d0,0.125d0/
37  DATA tpi/6.283185307179586d0/
38  a=x(1)
39  e=x(2)
40  ai=x(3)
41  an=x(4)
42  w=x(5)
43  am=x(6)
44  CALL anomly(2,am,e,f)
45 C
46 C *** AM AND F HAVE TO BE IN THE SAME QUADRANT
47 C
48  f=dmod(f+tpi,tpi)
49  am=dmod(am+tpi,tpi)
50  si=dsin(ai)
51  ci=dcos(ai)
52  ti=si/ci
53  si2=si*si
54  ci2=ci*ci
55  sf=dsin(f)
56  cf=dcos(f)
57  s2f=dsin(two*f)
58  u=f+w
59  e2=e*e
60  esf=e*sf
61  d1=one-e2
62  d2=dsqrt(d1)
63  d3=e*cf
64  d4=one+d3
65  d42=d4*d4
66  d5=one+d2
67  d6=(three*ci2-one)/d5
68  p=a*d1
69  d7=dsqrt(ge/p)
70  r=p/d4
71  rdot=d7*esf
72  twou=two*u
73  twow=two*w
74  s2u=dsin(twou)
75  c2u=dcos(twou)
76  sf2w=dsin(f+twow)
77  d8=three*f+twow
78  s3f2w=dsin(d8)
79  cf2w=dcos(f+twow)
80  c3f2w=dcos(d8)
81  q1=aj2*(re/p)**2
82  di=f34*q1*si*ci*(c2u+e*cf2w+e/three*c3f2w)
83  dp=two*p*ti*di
84  dummy1=f-am+esf-half*s2u-half*e*sf2w-e*s3f2w/six
85  dn=-f32*q1*ci*dummy1
86  dr=-f14*p*q1*((three*ci2-one)*(two*d2/d4+d3/d5+one)-si2*c2u)
87  drdot=f14*d7*q1*(d6*esf*(d2*d5+d42)-two*si2*d42*s2u)
88  du=-f18*q1*(six*(one-five*ci2)*(f-am)+four*esf*((one-six*ci2)
89  1 -d6)-d6*e2*s2f+two*(five*ci2-two)*e*sf2w+(seven*ci2-one)*s2u
90  2 +two*ci2*e*s3f2w)
91  pnw=p+dp
92  ainw=ai+di
93  annw=an+dn
94  rnw=r+dr
95  rdotnw=rdot+drdot
96  unw=u+du
97  aa=pnw/rnw-one
98  bb=dsqrt(pnw/ge)*rdotnw
99  enw2=aa*aa+bb*bb
100  enw=dsqrt(enw2)
101  fnw=datan2(bb,aa)
102  anw=pnw/(one-enw2)
103  wnw=unw-fnw
104  CALL anomly(5,fnw,enw,amnw)
105  dx(1)=anw-a
106  dx(2)=enw-e
107  dx(3)=ainw-ai
108  dx(4)=annw-an
109  dx(5)=wnw-w
110  dx(6)=amnw-am
111  RETURN
112  END
subroutine anomly(NFLG, AIN, E, AOUT)
Definition: anomly.f:2
#define re
Definition: l1_czcs_hdf.c:701
#define f
Definition: l1_czcs_hdf.c:702
int s2u(const char *in, char *out)
Definition: wrapper.c:36
subroutine delm(RE, GE, AJ2, X, DX)
Definition: delm.f:2