1 /* zzenut80.f -- translated by f2c (version 19980913).
2    You must link the resulting object file with the libraries:
3 	-lf2c -lm   (in that order)
4 */
5 
6 #include "f2c.h"
7 
8 /* Table of constant values */
9 
10 static integer c__1 = 1;
11 static integer c__3 = 3;
12 
13 /* $Procedure ZZENUT80 ( Earth nutation transformation, IAU 1980 model ) */
zzenut80_(doublereal * et,doublereal * nutxf)14 /* Subroutine */ int zzenut80_(doublereal *et, doublereal *nutxf)
15 {
16     doublereal dmob;
17     extern /* Subroutine */ int zzmobliq_(doublereal *, doublereal *,
18 	    doublereal *), chkin_(char *, ftnlen);
19     doublereal dvnut[4];
20     extern /* Subroutine */ int eul2xf_(doublereal *, integer *, integer *,
21 	    integer *, doublereal *);
22     doublereal eulang[6];
23     extern /* Subroutine */ int chkout_(char *, ftnlen);
24     extern logical return_(void);
25     extern /* Subroutine */ int zzwahr_(doublereal *, doublereal *);
26     doublereal mob;
27 
28 /* $ Abstract */
29 
30 /*     SPICE Private routine intended solely for the support of SPICE */
31 /*     routines.  Users should not call this routine directly due */
32 /*     to the volatile nature of this routine. */
33 
34 /*     Compute the state transformation matrix implementing the IAU 1980 */
35 /*     nutation model. */
36 
37 /* $ Disclaimer */
38 
39 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
40 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
41 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
42 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
43 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
44 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
45 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
46 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
47 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
48 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
49 
50 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
51 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
52 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
53 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
54 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
55 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
56 
57 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
58 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
59 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
60 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
61 
62 /* $ Required_Reading */
63 
64 /*     None. */
65 
66 /* $ Keywords */
67 
68 /*     FRAMES */
69 /*     MATRIX */
70 /*     PRIVATE */
71 /*     TRANSFORMATION */
72 /*     UTILITY */
73 
74 /* $ Declarations */
75 /* $ Brief_I/O */
76 
77 /*     VARIABLE  I/O  DESCRIPTION */
78 /*     --------  ---  ------------------------------------------------- */
79 /*     ET         I   Ephemeris time, seconds past J2000. */
80 /*     NUTXF      O   Nutation transformation matrix. */
81 
82 /* $ Detailed_Input */
83 
84 /*     ET             is an epoch, expressed as seconds past J2000 TDB. */
85 
86 /* $ Detailed_Output */
87 
88 /*     NUTXF          is a state transformation matrix that maps states */
89 /*                    from the earth mean equator and equinox of date */
90 /*                    frame (based on the 1976 IAU precession model) to */
91 /*                    the earth true equator and equinox frame of date */
92 /*                    (based on the 1980 IAU nutation model). */
93 
94 /* $ Parameters */
95 
96 /*     None. */
97 
98 /* $ Exceptions */
99 
100 /*     Error free. */
101 
102 /* $ Files */
103 
104 /*     None. */
105 
106 /* $ Particulars */
107 
108 /*     See the private SPICELIB routine ZZWAHR for a discussion */
109 /*     of the implementation of the 1980 IAU nutation model. */
110 
111 /*     See the private SPICELIB routine ZZMOBLIQ for a discussion */
112 /*     of the implementation of the 1980 IAU earth mean obliquity */
113 /*     of date model. */
114 
115 /* $ Examples */
116 
117 /*     See ZZDYNFRM. */
118 
119 /* $ Restrictions */
120 
121 /*     1) This is a SPICE private routine; the routine is subject */
122 /*        to change without notice.  User applications should not */
123 /*        call this routine. */
124 
125 /* $ Author_and_Institution */
126 
127 /*     N.J. Bachman    (JPL) */
128 
129 /* $ Literature_References */
130 
131 /*     [1] "Explanatory Supplement to the Astronomical Almanac" */
132 /*          edited by P. Kenneth Seidelmann. University Science */
133 /*          Books, 20 Edgehill Road, Mill Valley, CA 94941 (1992) */
134 
135 /*     [2] "Section 5, Geocentric Space-Fixed Position, Velocity, and */
136 /*         Acceleration Vectors of Tracking Station" by T. D. Moyer. */
137 /*         Draft of JPL Publication documenting the JPL navigation */
138 /*         program "Regres." */
139 
140 /* $ Version */
141 
142 /* -    SPICELIB Version 1.0.0, 18-DEC-2004 (NJB) */
143 
144 /* -& */
145 
146 /*     SPICELIB functions */
147 
148 
149 /*     Local variables */
150 
151     if (return_()) {
152 	return 0;
153     }
154     chkin_("ZZENUT80", (ftnlen)8);
155 
156 /*      Get nutation angles and their rates.  We're expecting */
157 
158 /*         DVNUT(1) = Psi------nutation in longitude (radians) */
159 /*         DVNUT(2) = Epsilon--nutation in obliquity (radians) */
160 /*         DVNUT(3) = dPsi/dt     (radians/second) */
161 /*         DVNUT(4) = dEpsilon/dt (radians/second) */
162 
163     zzwahr_(et, dvnut);
164 
165 /*     Get the mean obliquity of date. */
166 
167 /*     We're expecting the outputs to be as follows: */
168 
169 /*         MOB      is the mean obliquity of the ecliptic at epoch */
170 /*                  ET. The mean obliquity of the ecliptic is the */
171 /*                  inclination of the ecliptic of date to the */
172 /*                  mean Earth equator of date.  Output units are */
173 /*                  radians. */
174 
175 /*         DMOB     is the time derivative of MOB at ET, expressed */
176 /*                        in radians per second. */
177     zzmobliq_(et, &mob, &dmob);
178 
179 /*     The nutation rotation N is defined by */
180 
181 
182 /*         N = [ -MOB - NUOBL ]  [ -NULON ]   [ MOB ] */
183 /*                             1           3         1 */
184 
185 /*     where MOBLIQ is the mean obliquity of the earth's ecliptic */
186 /*     at epoch, NUOB is nutation in obliquity at epoch, and */
187 /*     NULONG is nutation in longitude at epoch.  Using our */
188 /*     variable names, the Euler angle sequence is */
189 
190 /*        [ -MOB - DVNUT(2) ]  [ -DVNUT(1) ]  [ MOB ] */
191 /*                           1              3        1 */
192 
193 /*     The rates corresponding to these angles are: */
194 
195 /*        -DMOB - DVNUT(4),  -DVNUT(3),  DMOB */
196 
197 /*     We can use EUL2XF to form the state transformation from */
198 /*     the nutation base frame to the nutation frame. */
199 
200     eulang[0] = -mob - dvnut[1];
201     eulang[1] = -dvnut[0];
202     eulang[2] = mob;
203     eulang[3] = -dmob - dvnut[3];
204     eulang[4] = -dvnut[2];
205     eulang[5] = dmob;
206     eul2xf_(eulang, &c__1, &c__3, &c__1, nutxf);
207     chkout_("ZZENUT80", (ftnlen)8);
208     return 0;
209 } /* zzenut80_ */
210 
211