14 #define wmmData wmmDta2010
101 { 1, 0, -29616.0, 0.0, 14.7, 0.0 },
102 { 1, 1, -1722.7, 5194.5, 11.1, -20.4 },
103 { 2, 0, -2266.7, 0.0, -13.6, 0.0 },
104 { 2, 1, 3070.2, -2484.8, -0.7, -21.5 },
105 { 2, 2, 1677.6, -467.9, -1.8, -9.6 },
106 { 3, 0, 1322.4, 0.0, 0.3, 0.0 },
107 { 3, 1, -2291.5, -224.7, -4.3, 6.4 },
108 { 3, 2, 1255.9, 293.0, 0.9, -1.3 },
109 { 3, 3, 724.8, -486.5, -8.4, -13.3 },
110 { 4, 0, 932.1, 0.0, -1.6, 0.0 },
111 { 4, 1, 786.3, 273.3, 0.9, 2.3 },
112 { 4, 2, 250.6, -227.9, -7.6, 0.7 },
113 { 4, 3, -401.5, 120.9, 2.2, 3.7 },
114 { 4, 4, 106.2, -302.7, -3.2, -0.5 },
115 { 5, 0, -211.9, 0.0, -0.9, 0.0 },
116 { 5, 1, 351.6, 42.0, -0.2, 0.0 },
117 { 5, 2, 220.8, 173.8, -2.5, 2.1 },
118 { 5, 3, -134.5, -135.0, -2.7, 2.3 },
119 { 5, 4, -168.8, -38.6, -0.9, 3.1 },
120 { 5, 5, -13.3, 105.2, 1.7, 0.0 },
121 { 6, 0, 73.8, 0.0, 1.2, 0.0 },
122 { 6, 1, 68.2, -17.4, 0.2, -0.3 },
123 { 6, 2, 74.1, 61.2, 1.7, -1.7 },
124 { 6, 3, -163.5, 63.2, 1.6, -0.9 },
125 { 6, 4, -3.8, -62.9, -0.1, -1.0 },
126 { 6, 5, 17.1, 0.2, -0.3, -0.1 },
127 { 6, 6, -85.1, 43.0, 0.8, 1.9 },
128 { 7, 0, 77.4, 0.0, -0.4, 0.0 },
129 { 7, 1, -73.9, -62.3, -0.8, 1.4 },
130 { 7, 2, 2.2, -24.5, -0.2, 0.2 },
131 { 7, 3, 35.7, 8.9, 1.1, 0.7 },
132 { 7, 4, 7.3, 23.4, 0.4, 0.4 },
133 { 7, 5, 5.2, 15.0, 0.0, -0.3 },
134 { 7, 6, 8.4, -27.6, -0.2, -0.8 },
135 { 7, 7, -1.5, -7.8, -0.2, -0.1 },
136 { 8, 0, 23.3, 0.0, -0.3, 0.0 },
137 { 8, 1, 7.3, 12.4, 0.6, -0.5 },
138 { 8, 2, -8.5, -20.8, -0.8, 0.1 },
139 { 8, 3, -6.6, 8.4, 0.3, -0.2 },
140 { 8, 4, -16.9, -21.2, -0.2, 0.0 },
141 { 8, 5, 8.6, 15.5, 0.5, 0.1 },
142 { 8, 6, 4.9, 9.1, 0.0, -0.1 },
143 { 8, 7, -7.8, -15.5, -0.6, 0.3 },
144 { 8, 8, -7.6, -5.4, 0.1, 0.2 },
145 { 9, 0, 5.7, 0.0, 0.0, 0.0 },
146 { 9, 1, 8.5, -20.4, 0.0, 0.0 },
147 { 9, 2, 2.0, 13.9, 0.0, 0.0 },
148 { 9, 3, -9.8, 12.0, 0.0, 0.0 },
149 { 9, 4, 7.6, -6.2, 0.0, 0.0 },
150 { 9, 5, -7.0, -8.6, 0.0, 0.0 },
151 { 9, 6, -2.0, 9.4, 0.0, 0.0 },
152 { 9, 7, 9.2, 5.0, 0.0, 0.0 },
153 { 9, 8, -2.2, -8.4, 0.0, 0.0 },
154 { 9, 9, -6.6, 3.2, 0.0, 0.0 },
155 { 10, 0, -2.2, 0.0, 0.0, 0.0 },
156 { 10, 1, -5.7, 0.9, 0.0, 0.0 },
157 { 10, 2, 1.6, -0.7, 0.0, 0.0 },
158 { 10, 3, -3.7, 3.9, 0.0, 0.0 },
159 { 10, 4, -0.6, 4.8, 0.0, 0.0 },
160 { 10, 5, 4.1, -5.3, 0.0, 0.0 },
161 { 10, 6, 2.2, -1.0, 0.0, 0.0 },
162 { 10, 7, 2.2, -2.4, 0.0, 0.0 },
163 { 10, 8, 4.6, 1.3, 0.0, 0.0 },
164 { 10, 9, 2.3, -2.3, 0.0, 0.0 },
165 { 10, 10, 0.1, -6.4, 0.0, 0.0 },
166 { 11, 0, 3.3, 0.0, 0.0, 0.0 },
167 { 11, 1, -1.1, -1.5, 0.0, 0.0 },
168 { 11, 2, -2.4, 0.7, 0.0, 0.0 },
169 { 11, 3, 2.6, -1.1, 0.0, 0.0 },
170 { 11, 4, -1.3, -2.3, 0.0, 0.0 },
171 { 11, 5, -1.7, 1.3, 0.0, 0.0 },
172 { 11, 6, -0.6, -0.6, 0.0, 0.0 },
173 { 11, 7, 0.4, -2.8, 0.0, 0.0 },
174 { 11, 8, 0.7, -1.6, 0.0, 0.0 },
175 { 11, 9, -0.3, -0.1, 0.0, 0.0 },
176 { 11, 10, 2.3, -1.9, 0.0, 0.0 },
177 { 11, 11, 4.2, 1.4, 0.0, 0.0 },
178 { 12, 0, -1.5, 0.0, 0.0, 0.0 },
179 { 12, 1, -0.2, -1.0, 0.0, 0.0 },
180 { 12, 2, -0.3, 0.7, 0.0, 0.0 },
181 { 12, 3, 0.5, 2.2, 0.0, 0.0 },
182 { 12, 4, 0.2, -2.5, 0.0, 0.0 },
183 { 12, 5, 0.9, -0.2, 0.0, 0.0 },
184 { 12, 6, -1.4, 0.0, 0.0, 0.0 },
185 { 12, 7, 0.6, -0.2, 0.0, 0.0 },
186 { 12, 8, -0.6, 0.0, 0.0, 0.0 },
187 { 12, 9, -1.0, 0.2, 0.0, 0.0 },
188 { 12, 10, -0.3, -0.9, 0.0, 0.0 },
189 { 12, 11, 0.3, -0.2, 0.0, 0.0 },
190 { 12, 12, 0.4, 1.0, 0.0, 0.0 }
202 { 1, 0, -29556.8, 0.0, 8.0, 0.0},
203 { 1, 1, -1671.7, 5079.8, 10.6, -20.9},
204 { 2, 0, -2340.6, 0.0, -15.1, 0.0},
205 { 2, 1, 3046.9, -2594.7, -7.8, -23.2},
206 { 2, 2, 1657.0, -516.7, -0.8, -14.6},
207 { 3, 0, 1335.4, 0.0, 0.4, 0.0},
208 { 3, 1, -2305.1, -199.9, -2.6, 5.0},
209 { 3, 2, 1246.7, 269.3, -1.2, -7.0},
210 { 3, 3, 674.0, -524.2, -6.5, -0.6},
211 { 4, 0, 919.8, 0.0, -2.5, 0.0},
212 { 4, 1, 798.1, 281.5, 2.8, 2.2},
213 { 4, 2, 211.3, -226.0, -7.0, 1.6},
214 { 4, 3, -379.4, 145.8, 6.2, 5.8},
215 { 4, 4, 100.0, -304.7, -3.8, 0.1},
216 { 5, 0, -227.4, 0.0, -2.8, 0.0},
217 { 5, 1, 354.6, 42.4, 0.7, 0.0},
218 { 5, 2, 208.7, 179.8, -3.2, 1.7},
219 { 5, 3, -136.5, -123.0, -1.1, 2.1},
220 { 5, 4, -168.3, -19.5, 0.1, 4.8},
221 { 5, 5, -14.1, 103.6, -0.8, -1.1},
222 { 6, 0, 73.2, 0.0, -0.7, 0.0},
223 { 6, 1, 69.7, -20.3, 0.4, -0.6},
224 { 6, 2, 76.7, 54.7, -0.3, -1.9},
225 { 6, 3, -151.2, 63.6, 2.3, -0.4},
226 { 6, 4, -14.9, -63.4, -2.1, -0.5},
227 { 6, 5, 14.6, -0.1, -0.6, -0.3},
228 { 6, 6, -86.3, 50.4, 1.4, 0.7},
229 { 7, 0, 80.1, 0.0, 0.2, 0.0},
230 { 7, 1, -74.5, -61.5, -0.1, 0.6},
231 { 7, 2, -1.4, -22.4, -0.3, 0.4},
232 { 7, 3, 38.5, 7.2, 1.1, 0.2},
233 { 7, 4, 12.4, 25.4, 0.6, 0.3},
234 { 7, 5, 9.5, 11.0, 0.5, -0.8},
235 { 7, 6, 5.7, -26.4, -0.4, -0.2},
236 { 7, 7, 1.8, -5.1, 0.6, 0.1},
237 { 8, 0, 24.9, 0.0, 0.1, 0.0},
238 { 8, 1, 7.7, 11.2, 0.3, -0.2},
239 { 8, 2, -11.6, -21.0, -0.4, 0.1},
240 { 8, 3, -6.9, 9.6, 0.3, 0.3},
241 { 8, 4, -18.2, -19.8, -0.3, 0.4},
242 { 8, 5, 10.0, 16.1, 0.2, 0.1},
243 { 8, 6, 9.2, 7.7, 0.4, -0.2},
244 { 8, 7, -11.6, -12.9, -0.7, 0.4},
245 { 8, 8, -5.2, -0.2, 0.4, 0.4},
246 { 9, 0, 5.6, 0.0, 0.0, 0.0},
247 { 9, 1, 9.9, -20.1, 0.0, 0.0},
248 { 9, 2, 3.5, 12.9, 0.0, 0.0},
249 { 9, 3, -7.0, 12.6, 0.0, 0.0},
250 { 9, 4, 5.1, -6.7, 0.0, 0.0},
251 { 9, 5, -10.8, -8.1, 0.0, 0.0},
252 { 9, 6, -1.3, 8.0, 0.0, 0.0},
253 { 9, 7, 8.8, 2.9, 0.0, 0.0},
254 { 9, 8, -6.7, -7.9, 0.0, 0.0},
255 { 9, 9, -9.1, 6.0, 0.0, 0.0},
256 { 10, 0, -2.3, 0.0, 0.0, 0.0},
257 { 10, 1, -6.3, 2.4, 0.0, 0.0},
258 { 10, 2, 1.6, 0.2, 0.0, 0.0},
259 { 10, 3, -2.6, 4.4, 0.0, 0.0},
260 { 10, 4, 0.0, 4.8, 0.0, 0.0},
261 { 10, 5, 3.1, -6.5, 0.0, 0.0},
262 { 10, 6, 0.4, -1.1, 0.0, 0.0},
263 { 10, 7, 2.1, -3.4, 0.0, 0.0},
264 { 10, 8, 3.9, -0.8, 0.0, 0.0},
265 { 10, 9, -0.1, -2.3, 0.0, 0.0},
266 { 10, 10, -2.3, -7.9, 0.0, 0.0},
267 { 11, 0, 2.8, 0.0, 0.0, 0.0},
268 { 11, 1, -1.6, 0.3, 0.0, 0.0},
269 { 11, 2, -1.7, 1.2, 0.0, 0.0},
270 { 11, 3, 1.7, -0.8, 0.0, 0.0},
271 { 11, 4, -0.1, -2.5, 0.0, 0.0},
272 { 11, 5, 0.1, 0.9, 0.0, 0.0},
273 { 11, 6, -0.7, -0.6, 0.0, 0.0},
274 { 11, 7, 0.7, -2.7, 0.0, 0.0},
275 { 11, 8, 1.8, -0.9, 0.0, 0.0},
276 { 11, 9, 0.0, -1.3, 0.0, 0.0},
277 { 11, 10, 1.1, -2.0, 0.0, 0.0},
278 { 11, 11, 4.1, -1.2, 0.0, 0.0},
279 { 12, 0, -2.4, 0.0, 0.0, 0.0},
280 { 12, 1, -0.4, -0.4, 0.0, 0.0},
281 { 12, 2, 0.2, 0.3, 0.0, 0.0},
282 { 12, 3, 0.8, 2.4, 0.0, 0.0},
283 { 12, 4, -0.3, -2.6, 0.0, 0.0},
284 { 12, 5, 1.1, 0.6, 0.0, 0.0},
285 { 12, 6, -0.5, 0.3, 0.0, 0.0},
286 { 12, 7, 0.4, 0.0, 0.0, 0.0},
287 { 12, 8, -0.3, 0.0, 0.0, 0.0},
288 { 12, 9, -0.3, 0.3, 0.0, 0.0},
289 { 12, 10, -0.1, -0.9, 0.0, 0.0},
290 { 12, 11, -0.3, -0.4, 0.0, 0.0},
291 { 12, 12, -0.1, 0.8, 0.0, 0.0}
300 { 1, 0, -29496.6, 0.0, 11.6, 0.0},
301 { 1, 1, -1586.3, 4944.4, 16.5, -25.9},
302 { 2, 0, -2396.6, 0.0, -12.1, 0.0},
303 { 2, 1, 3026.1, -2707.7, -4.4, -22.5},
304 { 2, 2, 1668.6, -576.1, 1.9, -11.8},
305 { 3, 0, 1340.1, 0.0, 0.4, 0.0},
306 { 3, 1, -2326.2, -160.2, -4.1, 7.3},
307 { 3, 2, 1231.9, 251.9, -2.9, -3.9},
308 { 3, 3, 634.0, -536.6, -7.7, -2.6},
309 { 4, 0, 912.6, 0.0, -1.8, 0.0},
310 { 4, 1, 808.9, 286.4, 2.3, 1.1},
311 { 4, 2, 166.7, -211.2, -8.7, 2.7},
312 { 4, 3, -357.1, 164.3, 4.6, 3.9},
313 { 4, 4, 89.4, -309.1, -2.1, -0.8},
314 { 5, 0, -230.9, 0.0, -1.0, 0.0},
315 { 5, 1, 357.2, 44.6, 0.6, 0.4},
316 { 5, 2, 200.3, 188.9, -1.8, 1.8},
317 { 5, 3, -141.1, -118.2, -1.0, 1.2},
318 { 5, 4, -163.0, 0.0, 0.9, 4.0},
319 { 5, 5, -7.8, 100.9, 1.0, -0.6},
320 { 6, 0, 72.8, 0.0, -0.2, 0.0},
321 { 6, 1, 68.6, -20.8, -0.2, -0.2},
322 { 6, 2, 76.0, 44.1, -0.1, -2.1},
323 { 6, 3, -141.4, 61.5, 2.0, -0.4},
324 { 6, 4, -22.8, -66.3, -1.7, -0.6},
325 { 6, 5, 13.2, 3.1, -0.3, 0.5},
326 { 6, 6, -77.9, 55.0, 1.7, 0.9},
327 { 7, 0, 80.5, 0.0, 0.1, 0.0},
328 { 7, 1, -75.1, -57.9, -0.1, 0.7},
329 { 7, 2, -4.7, -21.1, -0.6, 0.3},
330 { 7, 3, 45.3, 6.5, 1.3, -0.1},
331 { 7, 4, 13.9, 24.9, 0.4, -0.1},
332 { 7, 5, 10.4, 7.0, 0.3, -0.8},
333 { 7, 6, 1.7, -27.7, -0.7, -0.3},
334 { 7, 7, 4.9, -3.3, 0.6, 0.3},
335 { 8, 0, 24.4, 0.0, -0.1, 0.0},
336 { 8, 1, 8.1, 11.0, 0.1, -0.1},
337 { 8, 2, -14.5, -20.0, -0.6, 0.2},
338 { 8, 3, -5.6, 11.9, 0.2, 0.4},
339 { 8, 4, -19.3, -17.4, -0.2, 0.4},
340 { 8, 5, 11.5, 16.7, 0.3, 0.1},
341 { 8, 6, 10.9, 7.0, 0.3, -0.1},
342 { 8, 7, -14.1, -10.8, -0.6, 0.4},
343 { 8, 8, -3.7, 1.7, 0.2, 0.3},
344 { 9, 0, 5.4, 0.0, 0.0, 0.0},
345 { 9, 1, 9.4, -20.5, -0.1, 0.0},
346 { 9, 2, 3.4, 11.5, 0.0, -0.2},
347 { 9, 3, -5.2, 12.8, 0.3, 0.0},
348 { 9, 4, 3.1, -7.2, -0.4, -0.1},
349 { 9, 5, -12.4, -7.4, -0.3, 0.1},
350 { 9, 6, -0.7, 8.0, 0.1, 0.0},
351 { 9, 7, 8.4, 2.1, -0.1, -0.2},
352 { 9, 8, -8.5, -6.1, -0.4, 0.3},
353 { 9, 9, -10.1, 7.0, -0.2, 0.2},
354 { 10, 0, -2.0, 0.0, 0.0, 0.0},
355 { 10, 1, -6.3, 2.8, 0.0, 0.1},
356 { 10, 2, 0.9, -0.1, -0.1, -0.1},
357 { 10, 3, -1.1, 4.7, 0.2, 0.0},
358 { 10, 4, -0.2, 4.4, 0.0, -0.1},
359 { 10, 5, 2.5, -7.2, -0.1, -0.1},
360 { 10, 6, -0.3, -1.0, -0.2, 0.0},
361 { 10, 7, 2.2, -3.9, 0.0, -0.1},
362 { 10, 8, 3.1, -2.0, -0.1, -0.2},
363 { 10, 9, -1.0, -2.0, -0.2, 0.0},
364 { 10, 10, -2.8, -8.3, -0.2, -0.1},
365 { 11, 0, 3.0, 0.0, 0.0, 0.0},
366 { 11, 1, -1.5, 0.2, 0.0, 0.0},
367 { 11, 2, -2.1, 1.7, 0.0, 0.1},
368 { 11, 3, 1.7, -0.6, 0.1, 0.0},
369 { 11, 4, -0.5, -1.8, 0.0, 0.1},
370 { 11, 5, 0.5, 0.9, 0.0, 0.0},
371 { 11, 6, -0.8, -0.4, 0.0, 0.1},
372 { 11, 7, 0.4, -2.5, 0.0, 0.0},
373 { 11, 8, 1.8, -1.3, 0.0, -0.1},
374 { 11, 9, 0.1, -2.1, 0.0, -0.1},
375 { 11, 10, 0.7, -1.9, -0.1, 0.0},
376 { 11, 11, 3.8, -1.8, 0.0, -0.1},
377 { 12, 0, -2.2, 0.0, 0.0, 0.0},
378 { 12, 1, -0.2, -0.9, 0.0, 0.0},
379 { 12, 2, 0.3, 0.3, 0.1, 0.0},
380 { 12, 3, 1.0, 2.1, 0.1, 0.0},
381 { 12, 4, -0.6, -2.5, -0.1, 0.0},
382 { 12, 5, 0.9, 0.5, 0.0, 0.0},
383 { 12, 6, -0.1, 0.6, 0.0, 0.1},
384 { 12, 7, 0.5, 0.0, 0.0, 0.0},
385 { 12, 8, -0.4, 0.1, 0.0, 0.0},
386 { 12, 9, -0.4, 0.3, 0.0, 0.0},
387 { 12, 10, 0.2, -0.9, 0.0, 0.0},
388 { 12, 11, -0.8, -0.2, -0.1, 0.0},
389 { 12, 12, 0.0, 0.9, 0.1, 0.0}
427 double flnmj,n2m1,nm12,n2m1stuff;
436 cp[0] =
p[0][0] =
pp[0] = 1.0;
468 n2m1 = (double)2*n-1;
469 n2m1stuff = (double)(n2m1*(2*n-3));
474 k[m][
n] = (double)(nm12-(m*m))/n2m1stuff;
477 flnmj = (double)((n-m+1)*j)/(
double)(n+m);
486 fn[
n] = (double)(n+1);
524 double *dec,
double *dip,
double *ti,
double *gv,
525 double *adec,
double *adip,
double *ati,
526 double *x,
double *y,
double *z,
double *h,
527 double *ax,
double *ay,
double *az,
double *ah)
530 double dec2, dip2, ti2, rdec, rdip, rdec2, rdip2;
532 double c_rdip,c_rdip2;
537 geomg1(alt,glat,glon,time,dec,dip,ti,gv);
539 geomg1(alt,glat,glon,time1,&dec2,&dip2,&ti2,gv);
549 c_rdip2 = cos(rdip2);
561 *x= *ti * (cos(rdec) * c_rdip);
562 *y= *ti * (c_rdip * sin(rdec));
563 *z= *ti * (sin(rdip));
566 x2=ti2*(cos(rdec2) * c_rdip2);
567 y2=ti2*(c_rdip2 * sin(rdec2));
596 double *dec,
double *dip,
double *ti,
double *gv)
648 double temp1, temp2,d,ar,aor,dt,bpp,
649 par, parp,r,r2,sa,ca,st,ct,br,bt,bp,bx,by,bz,bh;
652 srlon, srlat, crlon, crlat,
687 srlat2 = srlat*srlat;
688 crlat2 = crlat*crlat;
694 q = sqrt(a2-c2*srlat2);
696 q2 = ((q1+a2)/(q1+b2))*((q1+a2)/(q1+b2));
697 ct = srlat/sqrt(q2*crlat2+srlat2);
698 st = sqrt(1.0-(ct*ct));
699 r2 = (alt*alt)+2.0*q1+(a4-c4*srlat2)/(q*q);
701 d = sqrt(a2*crlat2+b2*srlat2);
703 sa = c2*crlat*srlat/(r*d);
708 cp[m] =
cp[1]*
cp[m-1]-sp[1]*sp[m-1];
713 br = bt = bp = bpp = 0.0;
725 p[m][
n] = st *
p[m-1][n-1];
726 dp[m][
n] = st *
dp[m-1][n-1] + ct * p[m-1][n-1];
729 if (n == 1 && m == 0)
731 p[m][
n] = ct *
p[m][n-1];
732 dp[m][
n] = ct *
dp[m][n-1] - st * p[m][n-1];
737 if (m > n-2)
p[m][n-2] = 0.0;
738 if (m > n-2)
dp[m][n-2] = 0.0;
739 p[m][
n] = ct *
p[m][n-1] -
k[m][
n] *
p[m][n-2];
740 dp[m][
n] = ct *
dp[m][n-1] - st * p[m][n-1] -
k[m][
n] *
dp[m][n-2];
745 if (m != 0)
tc[
n][m-1] =
c[
n][m-1]+dt*cd[
n][m-1];
751 temp1 =
tc[m][
n]*
cp[m];
752 temp2 =
tc[m][
n]*
sp[m];
757 temp2 =
tc[m][
n]*sp[m]-
tc[
n][m-1]*
cp[m];
759 bt = bt-ar*temp1*
dp[m][
n];
760 bp += (
fm[m]*temp2*par);
761 br += (
fn[
n]*temp1*par);
764 if (st == 0.0 && m == 1)
766 if (n == 1)
pp[
n] =
pp[n-1];
769 bpp += (
fm[m]*temp2*parp);
773 if (st == 0.0) bp = bpp;
786 bh = sqrt((bx*bx)+(by*by));
787 *ti = sqrt((bh*bh)+(bz*bz));
799 if (fabs(glat) >= 55.)
801 if (glat > 0.0 && glon >= 0.0) *gv = *dec-glon;
802 if (glat > 0.0 && glon < 0.0) *gv = *dec+fabs(glon);
803 if (glat < 0.0 && glon >= 0.0) *gv = *dec+glon;
804 if (glat < 0.0 && glon < 0.0) *gv = *dec-fabs(glon);
826 int month,
int day,
int year,
double *dec)
829 int jday[] = {0,0,31,59,90,120,151,180,211,242,272,303,333 };
830 double time,dip,ti,gv;
833 time = ((jday[month]+day) / 365.0) + year;
837 geomg1(hgt,lat,lon,time,dec,&dip,&ti,&gv);
856 int month,
int day,
int year)
860 int jday[] = {0,0,31,59,90,120,151,180,211,242,272,303,333 };
861 double time,dip,ti,gv;
864 time = ((jday[month]+day) / 365.0) + year;
868 geomg1(hgt,lat,lon,time,&dec,&dip,&ti,&gv);
890 newtime = localtime( &aclock );
892 if(newtime->tm_year < 200 ) newtime->tm_year += 1900;
896 newtime->tm_mon+1, newtime->tm_mday, newtime->tm_year, &dec);
910 newtime = localtime( &aclock );
912 if(newtime->tm_year < 200 ) newtime->tm_year += 1900;
916 newtime->tm_mon+1, newtime->tm_mday, newtime->tm_year, dec);
928 double ati, adec, adip;
930 double time, dec, dip, ti;
941 geoMag(alt,dlat,dlon,time,&dec,&dip,&ti,&gv,&adec,&adip,&ati,
942 &x, &y, &z, &h, &ax, &ay, &az, &ah);
945 printf(
"\nLATITUDE: %7.2f Deg",dlat);
946 printf(
" LONGITUDE: %7.2f Deg",dlon);
947 printf(
" ALTITUDE: %.2f M",alt);
948 printf(
"\n DATE : %5.1f\n",time);
949 printf(
"\n\t\t\t OUTPUT\n\t\t\t ------");
950 printf(
"\n\nMAIN FIELD COMPONENTS\t\t\t ANNUAL CHANGE");
951 printf(
"\n---------------------\t\t\t -------------\n");
952 printf(
"\n TI = %-7.0f nT\t\t TI = %-6.0f nT/yr",ti,ati);
953 printf(
"\n HI = %-7.0f nT\t\t HI = %-6.0f nT/yr",h,ah);
954 printf(
"\n X = %-7.0f nT\t\t X = %-6.0f nT/yr ",x,ax);
955 printf(
"\n Y = %-7.0f nT\t\t Y = %-6.0f nT/yr ",y,ay);
956 printf(
"\n Z = %-7.0f nT\t\t Z = %-6.0f nT/yr ",z,az);
957 printf(
"\n DEC = %-7.2f DEG\t\t DEC = %-6.2f MIN/yr [%-6.2f deg/yr] ",dec,adec,adec/60.0);
958 printf(
"\n DIP = %-7.2f DEG\t\t DIP = %-6.2f MIN/yr\n",dip,adip);
962 printf(
"----------------------------------------------------------\n");
963 printf(
" Yearly Declination Values \n");
964 printf(
"----------------------------------------------------------\n");
968 printf(
"%04d : %f deg\n",i+2000,dec);
972 printf(
"\n\n----------------------------------------------------------\n");
973 printf(
" Lat, Lon, Hgt, and time (MM/DD/YY) declination example \n");
974 printf(
"----------------------------------------------------------\n");
977 printf(
" Declination for %7.1f latitude, %5.1f longitude, %5.1f altitude \n is %4.2f degrees on 6/1/2000\n",
978 dlat, dlon, alt, dec);