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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
|
SUBROUTINE sla_CLDJ (IY, IM, ID, DJM, J)
*+
* - - - - -
* C L D J
* - - - - -
*
* Gregorian Calendar to Modified Julian Date
*
* Given:
* IY,IM,ID int year, month, day in Gregorian calendar
*
* Returned:
* DJM dp modified Julian Date (JD-2400000.5) for 0 hrs
* J int status:
* 0 = OK
* 1 = bad year (MJD not computed)
* 2 = bad month (MJD not computed)
* 3 = bad day (MJD computed)
*
* The year must be -4699 (i.e. 4700BC) or later.
*
* The algorithm is adapted from Hatcher 1984 (QJRAS 25, 53-55).
*
* Last revision: 27 July 2004
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
INTEGER IY,IM,ID
DOUBLE PRECISION DJM
INTEGER J
* Month lengths in days
INTEGER MTAB(12)
DATA MTAB / 31,28,31,30,31,30,31,31,30,31,30,31 /
* Preset status.
J = 0
* Validate year.
IF ( IY .LT. -4699 ) THEN
J = 1
ELSE
* Validate month.
IF ( IM.GE.1 .AND. IM.LE.12 ) THEN
* Allow for leap year.
IF ( MOD(IY,4) .EQ. 0 ) THEN
MTAB(2) = 29
ELSE
MTAB(2) = 28
END IF
IF ( MOD(IY,100).EQ.0 .AND. MOD(IY,400).NE.0 )
: MTAB(2) = 28
* Validate day.
IF ( ID.LT.1 .OR. ID.GT.MTAB(IM) ) J=3
* Modified Julian Date.
DJM = DBLE ( ( 1461 * ( IY - (12-IM)/10 + 4712 ) ) / 4
: + ( 306 * MOD ( IM+9, 12 ) + 5 ) / 10
: - ( 3 * ( ( IY - (12-IM)/10 + 4900 ) / 100 ) ) / 4
: + ID - 2399904 )
* Bad month.
ELSE
J=2
END IF
END IF
END
DOUBLE PRECISION FUNCTION sla_DAT (UTC)
*+
* - - - -
* D A T
* - - - -
*
* Increment to be applied to Coordinated Universal Time UTC to give
* International Atomic Time TAI (double precision)
*
* Given:
* UTC d UTC date as a modified JD (JD-2400000.5)
*
* Result: TAI-UTC in seconds
*
* Notes:
*
* 1 The UTC is specified to be a date rather than a time to indicate
* that care needs to be taken not to specify an instant which lies
* within a leap second. Though in most cases UTC can include the
* fractional part, correct behaviour on the day of a leap second
* can only be guaranteed up to the end of the second 23:59:59.
*
* 2 For epochs from 1961 January 1 onwards, the expressions from the
* file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
*
* 3 The 5ms time step at 1961 January 1 is taken from 2.58.1 (p87) of
* the 1992 Explanatory Supplement.
*
* 4 UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper
* to call the routine with an earlier epoch. However, if this
* is attempted, the TAI-UTC expression for the year 1960 is used.
*
*
* :-----------------------------------------:
* : :
* : IMPORTANT :
* : :
* : This routine must be updated on each :
* : occasion that a leap second is :
* : announced :
* : :
* : Latest leap second: 2016 Dec 31 :
* : :
* :-----------------------------------------:
*
* Last revision: 30 January 2026
*
* Copyright P.T.Wallace. All rights reserved.
*-
IMPLICIT NONE
DOUBLE PRECISION UTC
DOUBLE PRECISION DT
IF (.FALSE.) THEN
* - - - - - - - - - - - - - - - - - - - - - - *
* Add new code here on each occasion that a *
* leap second is announced, and update the *
* preamble comments appropriately. *
* - - - - - - - - - - - - - - - - - - - - - - *
* 2017 January 1
ELSE IF (UTC.GE.57754D0) THEN
DT=37D0
* 2015 July 1
ELSE IF (UTC.GE.57204D0) THEN
DT=36D0
* 2012 July 1
ELSE IF (UTC.GE.56109D0) THEN
DT=35D0
* 2009 January 1
ELSE IF (UTC.GE.54832D0) THEN
DT=34D0
* 2006 January 1
ELSE IF (UTC.GE.53736D0) THEN
DT=33D0
* 1999 January 1
ELSE IF (UTC.GE.51179D0) THEN
DT=32D0
* 1997 July 1
ELSE IF (UTC.GE.50630D0) THEN
DT=31D0
* 1996 January 1
ELSE IF (UTC.GE.50083D0) THEN
DT=30D0
* 1994 July 1
ELSE IF (UTC.GE.49534D0) THEN
DT=29D0
* 1993 July 1
ELSE IF (UTC.GE.49169D0) THEN
DT=28D0
* 1992 July 1
ELSE IF (UTC.GE.48804D0) THEN
DT=27D0
* 1991 January 1
ELSE IF (UTC.GE.48257D0) THEN
DT=26D0
* 1990 January 1
ELSE IF (UTC.GE.47892D0) THEN
DT=25D0
* 1988 January 1
ELSE IF (UTC.GE.47161D0) THEN
DT=24D0
* 1985 July 1
ELSE IF (UTC.GE.46247D0) THEN
DT=23D0
* 1983 July 1
ELSE IF (UTC.GE.45516D0) THEN
DT=22D0
* 1982 July 1
ELSE IF (UTC.GE.45151D0) THEN
DT=21D0
* 1981 July 1
ELSE IF (UTC.GE.44786D0) THEN
DT=20D0
* 1980 January 1
ELSE IF (UTC.GE.44239D0) THEN
DT=19D0
* 1979 January 1
ELSE IF (UTC.GE.43874D0) THEN
DT=18D0
* 1978 January 1
ELSE IF (UTC.GE.43509D0) THEN
DT=17D0
* 1977 January 1
ELSE IF (UTC.GE.43144D0) THEN
DT=16D0
* 1976 January 1
ELSE IF (UTC.GE.42778D0) THEN
DT=15D0
* 1975 January 1
ELSE IF (UTC.GE.42413D0) THEN
DT=14D0
* 1974 January 1
ELSE IF (UTC.GE.42048D0) THEN
DT=13D0
* 1973 January 1
ELSE IF (UTC.GE.41683D0) THEN
DT=12D0
* 1972 July 1
ELSE IF (UTC.GE.41499D0) THEN
DT=11D0
* 1972 January 1
ELSE IF (UTC.GE.41317D0) THEN
DT=10D0
* 1968 February 1
ELSE IF (UTC.GE.39887D0) THEN
DT=4.2131700D0+(UTC-39126D0)*0.002592D0
* 1966 January 1
ELSE IF (UTC.GE.39126D0) THEN
DT=4.3131700D0+(UTC-39126D0)*0.002592D0
* 1965 September 1
ELSE IF (UTC.GE.39004D0) THEN
DT=3.8401300D0+(UTC-38761D0)*0.001296D0
* 1965 July 1
ELSE IF (UTC.GE.38942D0) THEN
DT=3.7401300D0+(UTC-38761D0)*0.001296D0
* 1965 March 1
ELSE IF (UTC.GE.38820D0) THEN
DT=3.6401300D0+(UTC-38761D0)*0.001296D0
* 1965 January 1
ELSE IF (UTC.GE.38761D0) THEN
DT=3.5401300D0+(UTC-38761D0)*0.001296D0
* 1964 September 1
ELSE IF (UTC.GE.38639D0) THEN
DT=3.4401300D0+(UTC-38761D0)*0.001296D0
* 1964 April 1
ELSE IF (UTC.GE.38486D0) THEN
DT=3.3401300D0+(UTC-38761D0)*0.001296D0
* 1964 January 1
ELSE IF (UTC.GE.38395D0) THEN
DT=3.2401300D0+(UTC-38761D0)*0.001296D0
* 1963 November 1
ELSE IF (UTC.GE.38334D0) THEN
DT=1.9458580D0+(UTC-37665D0)*0.0011232D0
* 1962 January 1
ELSE IF (UTC.GE.37665D0) THEN
DT=1.8458580D0+(UTC-37665D0)*0.0011232D0
* 1961 August 1
ELSE IF (UTC.GE.37512D0) THEN
DT=1.3728180D0+(UTC-37300D0)*0.001296D0
* 1961 January 1
ELSE IF (UTC.GE.37300D0) THEN
DT=1.4228180D0+(UTC-37300D0)*0.001296D0
* Before that
ELSE
DT=1.4178180D0+(UTC-37300D0)*0.001296D0
END IF
sla_DAT=DT
END
SUBROUTINE sla_DC62S (V, A, B, R, AD, BD, RD)
*+
* - - - - - -
* D C 6 2 S
* - - - - - -
*
* Conversion of position & velocity in Cartesian coordinates
* to spherical coordinates (double precision)
*
* Given:
* V d(6) Cartesian position & velocity vector
*
* Returned:
* A d longitude (radians)
* B d latitude (radians)
* R d radial coordinate
* AD d longitude derivative (radians per unit time)
* BD d latitude derivative (radians per unit time)
* RD d radial derivative
*
* P.T.Wallace Starlink 28 April 1996
*
* Copyright (C) 1996 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION V(6),A,B,R,AD,BD,RD
DOUBLE PRECISION X,Y,Z,XD,YD,ZD,RXY2,RXY,R2,XYP
* Components of position/velocity vector
X=V(1)
Y=V(2)
Z=V(3)
XD=V(4)
YD=V(5)
ZD=V(6)
* Component of R in XY plane squared
RXY2=X*X+Y*Y
* Modulus squared
R2=RXY2+Z*Z
* Protection against null vector
IF (R2.EQ.0D0) THEN
X=XD
Y=YD
Z=ZD
RXY2=X*X+Y*Y
R2=RXY2+Z*Z
END IF
* Position and velocity in spherical coordinates
RXY=SQRT(RXY2)
XYP=X*XD+Y*YD
IF (RXY2.NE.0D0) THEN
A=ATAN2(Y,X)
B=ATAN2(Z,RXY)
AD=(X*YD-Y*XD)/RXY2
BD=(ZD*RXY2-Z*XYP)/(R2*RXY)
ELSE
A=0D0
IF (Z.NE.0D0) THEN
B=ATAN2(Z,RXY)
ELSE
B=0D0
END IF
AD=0D0
BD=0D0
END IF
R=SQRT(R2)
IF (R.NE.0D0) THEN
RD=(XYP+Z*ZD)/R
ELSE
RD=0D0
END IF
END
SUBROUTINE sla_DCC2S (V, A, B)
*+
* - - - - - -
* D C C 2 S
* - - - - - -
*
* Cartesian to spherical coordinates (double precision)
*
* Given:
* V d(3) x,y,z vector
*
* Returned:
* A,B d spherical coordinates in radians
*
* The spherical coordinates are longitude (+ve anticlockwise looking
* from the +ve latitude pole) and latitude. The Cartesian coordinates
* are right handed, with the x axis at zero longitude and latitude, and
* the z axis at the +ve latitude pole.
*
* If V is null, zero A and B are returned. At either pole, zero A is
* returned.
*
* Last revision: 22 July 2004
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION V(3),A,B
DOUBLE PRECISION X,Y,Z,R
X = V(1)
Y = V(2)
Z = V(3)
R = SQRT(X*X+Y*Y)
IF (R.EQ.0D0) THEN
A = 0D0
ELSE
A = ATAN2(Y,X)
END IF
IF (Z.EQ.0D0) THEN
B = 0D0
ELSE
B = ATAN2(Z,R)
END IF
END
SUBROUTINE sla_DCS2C (A, B, V)
*+
* - - - - - -
* D C S 2 C
* - - - - - -
*
* Spherical coordinates to direction cosines (double precision)
*
* Given:
* A,B d spherical coordinates in radians
* (RA,Dec), (long,lat) etc.
*
* Returned:
* V d(3) x,y,z unit vector
*
* The spherical coordinates are longitude (+ve anticlockwise looking
* from the +ve latitude pole) and latitude. The Cartesian coordinates
* are right handed, with the x axis at zero longitude and latitude, and
* the z axis at the +ve latitude pole.
*
* Last revision: 26 December 2004
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION A,B,V(3)
DOUBLE PRECISION COSB
COSB = COS(B)
V(1) = COS(A)*COSB
V(2) = SIN(A)*COSB
V(3) = SIN(B)
END
SUBROUTINE sla_DE2H (HA, DEC, PHI, AZ, EL)
*+
* - - - - -
* D E 2 H
* - - - - -
*
* Equatorial to horizon coordinates: HA,Dec to Az,El
*
* (double precision)
*
* Given:
* HA d hour angle
* DEC d declination
* PHI d observatory latitude
*
* Returned:
* AZ d azimuth
* EL d elevation
*
* Notes:
*
* 1) All the arguments are angles in radians.
*
* 2) Azimuth is returned in the range 0-2pi; north is zero,
* and east is +pi/2. Elevation is returned in the range
* +/-pi/2.
*
* 3) The latitude must be geodetic. In critical applications,
* corrections for polar motion should be applied.
*
* 4) In some applications it will be important to specify the
* correct type of hour angle and declination in order to
* produce the required type of azimuth and elevation. In
* particular, it may be important to distinguish between
* elevation as affected by refraction, which would
* require the "observed" HA,Dec, and the elevation
* in vacuo, which would require the "topocentric" HA,Dec.
* If the effects of diurnal aberration can be neglected, the
* "apparent" HA,Dec may be used instead of the topocentric
* HA,Dec.
*
* 5) No range checking of arguments is carried out.
*
* 6) In applications which involve many such calculations, rather
* than calling the present routine it will be more efficient to
* use inline code, having previously computed fixed terms such
* as sine and cosine of latitude, and (for tracking a star)
* sine and cosine of declination.
*
* P.T.Wallace Starlink 9 July 1994
*
* Copyright (C) 1995 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION HA,DEC,PHI,AZ,EL
DOUBLE PRECISION D2PI
PARAMETER (D2PI=6.283185307179586476925286766559D0)
DOUBLE PRECISION SH,CH,SD,CD,SP,CP,X,Y,Z,R,A
* Useful trig functions
SH=SIN(HA)
CH=COS(HA)
SD=SIN(DEC)
CD=COS(DEC)
SP=SIN(PHI)
CP=COS(PHI)
* Az,El as x,y,z
X=-CH*CD*SP+SD*CP
Y=-SH*CD
Z=CH*CD*CP+SD*SP
* To spherical
R=SQRT(X*X+Y*Y)
IF (R.EQ.0D0) THEN
A=0D0
ELSE
A=ATAN2(Y,X)
END IF
IF (A.LT.0D0) A=A+D2PI
AZ=A
EL=ATAN2(Z,R)
END
SUBROUTINE sla_DEULER (ORDER, PHI, THETA, PSI, RMAT)
*+
* - - - - - - -
* D E U L E R
* - - - - - - -
*
* Form a rotation matrix from the Euler angles - three successive
* rotations about specified Cartesian axes (double precision)
*
* Given:
* ORDER c*(*) specifies about which axes the rotations occur
* PHI d 1st rotation (radians)
* THETA d 2nd rotation ( " )
* PSI d 3rd rotation ( " )
*
* Returned:
* RMAT d(3,3) rotation matrix
*
* A rotation is positive when the reference frame rotates
* anticlockwise as seen looking towards the origin from the
* positive region of the specified axis.
*
* The characters of ORDER define which axes the three successive
* rotations are about. A typical value is 'ZXZ', indicating that
* RMAT is to become the direction cosine matrix corresponding to
* rotations of the reference frame through PHI radians about the
* old Z-axis, followed by THETA radians about the resulting X-axis,
* then PSI radians about the resulting Z-axis.
*
* The axis names can be any of the following, in any order or
* combination: X, Y, Z, uppercase or lowercase, 1, 2, 3. Normal
* axis labelling/numbering conventions apply; the xyz (=123)
* triad is right-handed. Thus, the 'ZXZ' example given above
* could be written 'zxz' or '313' (or even 'ZxZ' or '3xZ'). ORDER
* is terminated by length or by the first unrecognized character.
*
* Fewer than three rotations are acceptable, in which case the later
* angle arguments are ignored. If all rotations are zero, the
* identity matrix is produced.
*
* P.T.Wallace Starlink 23 May 1997
*
* Copyright (C) 1997 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
CHARACTER*(*) ORDER
DOUBLE PRECISION PHI,THETA,PSI,RMAT(3,3)
INTEGER J,I,L,N,K
DOUBLE PRECISION RESULT(3,3),ROTN(3,3),ANGLE,S,C,W,WM(3,3)
CHARACTER AXIS
* Initialize result matrix
DO J=1,3
DO I=1,3
IF (I.NE.J) THEN
RESULT(I,J) = 0D0
ELSE
RESULT(I,J) = 1D0
END IF
END DO
END DO
* Establish length of axis string
L = LEN(ORDER)
* Look at each character of axis string until finished
DO N=1,3
IF (N.LE.L) THEN
* Initialize rotation matrix for the current rotation
DO J=1,3
DO I=1,3
IF (I.NE.J) THEN
ROTN(I,J) = 0D0
ELSE
ROTN(I,J) = 1D0
END IF
END DO
END DO
* Pick up the appropriate Euler angle and take sine & cosine
IF (N.EQ.1) THEN
ANGLE = PHI
ELSE IF (N.EQ.2) THEN
ANGLE = THETA
ELSE
ANGLE = PSI
END IF
S = SIN(ANGLE)
C = COS(ANGLE)
* Identify the axis
AXIS = ORDER(N:N)
IF (AXIS.EQ.'X'.OR.
: AXIS.EQ.'x'.OR.
: AXIS.EQ.'1') THEN
* Matrix for x-rotation
ROTN(2,2) = C
ROTN(2,3) = S
ROTN(3,2) = -S
ROTN(3,3) = C
ELSE IF (AXIS.EQ.'Y'.OR.
: AXIS.EQ.'y'.OR.
: AXIS.EQ.'2') THEN
* Matrix for y-rotation
ROTN(1,1) = C
ROTN(1,3) = -S
ROTN(3,1) = S
ROTN(3,3) = C
ELSE IF (AXIS.EQ.'Z'.OR.
: AXIS.EQ.'z'.OR.
: AXIS.EQ.'3') THEN
* Matrix for z-rotation
ROTN(1,1) = C
ROTN(1,2) = S
ROTN(2,1) = -S
ROTN(2,2) = C
ELSE
* Unrecognized character - fake end of string
L = 0
END IF
* Apply the current rotation (matrix ROTN x matrix RESULT)
DO I=1,3
DO J=1,3
W = 0D0
DO K=1,3
W = W+ROTN(I,K)*RESULT(K,J)
END DO
WM(I,J) = W
END DO
END DO
DO J=1,3
DO I=1,3
RESULT(I,J) = WM(I,J)
END DO
END DO
END IF
END DO
* Copy the result
DO J=1,3
DO I=1,3
RMAT(I,J) = RESULT(I,J)
END DO
END DO
END
SUBROUTINE sla_DMOON (DATE, PV)
*+
* - - - - - -
* D M O O N
* - - - - - -
*
* Approximate geocentric position and velocity of the Moon
* (double precision)
*
* Given:
* DATE D TDB (loosely ET) as a Modified Julian Date
* (JD-2400000.5)
*
* Returned:
* PV D(6) Moon x,y,z,xdot,ydot,zdot, mean equator and
* equinox of date (AU, AU/s)
*
* Notes:
*
* 1 This routine is a full implementation of the algorithm
* published by Meeus (see reference).
*
* 2 Meeus quotes accuracies of 10 arcsec in longitude, 3 arcsec in
* latitude and 0.2 arcsec in HP (equivalent to about 20 km in
* distance). Comparison with JPL DE200 over the interval
* 1960-2025 gives RMS errors of 3.7 arcsec and 83 mas/hour in
* longitude, 2.3 arcsec and 48 mas/hour in latitude, 11 km
* and 81 mm/s in distance. The maximum errors over the same
* interval are 18 arcsec and 0.50 arcsec/hour in longitude,
* 11 arcsec and 0.24 arcsec/hour in latitude, 40 km and 0.29 m/s
* in distance.
*
* 3 The original algorithm is expressed in terms of the obsolete
* timescale Ephemeris Time. Either TDB or TT can be used, but
* not UT without incurring significant errors (30 arcsec at
* the present time) due to the Moon's 0.5 arcsec/sec movement.
*
* 4 The algorithm is based on pre IAU 1976 standards. However,
* the result has been moved onto the new (FK5) equinox, an
* adjustment which is in any case much smaller than the
* intrinsic accuracy of the procedure.
*
* 5 Velocity is obtained by a complete analytical differentiation
* of the Meeus model.
*
* Reference:
* Meeus, l'Astronomie, June 1984, p348.
*
* P.T.Wallace Starlink 22 January 1998
*
* Copyright (C) 1998 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DATE,PV(6)
* Degrees, arcseconds and seconds of time to radians
DOUBLE PRECISION D2R,DAS2R,DS2R
PARAMETER (D2R=0.0174532925199432957692369D0,
: DAS2R=4.848136811095359935899141D-6,
: DS2R=7.272205216643039903848712D-5)
* Seconds per Julian century (86400*36525)
DOUBLE PRECISION CJ
PARAMETER (CJ=3155760000D0)
* Julian epoch of B1950
DOUBLE PRECISION B1950
PARAMETER (B1950=1949.9997904423D0)
* Earth equatorial radius in AU ( = 6378.137 / 149597870 )
DOUBLE PRECISION ERADAU
PARAMETER (ERADAU=4.2635212653763D-5)
DOUBLE PRECISION T,THETA,SINOM,COSOM,DOMCOM,WA,DWA,WB,DWB,WOM,
: DWOM,SINWOM,COSWOM,V,DV,COEFF,EMN,EMPN,DN,FN,EN,
: DEN,DTHETA,FTHETA,EL,DEL,B,DB,BF,DBF,P,DP,SP,R,
: DR,X,Y,Z,XD,YD,ZD,SEL,CEL,SB,CB,RCB,RBD,W,EPJ,
: EQCOR,EPS,SINEPS,COSEPS,ES,EC
INTEGER N,I
*
* Coefficients for fundamental arguments
*
* at J1900: T**0, T**1, T**2, T**3
* at epoch: T**0, T**1
*
* Units are degrees for position and Julian centuries for time
*
* Moon's mean longitude
DOUBLE PRECISION ELP0,ELP1,ELP2,ELP3,ELP,DELP
PARAMETER (ELP0=270.434164D0,
: ELP1=481267.8831D0,
: ELP2=-0.001133D0,
: ELP3=0.0000019D0)
* Sun's mean anomaly
DOUBLE PRECISION EM0,EM1,EM2,EM3,EM,DEM
PARAMETER (EM0=358.475833D0,
: EM1=35999.0498D0,
: EM2=-0.000150D0,
: EM3=-0.0000033D0)
* Moon's mean anomaly
DOUBLE PRECISION EMP0,EMP1,EMP2,EMP3,EMP,DEMP
PARAMETER (EMP0=296.104608D0,
: EMP1=477198.8491D0,
: EMP2=0.009192D0,
: EMP3=0.0000144D0)
* Moon's mean elongation
DOUBLE PRECISION D0,D1,D2,D3,D,DD
PARAMETER (D0=350.737486D0,
: D1=445267.1142D0,
: D2=-0.001436D0,
: D3=0.0000019D0)
* Mean distance of the Moon from its ascending node
DOUBLE PRECISION F0,F1,F2,F3,F,DF
PARAMETER (F0=11.250889D0,
: F1=483202.0251D0,
: F2=-0.003211D0,
: F3=-0.0000003D0)
* Longitude of the Moon's ascending node
DOUBLE PRECISION OM0,OM1,OM2,OM3,OM,DOM
PARAMETER (OM0=259.183275D0,
: OM1=-1934.1420D0,
: OM2=0.002078D0,
: OM3=0.0000022D0)
* Coefficients for (dimensionless) E factor
DOUBLE PRECISION E1,E2,E,DE,ESQ,DESQ
PARAMETER (E1=-0.002495D0,E2=-0.00000752D0)
* Coefficients for periodic variations etc
DOUBLE PRECISION PAC,PA0,PA1
PARAMETER (PAC=0.000233D0,PA0=51.2D0,PA1=20.2D0)
DOUBLE PRECISION PBC
PARAMETER (PBC=-0.001778D0)
DOUBLE PRECISION PCC
PARAMETER (PCC=0.000817D0)
DOUBLE PRECISION PDC
PARAMETER (PDC=0.002011D0)
DOUBLE PRECISION PEC,PE0,PE1,PE2
PARAMETER (PEC=0.003964D0,
: PE0=346.560D0,PE1=132.870D0,PE2=-0.0091731D0)
DOUBLE PRECISION PFC
PARAMETER (PFC=0.001964D0)
DOUBLE PRECISION PGC
PARAMETER (PGC=0.002541D0)
DOUBLE PRECISION PHC
PARAMETER (PHC=0.001964D0)
DOUBLE PRECISION PIC
PARAMETER (PIC=-0.024691D0)
DOUBLE PRECISION PJC,PJ0,PJ1
PARAMETER (PJC=-0.004328D0,PJ0=275.05D0,PJ1=-2.30D0)
DOUBLE PRECISION CW1
PARAMETER (CW1=0.0004664D0)
DOUBLE PRECISION CW2
PARAMETER (CW2=0.0000754D0)
*
* Coefficients for Moon position
*
* Tx(N) = coefficient of L, B or P term (deg)
* ITx(N,1-5) = coefficients of M, M', D, F, E**n in argument
*
INTEGER NL,NB,NP
PARAMETER (NL=50,NB=45,NP=31)
DOUBLE PRECISION TL(NL),TB(NB),TP(NP)
INTEGER ITL(5,NL),ITB(5,NB),ITP(5,NP)
*
* Longitude
* M M' D F n
DATA TL( 1)/ +6.288750D0 /,
: (ITL(I, 1),I=1,5)/ +0, +1, +0, +0, 0 /
DATA TL( 2)/ +1.274018D0 /,
: (ITL(I, 2),I=1,5)/ +0, -1, +2, +0, 0 /
DATA TL( 3)/ +0.658309D0 /,
: (ITL(I, 3),I=1,5)/ +0, +0, +2, +0, 0 /
DATA TL( 4)/ +0.213616D0 /,
: (ITL(I, 4),I=1,5)/ +0, +2, +0, +0, 0 /
DATA TL( 5)/ -0.185596D0 /,
: (ITL(I, 5),I=1,5)/ +1, +0, +0, +0, 1 /
DATA TL( 6)/ -0.114336D0 /,
: (ITL(I, 6),I=1,5)/ +0, +0, +0, +2, 0 /
DATA TL( 7)/ +0.058793D0 /,
: (ITL(I, 7),I=1,5)/ +0, -2, +2, +0, 0 /
DATA TL( 8)/ +0.057212D0 /,
: (ITL(I, 8),I=1,5)/ -1, -1, +2, +0, 1 /
DATA TL( 9)/ +0.053320D0 /,
: (ITL(I, 9),I=1,5)/ +0, +1, +2, +0, 0 /
DATA TL(10)/ +0.045874D0 /,
: (ITL(I,10),I=1,5)/ -1, +0, +2, +0, 1 /
DATA TL(11)/ +0.041024D0 /,
: (ITL(I,11),I=1,5)/ -1, +1, +0, +0, 1 /
DATA TL(12)/ -0.034718D0 /,
: (ITL(I,12),I=1,5)/ +0, +0, +1, +0, 0 /
DATA TL(13)/ -0.030465D0 /,
: (ITL(I,13),I=1,5)/ +1, +1, +0, +0, 1 /
DATA TL(14)/ +0.015326D0 /,
: (ITL(I,14),I=1,5)/ +0, +0, +2, -2, 0 /
DATA TL(15)/ -0.012528D0 /,
: (ITL(I,15),I=1,5)/ +0, +1, +0, +2, 0 /
DATA TL(16)/ -0.010980D0 /,
: (ITL(I,16),I=1,5)/ +0, -1, +0, +2, 0 /
DATA TL(17)/ +0.010674D0 /,
: (ITL(I,17),I=1,5)/ +0, -1, +4, +0, 0 /
DATA TL(18)/ +0.010034D0 /,
: (ITL(I,18),I=1,5)/ +0, +3, +0, +0, 0 /
DATA TL(19)/ +0.008548D0 /,
: (ITL(I,19),I=1,5)/ +0, -2, +4, +0, 0 /
DATA TL(20)/ -0.007910D0 /,
: (ITL(I,20),I=1,5)/ +1, -1, +2, +0, 1 /
DATA TL(21)/ -0.006783D0 /,
: (ITL(I,21),I=1,5)/ +1, +0, +2, +0, 1 /
DATA TL(22)/ +0.005162D0 /,
: (ITL(I,22),I=1,5)/ +0, +1, -1, +0, 0 /
DATA TL(23)/ +0.005000D0 /,
: (ITL(I,23),I=1,5)/ +1, +0, +1, +0, 1 /
DATA TL(24)/ +0.004049D0 /,
: (ITL(I,24),I=1,5)/ -1, +1, +2, +0, 1 /
DATA TL(25)/ +0.003996D0 /,
: (ITL(I,25),I=1,5)/ +0, +2, +2, +0, 0 /
DATA TL(26)/ +0.003862D0 /,
: (ITL(I,26),I=1,5)/ +0, +0, +4, +0, 0 /
DATA TL(27)/ +0.003665D0 /,
: (ITL(I,27),I=1,5)/ +0, -3, +2, +0, 0 /
DATA TL(28)/ +0.002695D0 /,
: (ITL(I,28),I=1,5)/ -1, +2, +0, +0, 1 /
DATA TL(29)/ +0.002602D0 /,
: (ITL(I,29),I=1,5)/ +0, +1, -2, -2, 0 /
DATA TL(30)/ +0.002396D0 /,
: (ITL(I,30),I=1,5)/ -1, -2, +2, +0, 1 /
DATA TL(31)/ -0.002349D0 /,
: (ITL(I,31),I=1,5)/ +0, +1, +1, +0, 0 /
DATA TL(32)/ +0.002249D0 /,
: (ITL(I,32),I=1,5)/ -2, +0, +2, +0, 2 /
DATA TL(33)/ -0.002125D0 /,
: (ITL(I,33),I=1,5)/ +1, +2, +0, +0, 1 /
DATA TL(34)/ -0.002079D0 /,
: (ITL(I,34),I=1,5)/ +2, +0, +0, +0, 2 /
DATA TL(35)/ +0.002059D0 /,
: (ITL(I,35),I=1,5)/ -2, -1, +2, +0, 2 /
DATA TL(36)/ -0.001773D0 /,
: (ITL(I,36),I=1,5)/ +0, +1, +2, -2, 0 /
DATA TL(37)/ -0.001595D0 /,
: (ITL(I,37),I=1,5)/ +0, +0, +2, +2, 0 /
DATA TL(38)/ +0.001220D0 /,
: (ITL(I,38),I=1,5)/ -1, -1, +4, +0, 1 /
DATA TL(39)/ -0.001110D0 /,
: (ITL(I,39),I=1,5)/ +0, +2, +0, +2, 0 /
DATA TL(40)/ +0.000892D0 /,
: (ITL(I,40),I=1,5)/ +0, +1, -3, +0, 0 /
DATA TL(41)/ -0.000811D0 /,
: (ITL(I,41),I=1,5)/ +1, +1, +2, +0, 1 /
DATA TL(42)/ +0.000761D0 /,
: (ITL(I,42),I=1,5)/ -1, -2, +4, +0, 1 /
DATA TL(43)/ +0.000717D0 /,
: (ITL(I,43),I=1,5)/ -2, +1, +0, +0, 2 /
DATA TL(44)/ +0.000704D0 /,
: (ITL(I,44),I=1,5)/ -2, +1, -2, +0, 2 /
DATA TL(45)/ +0.000693D0 /,
: (ITL(I,45),I=1,5)/ +1, -2, +2, +0, 1 /
DATA TL(46)/ +0.000598D0 /,
: (ITL(I,46),I=1,5)/ -1, +0, +2, -2, 1 /
DATA TL(47)/ +0.000550D0 /,
: (ITL(I,47),I=1,5)/ +0, +1, +4, +0, 0 /
DATA TL(48)/ +0.000538D0 /,
: (ITL(I,48),I=1,5)/ +0, +4, +0, +0, 0 /
DATA TL(49)/ +0.000521D0 /,
: (ITL(I,49),I=1,5)/ -1, +0, +4, +0, 1 /
DATA TL(50)/ +0.000486D0 /,
: (ITL(I,50),I=1,5)/ +0, +2, -1, +0, 0 /
*
* Latitude
* M M' D F n
DATA TB( 1)/ +5.128189D0 /,
: (ITB(I, 1),I=1,5)/ +0, +0, +0, +1, 0 /
DATA TB( 2)/ +0.280606D0 /,
: (ITB(I, 2),I=1,5)/ +0, +1, +0, +1, 0 /
DATA TB( 3)/ +0.277693D0 /,
: (ITB(I, 3),I=1,5)/ +0, +1, +0, -1, 0 /
DATA TB( 4)/ +0.173238D0 /,
: (ITB(I, 4),I=1,5)/ +0, +0, +2, -1, 0 /
DATA TB( 5)/ +0.055413D0 /,
: (ITB(I, 5),I=1,5)/ +0, -1, +2, +1, 0 /
DATA TB( 6)/ +0.046272D0 /,
: (ITB(I, 6),I=1,5)/ +0, -1, +2, -1, 0 /
DATA TB( 7)/ +0.032573D0 /,
: (ITB(I, 7),I=1,5)/ +0, +0, +2, +1, 0 /
DATA TB( 8)/ +0.017198D0 /,
: (ITB(I, 8),I=1,5)/ +0, +2, +0, +1, 0 /
DATA TB( 9)/ +0.009267D0 /,
: (ITB(I, 9),I=1,5)/ +0, +1, +2, -1, 0 /
DATA TB(10)/ +0.008823D0 /,
: (ITB(I,10),I=1,5)/ +0, +2, +0, -1, 0 /
DATA TB(11)/ +0.008247D0 /,
: (ITB(I,11),I=1,5)/ -1, +0, +2, -1, 1 /
DATA TB(12)/ +0.004323D0 /,
: (ITB(I,12),I=1,5)/ +0, -2, +2, -1, 0 /
DATA TB(13)/ +0.004200D0 /,
: (ITB(I,13),I=1,5)/ +0, +1, +2, +1, 0 /
DATA TB(14)/ +0.003372D0 /,
: (ITB(I,14),I=1,5)/ -1, +0, -2, +1, 1 /
DATA TB(15)/ +0.002472D0 /,
: (ITB(I,15),I=1,5)/ -1, -1, +2, +1, 1 /
DATA TB(16)/ +0.002222D0 /,
: (ITB(I,16),I=1,5)/ -1, +0, +2, +1, 1 /
DATA TB(17)/ +0.002072D0 /,
: (ITB(I,17),I=1,5)/ -1, -1, +2, -1, 1 /
DATA TB(18)/ +0.001877D0 /,
: (ITB(I,18),I=1,5)/ -1, +1, +0, +1, 1 /
DATA TB(19)/ +0.001828D0 /,
: (ITB(I,19),I=1,5)/ +0, -1, +4, -1, 0 /
DATA TB(20)/ -0.001803D0 /,
: (ITB(I,20),I=1,5)/ +1, +0, +0, +1, 1 /
DATA TB(21)/ -0.001750D0 /,
: (ITB(I,21),I=1,5)/ +0, +0, +0, +3, 0 /
DATA TB(22)/ +0.001570D0 /,
: (ITB(I,22),I=1,5)/ -1, +1, +0, -1, 1 /
DATA TB(23)/ -0.001487D0 /,
: (ITB(I,23),I=1,5)/ +0, +0, +1, +1, 0 /
DATA TB(24)/ -0.001481D0 /,
: (ITB(I,24),I=1,5)/ +1, +1, +0, +1, 1 /
DATA TB(25)/ +0.001417D0 /,
: (ITB(I,25),I=1,5)/ -1, -1, +0, +1, 1 /
DATA TB(26)/ +0.001350D0 /,
: (ITB(I,26),I=1,5)/ -1, +0, +0, +1, 1 /
DATA TB(27)/ +0.001330D0 /,
: (ITB(I,27),I=1,5)/ +0, +0, -1, +1, 0 /
DATA TB(28)/ +0.001106D0 /,
: (ITB(I,28),I=1,5)/ +0, +3, +0, +1, 0 /
DATA TB(29)/ +0.001020D0 /,
: (ITB(I,29),I=1,5)/ +0, +0, +4, -1, 0 /
DATA TB(30)/ +0.000833D0 /,
: (ITB(I,30),I=1,5)/ +0, -1, +4, +1, 0 /
DATA TB(31)/ +0.000781D0 /,
: (ITB(I,31),I=1,5)/ +0, +1, +0, -3, 0 /
DATA TB(32)/ +0.000670D0 /,
: (ITB(I,32),I=1,5)/ +0, -2, +4, +1, 0 /
DATA TB(33)/ +0.000606D0 /,
: (ITB(I,33),I=1,5)/ +0, +0, +2, -3, 0 /
DATA TB(34)/ +0.000597D0 /,
: (ITB(I,34),I=1,5)/ +0, +2, +2, -1, 0 /
DATA TB(35)/ +0.000492D0 /,
: (ITB(I,35),I=1,5)/ -1, +1, +2, -1, 1 /
DATA TB(36)/ +0.000450D0 /,
: (ITB(I,36),I=1,5)/ +0, +2, -2, -1, 0 /
DATA TB(37)/ +0.000439D0 /,
: (ITB(I,37),I=1,5)/ +0, +3, +0, -1, 0 /
DATA TB(38)/ +0.000423D0 /,
: (ITB(I,38),I=1,5)/ +0, +2, +2, +1, 0 /
DATA TB(39)/ +0.000422D0 /,
: (ITB(I,39),I=1,5)/ +0, -3, +2, -1, 0 /
DATA TB(40)/ -0.000367D0 /,
: (ITB(I,40),I=1,5)/ +1, -1, +2, +1, 1 /
DATA TB(41)/ -0.000353D0 /,
: (ITB(I,41),I=1,5)/ +1, +0, +2, +1, 1 /
DATA TB(42)/ +0.000331D0 /,
: (ITB(I,42),I=1,5)/ +0, +0, +4, +1, 0 /
DATA TB(43)/ +0.000317D0 /,
: (ITB(I,43),I=1,5)/ -1, +1, +2, +1, 1 /
DATA TB(44)/ +0.000306D0 /,
: (ITB(I,44),I=1,5)/ -2, +0, +2, -1, 2 /
DATA TB(45)/ -0.000283D0 /,
: (ITB(I,45),I=1,5)/ +0, +1, +0, +3, 0 /
*
* Parallax
* M M' D F n
DATA TP( 1)/ +0.950724D0 /,
: (ITP(I, 1),I=1,5)/ +0, +0, +0, +0, 0 /
DATA TP( 2)/ +0.051818D0 /,
: (ITP(I, 2),I=1,5)/ +0, +1, +0, +0, 0 /
DATA TP( 3)/ +0.009531D0 /,
: (ITP(I, 3),I=1,5)/ +0, -1, +2, +0, 0 /
DATA TP( 4)/ +0.007843D0 /,
: (ITP(I, 4),I=1,5)/ +0, +0, +2, +0, 0 /
DATA TP( 5)/ +0.002824D0 /,
: (ITP(I, 5),I=1,5)/ +0, +2, +0, +0, 0 /
DATA TP( 6)/ +0.000857D0 /,
: (ITP(I, 6),I=1,5)/ +0, +1, +2, +0, 0 /
DATA TP( 7)/ +0.000533D0 /,
: (ITP(I, 7),I=1,5)/ -1, +0, +2, +0, 1 /
DATA TP( 8)/ +0.000401D0 /,
: (ITP(I, 8),I=1,5)/ -1, -1, +2, +0, 1 /
DATA TP( 9)/ +0.000320D0 /,
: (ITP(I, 9),I=1,5)/ -1, +1, +0, +0, 1 /
DATA TP(10)/ -0.000271D0 /,
: (ITP(I,10),I=1,5)/ +0, +0, +1, +0, 0 /
DATA TP(11)/ -0.000264D0 /,
: (ITP(I,11),I=1,5)/ +1, +1, +0, +0, 1 /
DATA TP(12)/ -0.000198D0 /,
: (ITP(I,12),I=1,5)/ +0, -1, +0, +2, 0 /
DATA TP(13)/ +0.000173D0 /,
: (ITP(I,13),I=1,5)/ +0, +3, +0, +0, 0 /
DATA TP(14)/ +0.000167D0 /,
: (ITP(I,14),I=1,5)/ +0, -1, +4, +0, 0 /
DATA TP(15)/ -0.000111D0 /,
: (ITP(I,15),I=1,5)/ +1, +0, +0, +0, 1 /
DATA TP(16)/ +0.000103D0 /,
: (ITP(I,16),I=1,5)/ +0, -2, +4, +0, 0 /
DATA TP(17)/ -0.000084D0 /,
: (ITP(I,17),I=1,5)/ +0, +2, -2, +0, 0 /
DATA TP(18)/ -0.000083D0 /,
: (ITP(I,18),I=1,5)/ +1, +0, +2, +0, 1 /
DATA TP(19)/ +0.000079D0 /,
: (ITP(I,19),I=1,5)/ +0, +2, +2, +0, 0 /
DATA TP(20)/ +0.000072D0 /,
: (ITP(I,20),I=1,5)/ +0, +0, +4, +0, 0 /
DATA TP(21)/ +0.000064D0 /,
: (ITP(I,21),I=1,5)/ -1, +1, +2, +0, 1 /
DATA TP(22)/ -0.000063D0 /,
: (ITP(I,22),I=1,5)/ +1, -1, +2, +0, 1 /
DATA TP(23)/ +0.000041D0 /,
: (ITP(I,23),I=1,5)/ +1, +0, +1, +0, 1 /
DATA TP(24)/ +0.000035D0 /,
: (ITP(I,24),I=1,5)/ -1, +2, +0, +0, 1 /
DATA TP(25)/ -0.000033D0 /,
: (ITP(I,25),I=1,5)/ +0, +3, -2, +0, 0 /
DATA TP(26)/ -0.000030D0 /,
: (ITP(I,26),I=1,5)/ +0, +1, +1, +0, 0 /
DATA TP(27)/ -0.000029D0 /,
: (ITP(I,27),I=1,5)/ +0, +0, -2, +2, 0 /
DATA TP(28)/ -0.000029D0 /,
: (ITP(I,28),I=1,5)/ +1, +2, +0, +0, 1 /
DATA TP(29)/ +0.000026D0 /,
: (ITP(I,29),I=1,5)/ -2, +0, +2, +0, 2 /
DATA TP(30)/ -0.000023D0 /,
: (ITP(I,30),I=1,5)/ +0, +1, -2, +2, 0 /
DATA TP(31)/ +0.000019D0 /,
: (ITP(I,31),I=1,5)/ -1, -1, +4, +0, 1 /
* Centuries since J1900
T=(DATE-15019.5D0)/36525D0
*
* Fundamental arguments (radians) and derivatives (radians per
* Julian century) for the current epoch
*
* Moon's mean longitude
ELP=D2R*MOD(ELP0+(ELP1+(ELP2+ELP3*T)*T)*T,360D0)
DELP=D2R*(ELP1+(2D0*ELP2+3D0*ELP3*T)*T)
* Sun's mean anomaly
EM=D2R*MOD(EM0+(EM1+(EM2+EM3*T)*T)*T,360D0)
DEM=D2R*(EM1+(2D0*EM2+3D0*EM3*T)*T)
* Moon's mean anomaly
EMP=D2R*MOD(EMP0+(EMP1+(EMP2+EMP3*T)*T)*T,360D0)
DEMP=D2R*(EMP1+(2D0*EMP2+3D0*EMP3*T)*T)
* Moon's mean elongation
D=D2R*MOD(D0+(D1+(D2+D3*T)*T)*T,360D0)
DD=D2R*(D1+(2D0*D2+3D0*D3*T)*T)
* Mean distance of the Moon from its ascending node
F=D2R*MOD(F0+(F1+(F2+F3*T)*T)*T,360D0)
DF=D2R*(F1+(2D0*F2+3D0*F3*T)*T)
* Longitude of the Moon's ascending node
OM=D2R*MOD(OM0+(OM1+(OM2+OM3*T)*T)*T,360D0)
DOM=D2R*(OM1+(2D0*OM2+3D0*OM3*T)*T)
SINOM=SIN(OM)
COSOM=COS(OM)
DOMCOM=DOM*COSOM
* Add the periodic variations
THETA=D2R*(PA0+PA1*T)
WA=SIN(THETA)
DWA=D2R*PA1*COS(THETA)
THETA=D2R*(PE0+(PE1+PE2*T)*T)
WB=PEC*SIN(THETA)
DWB=D2R*PEC*(PE1+2D0*PE2*T)*COS(THETA)
ELP=ELP+D2R*(PAC*WA+WB+PFC*SINOM)
DELP=DELP+D2R*(PAC*DWA+DWB+PFC*DOMCOM)
EM=EM+D2R*PBC*WA
DEM=DEM+D2R*PBC*DWA
EMP=EMP+D2R*(PCC*WA+WB+PGC*SINOM)
DEMP=DEMP+D2R*(PCC*DWA+DWB+PGC*DOMCOM)
D=D+D2R*(PDC*WA+WB+PHC*SINOM)
DD=DD+D2R*(PDC*DWA+DWB+PHC*DOMCOM)
WOM=OM+D2R*(PJ0+PJ1*T)
DWOM=DOM+D2R*PJ1
SINWOM=SIN(WOM)
COSWOM=COS(WOM)
F=F+D2R*(WB+PIC*SINOM+PJC*SINWOM)
DF=DF+D2R*(DWB+PIC*DOMCOM+PJC*DWOM*COSWOM)
* E-factor, and square
E=1D0+(E1+E2*T)*T
DE=E1+2D0*E2*T
ESQ=E*E
DESQ=2D0*E*DE
*
* Series expansions
*
* Longitude
V=0D0
DV=0D0
DO N=NL,1,-1
COEFF=TL(N)
EMN=DBLE(ITL(1,N))
EMPN=DBLE(ITL(2,N))
DN=DBLE(ITL(3,N))
FN=DBLE(ITL(4,N))
I=ITL(5,N)
IF (I.EQ.0) THEN
EN=1D0
DEN=0D0
ELSE IF (I.EQ.1) THEN
EN=E
DEN=DE
ELSE
EN=ESQ
DEN=DESQ
END IF
THETA=EMN*EM+EMPN*EMP+DN*D+FN*F
DTHETA=EMN*DEM+EMPN*DEMP+DN*DD+FN*DF
FTHETA=SIN(THETA)
V=V+COEFF*FTHETA*EN
DV=DV+COEFF*(COS(THETA)*DTHETA*EN+FTHETA*DEN)
END DO
EL=ELP+D2R*V
DEL=(DELP+D2R*DV)/CJ
* Latitude
V=0D0
DV=0D0
DO N=NB,1,-1
COEFF=TB(N)
EMN=DBLE(ITB(1,N))
EMPN=DBLE(ITB(2,N))
DN=DBLE(ITB(3,N))
FN=DBLE(ITB(4,N))
I=ITB(5,N)
IF (I.EQ.0) THEN
EN=1D0
DEN=0D0
ELSE IF (I.EQ.1) THEN
EN=E
DEN=DE
ELSE
EN=ESQ
DEN=DESQ
END IF
THETA=EMN*EM+EMPN*EMP+DN*D+FN*F
DTHETA=EMN*DEM+EMPN*DEMP+DN*DD+FN*DF
FTHETA=SIN(THETA)
V=V+COEFF*FTHETA*EN
DV=DV+COEFF*(COS(THETA)*DTHETA*EN+FTHETA*DEN)
END DO
BF=1D0-CW1*COSOM-CW2*COSWOM
DBF=CW1*DOM*SINOM+CW2*DWOM*SINWOM
B=D2R*V*BF
DB=D2R*(DV*BF+V*DBF)/CJ
* Parallax
V=0D0
DV=0D0
DO N=NP,1,-1
COEFF=TP(N)
EMN=DBLE(ITP(1,N))
EMPN=DBLE(ITP(2,N))
DN=DBLE(ITP(3,N))
FN=DBLE(ITP(4,N))
I=ITP(5,N)
IF (I.EQ.0) THEN
EN=1D0
DEN=0D0
ELSE IF (I.EQ.1) THEN
EN=E
DEN=DE
ELSE
EN=ESQ
DEN=DESQ
END IF
THETA=EMN*EM+EMPN*EMP+DN*D+FN*F
DTHETA=EMN*DEM+EMPN*DEMP+DN*DD+FN*DF
FTHETA=COS(THETA)
V=V+COEFF*FTHETA*EN
DV=DV+COEFF*(-SIN(THETA)*DTHETA*EN+FTHETA*DEN)
END DO
P=D2R*V
DP=D2R*DV/CJ
*
* Transformation into final form
*
* Parallax to distance (AU, AU/sec)
SP=SIN(P)
R=ERADAU/SP
DR=-R*DP*COS(P)/SP
* Longitude, latitude to x,y,z (AU)
SEL=SIN(EL)
CEL=COS(EL)
SB=SIN(B)
CB=COS(B)
RCB=R*CB
RBD=R*DB
W=RBD*SB-CB*DR
X=RCB*CEL
Y=RCB*SEL
Z=R*SB
XD=-Y*DEL-W*CEL
YD=X*DEL-W*SEL
ZD=RBD*CB+SB*DR
* Julian centuries since J2000
T=(DATE-51544.5D0)/36525D0
* Fricke equinox correction
EPJ=2000D0+T*100D0
EQCOR=DS2R*(0.035D0+0.00085D0*(EPJ-B1950))
* Mean obliquity (IAU 1976)
EPS=DAS2R*(84381.448D0+(-46.8150D0+(-0.00059D0+0.001813D0*T)*T)*T)
* To the equatorial system, mean of date, FK5 system
SINEPS=SIN(EPS)
COSEPS=COS(EPS)
ES=EQCOR*SINEPS
EC=EQCOR*COSEPS
PV(1)=X-EC*Y+ES*Z
PV(2)=EQCOR*X+Y*COSEPS-Z*SINEPS
PV(3)=Y*SINEPS+Z*COSEPS
PV(4)=XD-EC*YD+ES*ZD
PV(5)=EQCOR*XD+YD*COSEPS-ZD*SINEPS
PV(6)=YD*SINEPS+ZD*COSEPS
END
SUBROUTINE sla_DMXV (DM, VA, VB)
*+
* - - - - -
* D M X V
* - - - - -
*
* Performs the 3-D forward unitary transformation:
*
* vector VB = matrix DM * vector VA
*
* (double precision)
*
* Given:
* DM dp(3,3) matrix
* VA dp(3) vector
*
* Returned:
* VB dp(3) result vector
*
* To comply with the ANSI Fortran 77 standard, VA and VB must be
* different arrays. However, the routine is coded so as to work
* properly on many platforms even if this rule is violated.
*
* Last revision: 26 December 2004
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DM(3,3),VA(3),VB(3)
INTEGER I,J
DOUBLE PRECISION W,VW(3)
* Matrix DM * vector VA -> vector VW
DO J=1,3
W=0D0
DO I=1,3
W=W+DM(J,I)*VA(I)
END DO
VW(J)=W
END DO
* Vector VW -> vector VB
DO J=1,3
VB(J)=VW(J)
END DO
END
DOUBLE PRECISION FUNCTION sla_DRANGE (ANGLE)
*+
* - - - - - - -
* D R A N G E
* - - - - - - -
*
* Normalize angle into range +/- pi (double precision)
*
* Given:
* ANGLE dp the angle in radians
*
* The result (double precision) is ANGLE expressed in the range +/- pi.
*
* P.T.Wallace Starlink 23 November 1995
*
* Copyright (C) 1995 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION ANGLE
DOUBLE PRECISION DPI,D2PI
PARAMETER (DPI=3.141592653589793238462643D0)
PARAMETER (D2PI=6.283185307179586476925287D0)
sla_DRANGE=MOD(ANGLE,D2PI)
IF (ABS(sla_DRANGE).GE.DPI)
: sla_DRANGE=sla_DRANGE-SIGN(D2PI,ANGLE)
END
DOUBLE PRECISION FUNCTION sla_DRANRM (ANGLE)
*+
* - - - - - - -
* D R A N R M
* - - - - - - -
*
* Normalize angle into range 0-2 pi (double precision)
*
* Given:
* ANGLE dp the angle in radians
*
* The result is ANGLE expressed in the range 0-2 pi.
*
* Last revision: 22 July 2004
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION ANGLE
DOUBLE PRECISION D2PI
PARAMETER (D2PI=6.283185307179586476925286766559D0)
sla_DRANRM = MOD(ANGLE,D2PI)
IF (sla_DRANRM.LT.0D0) sla_DRANRM = sla_DRANRM+D2PI
END
DOUBLE PRECISION FUNCTION sla_DTT (UTC)
*+
* - - - -
* D T T
* - - - -
*
* Increment to be applied to Coordinated Universal Time UTC to give
* Terrestrial Time TT (formerly Ephemeris Time ET)
*
* (double precision)
*
* Given:
* UTC d UTC date as a modified JD (JD-2400000.5)
*
* Result: TT-UTC in seconds
*
* Notes:
*
* 1 The UTC is specified to be a date rather than a time to indicate
* that care needs to be taken not to specify an instant which lies
* within a leap second. Though in most cases UTC can include the
* fractional part, correct behaviour on the day of a leap second
* can only be guaranteed up to the end of the second 23:59:59.
*
* 2 Pre 1972 January 1 a fixed value of 10 + ET-TAI is returned.
*
* 3 See also the routine sla_DT, which roughly estimates ET-UT for
* historical epochs.
*
* Called: sla_DAT
*
* P.T.Wallace Starlink 6 December 1994
*
* Copyright (C) 1995 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION UTC
DOUBLE PRECISION sla_DAT
sla_DTT=32.184D0+sla_DAT(UTC)
END
SUBROUTINE sla_ECMAT (DATE, RMAT)
*+
* - - - - - -
* E C M A T
* - - - - - -
*
* Form the equatorial to ecliptic rotation matrix - IAU 1980 theory
* (double precision)
*
* Given:
* DATE dp TDB (loosely ET) as Modified Julian Date
* (JD-2400000.5)
* Returned:
* RMAT dp(3,3) matrix
*
* Reference:
* Murray,C.A., Vectorial Astrometry, section 4.3.
*
* Note:
* The matrix is in the sense V(ecl) = RMAT * V(equ); the
* equator, equinox and ecliptic are mean of date.
*
* Called: sla_DEULER
*
* P.T.Wallace Starlink 23 August 1996
*
* Copyright (C) 1996 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DATE,RMAT(3,3)
* Arc seconds to radians
DOUBLE PRECISION AS2R
PARAMETER (AS2R=0.484813681109535994D-5)
DOUBLE PRECISION T,EPS0
* Interval between basic epoch J2000.0 and current epoch (JC)
T = (DATE-51544.5D0)/36525D0
* Mean obliquity
EPS0 = AS2R*
: (84381.448D0+(-46.8150D0+(-0.00059D0+0.001813D0*T)*T)*T)
* Matrix
CALL sla_DEULER('X',EPS0,0D0,0D0,RMAT)
END
DOUBLE PRECISION FUNCTION sla_EPJ (DATE)
*+
* - - - -
* E P J
* - - - -
*
* Conversion of Modified Julian Date to Julian Epoch (double precision)
*
* Given:
* DATE dp Modified Julian Date (JD - 2400000.5)
*
* The result is the Julian Epoch.
*
* Reference:
* Lieske,J.H., 1979. Astron.Astrophys.,73,282.
*
* P.T.Wallace Starlink February 1984
*
* Copyright (C) 1995 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DATE
sla_EPJ = 2000D0 + (DATE-51544.5D0)/365.25D0
END
SUBROUTINE sla_EQECL (DR, DD, DATE, DL, DB)
*+
* - - - - - -
* E Q E C L
* - - - - - -
*
* Transformation from J2000.0 equatorial coordinates to
* ecliptic coordinates (double precision)
*
* Given:
* DR,DD dp J2000.0 mean RA,Dec (radians)
* DATE dp TDB (loosely ET) as Modified Julian Date
* (JD-2400000.5)
* Returned:
* DL,DB dp ecliptic longitude and latitude
* (mean of date, IAU 1980 theory, radians)
*
* Called:
* sla_DCS2C, sla_PREC, sla_EPJ, sla_DMXV, sla_ECMAT, sla_DCC2S,
* sla_DRANRM, sla_DRANGE
*
* P.T.Wallace Starlink March 1986
*
* Copyright (C) 1995 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DR,DD,DATE,DL,DB
DOUBLE PRECISION sla_EPJ,sla_DRANRM,sla_DRANGE
DOUBLE PRECISION RMAT(3,3),V1(3),V2(3)
* Spherical to Cartesian
CALL sla_DCS2C(DR,DD,V1)
* Mean J2000 to mean of date
CALL sla_PREC(2000D0,sla_EPJ(DATE),RMAT)
CALL sla_DMXV(RMAT,V1,V2)
* Equatorial to ecliptic
CALL sla_ECMAT(DATE,RMAT)
CALL sla_DMXV(RMAT,V2,V1)
* Cartesian to spherical
CALL sla_DCC2S(V1,DL,DB)
* Express in conventional ranges
DL=sla_DRANRM(DL)
DB=sla_DRANGE(DB)
END
DOUBLE PRECISION FUNCTION sla_EQEQX (DATE)
*+
* - - - - - -
* E Q E Q X
* - - - - - -
*
* Equation of the equinoxes (IAU 1994, double precision)
*
* Given:
* DATE dp TDB (loosely ET) as Modified Julian Date
* (JD-2400000.5)
*
* The result is the equation of the equinoxes (double precision)
* in radians:
*
* Greenwich apparent ST = GMST + sla_EQEQX
*
* References: IAU Resolution C7, Recommendation 3 (1994)
* Capitaine, N. & Gontier, A.-M., Astron. Astrophys.,
* 275, 645-650 (1993)
*
* Called: sla_NUTC
*
* Patrick Wallace Starlink 23 August 1996
*
* Copyright (C) 1996 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DATE
* Turns to arc seconds and arc seconds to radians
DOUBLE PRECISION T2AS,AS2R
PARAMETER (T2AS=1296000D0,
: AS2R=0.484813681109535994D-5)
DOUBLE PRECISION T,OM,DPSI,DEPS,EPS0
* Interval between basic epoch J2000.0 and current epoch (JC)
T=(DATE-51544.5D0)/36525D0
* Longitude of the mean ascending node of the lunar orbit on the
* ecliptic, measured from the mean equinox of date
OM=AS2R*(450160.280D0+(-5D0*T2AS-482890.539D0
: +(7.455D0+0.008D0*T)*T)*T)
* Nutation
CALL sla_NUTC(DATE,DPSI,DEPS,EPS0)
* Equation of the equinoxes
sla_EQEQX=DPSI*COS(EPS0)+AS2R*(0.00264D0*SIN(OM)+
: 0.000063D0*SIN(OM+OM))
END
SUBROUTINE sla_GEOC (P, H, R, Z)
*+
* - - - - -
* G E O C
* - - - - -
*
* Convert geodetic position to geocentric (double precision)
*
* Given:
* P dp latitude (geodetic, radians)
* H dp height above reference spheroid (geodetic, metres)
*
* Returned:
* R dp distance from Earth axis (AU)
* Z dp distance from plane of Earth equator (AU)
*
* Notes:
*
* 1 Geocentric latitude can be obtained by evaluating ATAN2(Z,R).
*
* 2 IAU 1976 constants are used.
*
* Reference:
*
* Green,R.M., Spherical Astronomy, CUP 1985, p98.
*
* Last revision: 22 July 2004
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION P,H,R,Z
* Earth equatorial radius (metres)
DOUBLE PRECISION A0
PARAMETER (A0=6378140D0)
* Reference spheroid flattening factor and useful function
DOUBLE PRECISION F,B
PARAMETER (F=1D0/298.257D0,B=(1D0-F)**2)
* Astronomical unit in metres
DOUBLE PRECISION AU
PARAMETER (AU=1.49597870D11)
DOUBLE PRECISION SP,CP,C,S
* Geodetic to geocentric conversion
SP = SIN(P)
CP = COS(P)
C = 1D0/SQRT(CP*CP+B*SP*SP)
S = B*C
R = (A0*C+H)*CP/AU
Z = (A0*S+H)*SP/AU
END
DOUBLE PRECISION FUNCTION sla_GMST (UT1)
*+
* - - - - -
* G M S T
* - - - - -
*
* Conversion from universal time to sidereal time (double precision)
*
* Given:
* UT1 dp universal time (strictly UT1) expressed as
* modified Julian Date (JD-2400000.5)
*
* The result is the Greenwich mean sidereal time (double
* precision, radians).
*
* The IAU 1982 expression (see page S15 of 1984 Astronomical Almanac)
* is used, but rearranged to reduce rounding errors. This expression
* is always described as giving the GMST at 0 hours UT. In fact, it
* gives the difference between the GMST and the UT, which happens to
* equal the GMST (modulo 24 hours) at 0 hours UT each day. In this
* routine, the entire UT is used directly as the argument for the
* standard formula, and the fractional part of the UT is added
* separately. Note that the factor 1.0027379... does not appear in the
* IAU 1982 expression explicitly but in the form of the coefficient
* 8640184.812866, which is 86400x36525x0.0027379...
*
* See also the routine sla_GMSTA, which delivers better numerical
* precision by accepting the UT date and time as separate arguments.
*
* Called: sla_DRANRM
*
* P.T.Wallace Starlink 14 October 2001
*
* Copyright (C) 2001 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION UT1
DOUBLE PRECISION sla_DRANRM
DOUBLE PRECISION D2PI,S2R
PARAMETER (D2PI=6.283185307179586476925286766559D0,
: S2R=7.272205216643039903848711535369D-5)
DOUBLE PRECISION TU
* Julian centuries from fundamental epoch J2000 to this UT
TU=(UT1-51544.5D0)/36525D0
* GMST at this UT
sla_GMST=sla_DRANRM(MOD(UT1,1D0)*D2PI+
: (24110.54841D0+
: (8640184.812866D0+
: (0.093104D0-6.2D-6*TU)*TU)*TU)*S2R)
END
SUBROUTINE sla_NUTC (DATE, DPSI, DEPS, EPS0)
*+
* - - - - -
* N U T C
* - - - - -
*
* Nutation: longitude & obliquity components and mean obliquity,
* using the Shirai & Fukushima (2001) theory.
*
* Given:
* DATE d TDB (loosely ET) as Modified Julian Date
* (JD-2400000.5)
* Returned:
* DPSI,DEPS d nutation in longitude,obliquity
* EPS0 d mean obliquity
*
* Notes:
*
* 1 The routine predicts forced nutation (but not free core nutation)
* plus corrections to the IAU 1976 precession model.
*
* 2 Earth attitude predictions made by combining the present nutation
* model with IAU 1976 precession are accurate to 1 mas (with respect
* to the ICRF) for a few decades around 2000.
*
* 3 The sla_NUTC80 routine is the equivalent of the present routine
* but using the IAU 1980 nutation theory. The older theory is less
* accurate, leading to errors as large as 350 mas over the interval
* 1900-2100, mainly because of the error in the IAU 1976 precession.
*
* References:
*
* Shirai, T. & Fukushima, T., Astron.J. 121, 3270-3283 (2001).
*
* Fukushima, T., Astron.Astrophys. 244, L11 (1991).
*
* Simon, J. L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
* Francou, G. & Laskar, J., Astron.Astrophys. 282, 663 (1994).
*
* This revision: 24 November 2005
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DATE,DPSI,DEPS,EPS0
* Degrees to radians
DOUBLE PRECISION DD2R
PARAMETER (DD2R=1.745329251994329576923691D-2)
* Arc seconds to radians
DOUBLE PRECISION DAS2R
PARAMETER (DAS2R=4.848136811095359935899141D-6)
* Arc seconds in a full circle
DOUBLE PRECISION TURNAS
PARAMETER (TURNAS=1296000D0)
* Reference epoch (J2000), MJD
DOUBLE PRECISION DJM0
PARAMETER (DJM0=51544.5D0 )
* Days per Julian century
DOUBLE PRECISION DJC
PARAMETER (DJC=36525D0)
INTEGER I,J
DOUBLE PRECISION T,EL,ELP,F,D,OM,VE,MA,JU,SA,THETA,C,S,DP,DE
* Number of terms in the nutation model
INTEGER NTERMS
PARAMETER (NTERMS=194)
* The SF2001 forced nutation model
INTEGER NA(9,NTERMS)
DOUBLE PRECISION PSI(4,NTERMS), EPS(4,NTERMS)
* Coefficients of fundamental angles
DATA ( ( NA(I,J), I=1,9 ), J=1,10 ) /
: 0, 0, 0, 0, -1, 0, 0, 0, 0,
: 0, 0, 2, -2, 2, 0, 0, 0, 0,
: 0, 0, 2, 0, 2, 0, 0, 0, 0,
: 0, 0, 0, 0, -2, 0, 0, 0, 0,
: 0, 1, 0, 0, 0, 0, 0, 0, 0,
: 0, 1, 2, -2, 2, 0,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: 0, 0, 1, -1, 1, 0, 0, -1, 0,
: 0, 0, -1, 1, -1, 1, 0, 0, 0,
: 0, 0, -1, 1, 0, 0, 2, 0, 0,
: 0, 0, 3, -3, 3, 0, 0, -1, 0,
: 0, 0, -8, 8, -7, 5, 0, 0, 0,
: 0, 0, -1, 1, -1, 0, 2, 0, 0 /
DATA ( ( NA(I,J), I=1,9 ), J=171,180 ) /
: 0, 0, -2, 2, -2, 2, 0, 0, 0,
: 0, 0, -6, 6, -6, 4, 0, 0, 0,
: 0, 0, -2, 2, -2, 0, 8, -3, 0,
: 0, 0, 6, -6, 6, 0, -8, 3, 0,
: 0, 0, 4, -4, 4, -2, 0, 0, 0,
: 0, 0, -3, 3, -3, 2, 0, 0, 0,
: 0, 0, 4, -4, 3, 0, -8, 3, 0,
: 0, 0, -4, 4, -5, 0, 8, -3, 0,
: 0, 0, 0, 0, 0, 2, 0, 0, 0,
: 0, 0, -4, 4, -4, 3, 0, 0, 0 /
DATA ( ( NA(I,J), I=1,9 ), J=181,190 ) /
: 0, 1, -1, 1, -1, 0, 0, 1, 0,
: 0, 0, 0, 0, 0, 0, 0, 1, 0,
: 0, 0, 1, -1, 1, 1, 0, 0, 0,
: 0, 0, 2, -2, 2, 0, -2, 0, 0,
: 0, -1, -7, 7, -7, 5, 0, 0, 0,
: -2, 0, 2, 0, 2, 0, 0, -2, 0,
: -2, 0, 2, 0, 1, 0, 0, -3, 0,
: 0, 0, 2, -2, 2, 0, 0, -2, 0,
: 0, 0, 1, -1, 1, 0, 0, 1, 0,
: 0, 0, 0, 0, 0, 0, 0, 0, 2 /
DATA ( ( NA(I,J), I=1,9 ), J=191,NTERMS ) /
: 0, 0, 0, 0, 0, 0, 0, 0, 1,
: 2, 0, -2, 0, -2, 0, 0, 3, 0,
: 0, 0, 1, -1, 1, 0, 0, -2, 0,
: 0, 0, -7, 7, -7, 5, 0, 0, 0 /
* Nutation series: longitude
DATA ( ( PSI(I,J), I=1,4 ), J=1,10 ) /
: 3341.5D0, 17206241.8D0, 3.1D0, 17409.5D0,
: -1716.8D0, -1317185.3D0, 1.4D0, -156.8D0,
: 285.7D0, -227667.0D0, 0.3D0, -23.5D0,
: -68.6D0, -207448.0D0, 0.0D0, -21.4D0,
: 950.3D0, 147607.9D0, -2.3D0, -355.0D0,
: -66.7D0, -51689.1D0, 0.2D0, 122.6D0,
: -108.6D0, 71117.6D0, 0.0D0, 7.0D0,
: 35.6D0, -38740.2D0, 0.1D0, -36.2D0,
: 85.4D0, -30127.6D0, 0.0D0, -3.1D0,
: 9.0D0, 21583.0D0, 0.1D0, -50.3D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=11,20 ) /
: 22.1D0, 12822.8D0, 0.0D0, 13.3D0,
: 3.4D0, 12350.8D0, 0.0D0, 1.3D0,
: -21.1D0, 15699.4D0, 0.0D0, 1.6D0,
: 4.2D0, 6313.8D0, 0.0D0, 6.2D0,
: -22.8D0, 5796.9D0, 0.0D0, 6.1D0,
: 15.7D0, -5961.1D0, 0.0D0, -0.6D0,
: 13.1D0, -5159.1D0, 0.0D0, -4.6D0,
: 1.8D0, 4592.7D0, 0.0D0, 4.5D0,
: -17.5D0, 6336.0D0, 0.0D0, 0.7D0,
: 16.3D0, -3851.1D0, 0.0D0, -0.4D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=21,30 ) /
: -2.8D0, 4771.7D0, 0.0D0, 0.5D0,
: 13.8D0, -3099.3D0, 0.0D0, -0.3D0,
: 0.2D0, 2860.3D0, 0.0D0, 0.3D0,
: 1.4D0, 2045.3D0, 0.0D0, 2.0D0,
: -8.6D0, 2922.6D0, 0.0D0, 0.3D0,
: -7.7D0, 2587.9D0, 0.0D0, 0.2D0,
: 8.8D0, -1408.1D0, 0.0D0, 3.7D0,
: 1.4D0, 1517.5D0, 0.0D0, 1.5D0,
: -1.9D0, -1579.7D0, 0.0D0, 7.7D0,
: 1.3D0, -2178.6D0, 0.0D0, -0.2D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=31,40 ) /
: -4.8D0, 1286.8D0, 0.0D0, 1.3D0,
: 6.3D0, 1267.2D0, 0.0D0, -4.0D0,
: -1.0D0, 1669.3D0, 0.0D0, -8.3D0,
: 2.4D0, -1020.0D0, 0.0D0, -0.9D0,
: 4.5D0, -766.9D0, 0.0D0, 0.0D0,
: -1.1D0, 756.5D0, 0.0D0, -1.7D0,
: -1.4D0, -1097.3D0, 0.0D0, -0.5D0,
: 2.6D0, -663.0D0, 0.0D0, -0.6D0,
: 0.8D0, -714.1D0, 0.0D0, 1.6D0,
: 0.4D0, -629.9D0, 0.0D0, -0.6D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=41,50 ) /
: 0.3D0, 580.4D0, 0.0D0, 0.6D0,
: -1.6D0, 577.3D0, 0.0D0, 0.5D0,
: -0.9D0, 644.4D0, 0.0D0, 0.0D0,
: 2.2D0, -534.0D0, 0.0D0, -0.5D0,
: -2.5D0, 493.3D0, 0.0D0, 0.5D0,
: -0.1D0, -477.3D0, 0.0D0, -2.4D0,
: -0.9D0, 735.0D0, 0.0D0, -1.7D0,
: 0.7D0, 406.2D0, 0.0D0, 0.4D0,
: -2.8D0, 656.9D0, 0.0D0, 0.0D0,
: 0.6D0, 358.0D0, 0.0D0, 2.0D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=51,60 ) /
: -0.7D0, 472.5D0, 0.0D0, -1.1D0,
: -0.1D0, -300.5D0, 0.0D0, 0.0D0,
: -1.2D0, 435.1D0, 0.0D0, -1.0D0,
: 1.8D0, -289.4D0, 0.0D0, 0.0D0,
: 0.6D0, -422.6D0, 0.0D0, 0.0D0,
: 0.8D0, -287.6D0, 0.0D0, 0.6D0,
: -38.6D0, -392.3D0, 0.0D0, 0.0D0,
: 0.7D0, -281.8D0, 0.0D0, 0.6D0,
: 0.6D0, -405.7D0, 0.0D0, 0.0D0,
: -1.2D0, 229.0D0, 0.0D0, 0.2D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=61,70 ) /
: 1.1D0, -264.3D0, 0.0D0, 0.5D0,
: -0.7D0, 247.9D0, 0.0D0, -0.5D0,
: -0.2D0, 218.0D0, 0.0D0, 0.2D0,
: 0.6D0, -339.0D0, 0.0D0, 0.8D0,
: -0.7D0, 198.7D0, 0.0D0, 0.2D0,
: -1.5D0, 334.0D0, 0.0D0, 0.0D0,
: 0.1D0, 334.0D0, 0.0D0, 0.0D0,
: -0.1D0, -198.1D0, 0.0D0, 0.0D0,
: -106.6D0, 0.0D0, 0.0D0, 0.0D0,
: -0.5D0, 165.8D0, 0.0D0, 0.0D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=71,80 ) /
: 0.0D0, 134.8D0, 0.0D0, 0.0D0,
: 0.9D0, -151.6D0, 0.0D0, 0.0D0,
: 0.0D0, -129.7D0, 0.0D0, 0.0D0,
: 0.8D0, -132.8D0, 0.0D0, -0.1D0,
: 0.5D0, -140.7D0, 0.0D0, 0.0D0,
: -0.1D0, 138.4D0, 0.0D0, 0.0D0,
: 0.0D0, 129.0D0, 0.0D0, -0.3D0,
: 0.5D0, -121.2D0, 0.0D0, 0.0D0,
: -0.3D0, 114.5D0, 0.0D0, 0.0D0,
: -0.1D0, 101.8D0, 0.0D0, 0.0D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=81,90 ) /
: -3.6D0, -101.9D0, 0.0D0, 0.0D0,
: 0.8D0, -109.4D0, 0.0D0, 0.0D0,
: 0.2D0, -97.0D0, 0.0D0, 0.0D0,
: -0.7D0, 157.3D0, 0.0D0, 0.0D0,
: 0.2D0, -83.3D0, 0.0D0, 0.0D0,
: -0.3D0, 93.3D0, 0.0D0, 0.0D0,
: -0.1D0, 92.1D0, 0.0D0, 0.0D0,
: -0.5D0, 133.6D0, 0.0D0, 0.0D0,
: -0.1D0, 81.5D0, 0.0D0, 0.0D0,
: 0.0D0, 123.9D0, 0.0D0, 0.0D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=91,100 ) /
: -0.3D0, 128.1D0, 0.0D0, 0.0D0,
: 0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.0D0, 0.0D0,
: 0.1D0, -20.8D0, 0.0D0, 0.0D0,
: -0.2D0, 33.4D0, 0.0D0, 0.0D0,
: 32.9D0, 0.0D0, 0.0D0, 0.0D0,
: 0.1D0, -32.6D0, 0.0D0, 0.0D0,
: 0.0D0, 19.9D0, 0.0D0, 0.0D0,
: -0.1D0, 19.6D0, 0.0D0, 0.0D0,
: 0.0D0, -18.7D0, 0.0D0, 0.0D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=161,170 ) /
: 0.1D0, -19.0D0, 0.0D0, 0.0D0,
: 0.1D0, -28.6D0, 0.0D0, 0.0D0,
: 4.0D0, 178.8D0,-11.8D0, 0.3D0,
: 39.8D0, -107.3D0, -5.6D0, -1.0D0,
: 9.9D0, 164.0D0, -4.1D0, 0.1D0,
: -4.8D0, -135.3D0, -3.4D0, -0.1D0,
: 50.5D0, 75.0D0, 1.4D0, -1.2D0,
: -1.1D0, -53.5D0, 1.3D0, 0.0D0,
: -45.0D0, -2.4D0, -0.4D0, 6.6D0,
: -11.5D0, -61.0D0, -0.9D0, 0.4D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=171,180 ) /
: 4.4D0, -68.4D0, -3.4D0, 0.0D0,
: 7.7D0, -47.1D0, -4.7D0, -1.0D0,
: -42.9D0, -12.6D0, -1.2D0, 4.2D0,
: -42.8D0, 12.7D0, -1.2D0, -4.2D0,
: -7.6D0, -44.1D0, 2.1D0, -0.5D0,
: -64.1D0, 1.7D0, 0.2D0, 4.5D0,
: 36.4D0, -10.4D0, 1.0D0, 3.5D0,
: 35.6D0, 10.2D0, 1.0D0, -3.5D0,
: -1.7D0, 39.5D0, 2.0D0, 0.0D0,
: 50.9D0, -8.2D0, -0.8D0, -5.0D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=181,190 ) /
: 0.0D0, 52.3D0, 1.2D0, 0.0D0,
: -42.9D0, -17.8D0, 0.4D0, 0.0D0,
: 2.6D0, 34.3D0, 0.8D0, 0.0D0,
: -0.8D0, -48.6D0, 2.4D0, -0.1D0,
: -4.9D0, 30.5D0, 3.7D0, 0.7D0,
: 0.0D0, -43.6D0, 2.1D0, 0.0D0,
: 0.0D0, -25.4D0, 1.2D0, 0.0D0,
: 2.0D0, 40.9D0, -2.0D0, 0.0D0,
: -2.1D0, 26.1D0, 0.6D0, 0.0D0,
: 22.6D0, -3.2D0, -0.5D0, -0.5D0 /
DATA ( ( PSI(I,J), I=1,4 ), J=191,NTERMS ) /
: -7.6D0, 24.9D0, -0.4D0, -0.2D0,
: -6.2D0, 34.9D0, 1.7D0, 0.3D0,
: 2.0D0, 17.4D0, -0.4D0, 0.1D0,
: -3.9D0, 20.5D0, 2.4D0, 0.6D0 /
* Nutation series: obliquity
DATA ( ( EPS(I,J), I=1,4 ), J=1,10 ) /
: 9205365.8D0, -1506.2D0, 885.7D0, -0.2D0,
: 573095.9D0, -570.2D0, -305.0D0, -0.3D0,
: 97845.5D0, 147.8D0, -48.8D0, -0.2D0,
: -89753.6D0, 28.0D0, 46.9D0, 0.0D0,
: 7406.7D0, -327.1D0, -18.2D0, 0.8D0,
: 22442.3D0, -22.3D0, -67.6D0, 0.0D0,
: -683.6D0, 46.8D0, 0.0D0, 0.0D0,
: 20070.7D0, 36.0D0, 1.6D0, 0.0D0,
: 12893.8D0, 39.5D0, -6.2D0, 0.0D0,
: -9593.2D0, 14.4D0, 30.2D0, -0.1D0 /
DATA ( ( EPS(I,J), I=1,4 ), J=11,20 ) /
: -6899.5D0, 4.8D0, -0.6D0, 0.0D0,
: -5332.5D0, -0.1D0, 2.7D0, 0.0D0,
: -125.2D0, 10.5D0, 0.0D0, 0.0D0,
: -3323.4D0, -0.9D0, -0.3D0, 0.0D0,
: 3142.3D0, 8.9D0, 0.3D0, 0.0D0,
: 2552.5D0, 7.3D0, -1.2D0, 0.0D0,
: 2634.4D0, 8.8D0, 0.2D0, 0.0D0,
: -2424.4D0, 1.6D0, -0.4D0, 0.0D0,
: -123.3D0, 3.9D0, 0.0D0, 0.0D0,
: 1642.4D0, 7.3D0, -0.8D0, 0.0D0 /
DATA ( ( EPS(I,J), I=1,4 ), J=21,30 ) /
: 47.9D0, 3.2D0, 0.0D0, 0.0D0,
: 1321.2D0, 6.2D0, -0.6D0, 0.0D0,
: -1234.1D0, -0.3D0, 0.6D0, 0.0D0,
: -1076.5D0, -0.3D0, 0.0D0, 0.0D0,
: -61.6D0, 1.8D0, 0.0D0, 0.0D0,
: -55.4D0, 1.6D0, 0.0D0, 0.0D0,
: 856.9D0, -4.9D0, -2.1D0, 0.0D0,
: -800.7D0, -0.1D0, 0.0D0, 0.0D0,
: 685.1D0, -0.6D0, -3.8D0, 0.0D0,
: -16.9D0, -1.5D0, 0.0D0, 0.0D0 /
DATA ( ( EPS(I,J), I=1,4 ), J=31,40 ) /
: 695.7D0, 1.8D0, 0.0D0, 0.0D0,
: 642.2D0, -2.6D0, -1.6D0, 0.0D0,
: 13.3D0, 1.1D0, -0.1D0, 0.0D0,
: 521.9D0, 1.6D0, 0.0D0, 0.0D0,
: 325.8D0, 2.0D0, -0.1D0, 0.0D0,
: -325.1D0, -0.5D0, 0.9D0, 0.0D0,
: 10.1D0, 0.3D0, 0.0D0, 0.0D0,
: 334.5D0, 1.6D0, 0.0D0, 0.0D0,
: 307.1D0, 0.4D0, -0.9D0, 0.0D0,
: 327.2D0, 0.5D0, 0.0D0, 0.0D0 /
DATA ( ( EPS(I,J), I=1,4 ), J=41,50 ) /
: -304.6D0, -0.1D0, 0.0D0, 0.0D0,
: 304.0D0, 0.6D0, 0.0D0, 0.0D0,
: -276.8D0, -0.5D0, 0.1D0, 0.0D0,
: 268.9D0, 1.3D0, 0.0D0, 0.0D0,
: 271.8D0, 1.1D0, 0.0D0, 0.0D0,
: 271.5D0, -0.4D0, -0.8D0, 0.0D0,
: -5.2D0, 0.5D0, 0.0D0, 0.0D0,
: -220.5D0, 0.1D0, 0.0D0, 0.0D0,
: -20.1D0, 0.3D0, 0.0D0, 0.0D0,
: -191.0D0, 0.1D0, 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.8D0, -0.4D0, 1.8D0,
: 5.5D0, -18.7D0, -1.8D0, -0.5D0,
: -5.5D0, -18.7D0, 1.8D0, -0.5D0,
: 18.4D0, -3.6D0, 0.3D0, 0.9D0,
: -0.6D0, 1.3D0, 0.0D0, 0.0D0,
: -5.6D0, -19.5D0, 1.9D0, 0.0D0,
: 5.5D0, -19.1D0, -1.9D0, 0.0D0,
: -17.3D0, -0.8D0, 0.0D0, 0.9D0,
: -3.2D0, -8.3D0, -0.8D0, 0.3D0 /
DATA ( ( EPS(I,J), I=1,4 ), J=181,190 ) /
: -0.1D0, 0.0D0, 0.0D0, 0.0D0,
: -5.4D0, 7.8D0, -0.3D0, 0.0D0,
: -14.8D0, 1.4D0, 0.0D0, 0.3D0,
: -3.8D0, 0.4D0, 0.0D0, -0.2D0,
: 12.6D0, 3.2D0, 0.5D0, -1.5D0,
: 0.1D0, 0.0D0, 0.0D0, 0.0D0,
: -13.6D0, 2.4D0, -0.1D0, 0.0D0,
: 0.9D0, 1.2D0, 0.0D0, 0.0D0,
: -11.9D0, -0.5D0, 0.0D0, 0.3D0,
: 0.4D0, 12.0D0, 0.3D0, -0.2D0 /
DATA ( ( EPS(I,J), I=1,4 ), J=191,NTERMS ) /
: 8.3D0, 6.1D0, -0.1D0, 0.1D0,
: 0.0D0, 0.0D0, 0.0D0, 0.0D0,
: 0.4D0, -10.8D0, 0.3D0, 0.0D0,
: 9.6D0, 2.2D0, 0.3D0, -1.2D0 /
* Interval between fundamental epoch J2000.0 and given epoch (JC).
T = (DATE-DJM0)/DJC
* Mean anomaly of the Moon.
EL = 134.96340251D0*DD2R+
: MOD(T*(1717915923.2178D0+
: T*( 31.8792D0+
: T*( 0.051635D0+
: T*( - 0.00024470D0)))),TURNAS)*DAS2R
* Mean anomaly of the Sun.
ELP = 357.52910918D0*DD2R+
: MOD(T*( 129596581.0481D0+
: T*( - 0.5532D0+
: T*( 0.000136D0+
: T*( - 0.00001149D0)))),TURNAS)*DAS2R
* Mean argument of the latitude of the Moon.
F = 93.27209062D0*DD2R+
: MOD(T*(1739527262.8478D0+
: T*( - 12.7512D0+
: T*( - 0.001037D0+
: T*( 0.00000417D0)))),TURNAS)*DAS2R
* Mean elongation of the Moon from the Sun.
D = 297.85019547D0*DD2R+
: MOD(T*(1602961601.2090D0+
: T*( - 6.3706D0+
: T*( 0.006539D0+
: T*( - 0.00003169D0)))),TURNAS)*DAS2R
* Mean longitude of the ascending node of the Moon.
OM = 125.04455501D0*DD2R+
: MOD(T*( - 6962890.5431D0+
: T*( 7.4722D0+
: T*( 0.007702D0+
: T*( - 0.00005939D0)))),TURNAS)*DAS2R
* Mean longitude of Venus.
VE = 181.97980085D0*DD2R+MOD(210664136.433548D0*T,TURNAS)*DAS2R
* Mean longitude of Mars.
MA = 355.43299958D0*DD2R+MOD( 68905077.493988D0*T,TURNAS)*DAS2R
* Mean longitude of Jupiter.
JU = 34.35151874D0*DD2R+MOD( 10925660.377991D0*T,TURNAS)*DAS2R
* Mean longitude of Saturn.
SA = 50.07744430D0*DD2R+MOD( 4399609.855732D0*T,TURNAS)*DAS2R
* Geodesic nutation (Fukushima 1991) in microarcsec.
DP = -153.1D0*SIN(ELP)-1.9D0*SIN(2D0*ELP)
DE = 0D0
* Shirai & Fukushima (2001) nutation series.
DO J=NTERMS,1,-1
THETA = DBLE(NA(1,J))*EL+
: DBLE(NA(2,J))*ELP+
: DBLE(NA(3,J))*F+
: DBLE(NA(4,J))*D+
: DBLE(NA(5,J))*OM+
: DBLE(NA(6,J))*VE+
: DBLE(NA(7,J))*MA+
: DBLE(NA(8,J))*JU+
: DBLE(NA(9,J))*SA
C = COS(THETA)
S = SIN(THETA)
DP = DP+(PSI(1,J)+PSI(3,J)*T)*C+(PSI(2,J)+PSI(4,J)*T)*S
DE = DE+(EPS(1,J)+EPS(3,J)*T)*C+(EPS(2,J)+EPS(4,J)*T)*S
END DO
* Change of units, and addition of the precession correction.
DPSI = (DP*1D-6-0.042888D0-0.29856D0*T)*DAS2R
DEPS = (DE*1D-6-0.005171D0-0.02408D0*T)*DAS2R
* Mean obliquity of date (Simon et al. 1994).
EPS0 = (84381.412D0+
: (-46.80927D0+
: (-0.000152D0+
: (0.0019989D0+
: (-0.00000051D0+
: (-0.000000025D0)*T)*T)*T)*T)*T)*DAS2R
END
SUBROUTINE sla_NUT (DATE, RMATN)
*+
* - - - -
* N U T
* - - - -
*
* Form the matrix of nutation for a given date - Shirai & Fukushima
* 2001 theory (double precision)
*
* Reference:
* Shirai, T. & Fukushima, T., Astron.J. 121, 3270-3283 (2001).
*
* Given:
* DATE d TDB (loosely ET) as Modified Julian Date
* (=JD-2400000.5)
* Returned:
* RMATN d(3,3) nutation matrix
*
* Notes:
*
* 1 The matrix is in the sense v(true) = rmatn * v(mean) .
* where v(true) is the star vector relative to the true equator and
* equinox of date and v(mean) is the star vector relative to the
* mean equator and equinox of date.
*
* 2 The matrix represents forced nutation (but not free core
* nutation) plus corrections to the IAU~1976 precession model.
*
* 3 Earth attitude predictions made by combining the present nutation
* matrix with IAU~1976 precession are accurate to 1~mas (with
* respect to the ICRS) for a few decades around 2000.
*
* 4 The distinction between the required TDB and TT is always
* negligible. Moreover, for all but the most critical applications
* UTC is adequate.
*
* Called: sla_NUTC, sla_DEULER
*
* Last revision: 1 December 2005
*
* Copyright P.T.Wallace. All rights reserved.
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION DATE,RMATN(3,3)
DOUBLE PRECISION DPSI,DEPS,EPS0
* Nutation components and mean obliquity
CALL sla_NUTC(DATE,DPSI,DEPS,EPS0)
* Rotation matrix
CALL sla_DEULER('XZX',EPS0,-DPSI,-(EPS0+DEPS),RMATN)
END
SUBROUTINE sla_PREBN (BEP0, BEP1, RMATP)
*+
* - - - - - -
* P R E B N
* - - - - - -
*
* Generate the matrix of precession between two epochs,
* using the old, pre-IAU1976, Bessel-Newcomb model, using
* Kinoshita's formulation (double precision)
*
* Given:
* BEP0 dp beginning Besselian epoch
* BEP1 dp ending Besselian epoch
*
* Returned:
* RMATP dp(3,3) precession matrix
*
* The matrix is in the sense V(BEP1) = RMATP * V(BEP0)
*
* Reference:
* Kinoshita, H. (1975) 'Formulas for precession', SAO Special
* Report No. 364, Smithsonian Institution Astrophysical
* Observatory, Cambridge, Massachusetts.
*
* Called: sla_DEULER
*
* P.T.Wallace Starlink 23 August 1996
*
* Copyright (C) 1996 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION BEP0,BEP1,RMATP(3,3)
* Arc seconds to radians
DOUBLE PRECISION AS2R
PARAMETER (AS2R=0.484813681109535994D-5)
DOUBLE PRECISION BIGT,T,TAS2R,W,ZETA,Z,THETA
* Interval between basic epoch B1850.0 and beginning epoch in TC
BIGT = (BEP0-1850D0)/100D0
* Interval over which precession required, in tropical centuries
T = (BEP1-BEP0)/100D0
* Euler angles
TAS2R = T*AS2R
W = 2303.5548D0+(1.39720D0+0.000059D0*BIGT)*BIGT
ZETA = (W+(0.30242D0-0.000269D0*BIGT+0.017996D0*T)*T)*TAS2R
Z = (W+(1.09478D0+0.000387D0*BIGT+0.018324D0*T)*T)*TAS2R
THETA = (2005.1125D0+(-0.85294D0-0.000365D0*BIGT)*BIGT+
: (-0.42647D0-0.000365D0*BIGT-0.041802D0*T)*T)*TAS2R
* Rotation matrix
CALL sla_DEULER('ZYZ',-ZETA,THETA,-Z,RMATP)
END
SUBROUTINE sla_PRECES (SYSTEM, EP0, EP1, RA, DC)
*+
* - - - - - - -
* P R E C E S
* - - - - - - -
*
* Precession - either FK4 (Bessel-Newcomb, pre IAU 1976) or
* FK5 (Fricke, post IAU 1976) as required.
*
* Given:
* SYSTEM char precession to be applied: 'FK4' or 'FK5'
* EP0,EP1 dp starting and ending epoch
* RA,DC dp RA,Dec, mean equator & equinox of epoch EP0
*
* Returned:
* RA,DC dp RA,Dec, mean equator & equinox of epoch EP1
*
* Called: sla_DRANRM, sla_PREBN, sla_PREC, sla_DCS2C,
* sla_DMXV, sla_DCC2S
*
* Notes:
*
* 1) Lowercase characters in SYSTEM are acceptable.
*
* 2) The epochs are Besselian if SYSTEM='FK4' and Julian if 'FK5'.
* For example, to precess coordinates in the old system from
* equinox 1900.0 to 1950.0 the call would be:
* CALL sla_PRECES ('FK4', 1900D0, 1950D0, RA, DC)
*
* 3) This routine will NOT correctly convert between the old and
* the new systems - for example conversion from B1950 to J2000.
* For these purposes see sla_FK425, sla_FK524, sla_FK45Z and
* sla_FK54Z.
*
* 4) If an invalid SYSTEM is supplied, values of -99D0,-99D0 will
* be returned for both RA and DC.
*
* P.T.Wallace Starlink 20 April 1990
*
* Copyright (C) 1995 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
CHARACTER SYSTEM*(*)
DOUBLE PRECISION EP0,EP1,RA,DC
DOUBLE PRECISION PM(3,3),V1(3),V2(3)
CHARACTER SYSUC*3
DOUBLE PRECISION sla_DRANRM
* Convert to uppercase and validate SYSTEM
SYSUC=SYSTEM
IF (SYSUC(1:1).EQ.'f') SYSUC(1:1)='F'
IF (SYSUC(2:2).EQ.'k') SYSUC(2:2)='K'
IF (SYSUC.NE.'FK4'.AND.SYSUC.NE.'FK5') THEN
RA=-99D0
DC=-99D0
ELSE
* Generate appropriate precession matrix
IF (SYSUC.EQ.'FK4') THEN
CALL sla_PREBN(EP0,EP1,PM)
ELSE
CALL sla_PREC(EP0,EP1,PM)
END IF
* Convert RA,Dec to x,y,z
CALL sla_DCS2C(RA,DC,V1)
* Precess
CALL sla_DMXV(PM,V1,V2)
* Back to RA,Dec
CALL sla_DCC2S(V2,RA,DC)
RA=sla_DRANRM(RA)
END IF
END
SUBROUTINE sla_PREC (EP0, EP1, RMATP)
*+
* - - - - -
* P R E C
* - - - - -
*
* Form the matrix of precession between two epochs (IAU 1976, FK5)
* (double precision)
*
* Given:
* EP0 dp beginning epoch
* EP1 dp ending epoch
*
* Returned:
* RMATP dp(3,3) precession matrix
*
* Notes:
*
* 1) The epochs are TDB (loosely ET) Julian epochs.
*
* 2) The matrix is in the sense V(EP1) = RMATP * V(EP0)
*
* 3) Though the matrix method itself is rigorous, the precession
* angles are expressed through canonical polynomials which are
* valid only for a limited time span. There are also known
* errors in the IAU precession rate. The absolute accuracy
* of the present formulation is better than 0.1 arcsec from
* 1960AD to 2040AD, better than 1 arcsec from 1640AD to 2360AD,
* and remains below 3 arcsec for the whole of the period
* 500BC to 3000AD. The errors exceed 10 arcsec outside the
* range 1200BC to 3900AD, exceed 100 arcsec outside 4200BC to
* 5600AD and exceed 1000 arcsec outside 6800BC to 8200AD.
* The SLALIB routine sla_PRECL implements a more elaborate
* model which is suitable for problems spanning several
* thousand years.
*
* References:
* Lieske,J.H., 1979. Astron.Astrophys.,73,282.
* equations (6) & (7), p283.
* Kaplan,G.H., 1981. USNO circular no. 163, pA2.
*
* Called: sla_DEULER
*
* P.T.Wallace Starlink 23 August 1996
*
* Copyright (C) 1996 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION EP0,EP1,RMATP(3,3)
* Arc seconds to radians
DOUBLE PRECISION AS2R
PARAMETER (AS2R=0.484813681109535994D-5)
DOUBLE PRECISION T0,T,TAS2R,W,ZETA,Z,THETA
* Interval between basic epoch J2000.0 and beginning epoch (JC)
T0 = (EP0-2000D0)/100D0
* Interval over which precession required (JC)
T = (EP1-EP0)/100D0
* Euler angles
TAS2R = T*AS2R
W = 2306.2181D0+(1.39656D0-0.000139D0*T0)*T0
ZETA = (W+((0.30188D0-0.000344D0*T0)+0.017998D0*T)*T)*TAS2R
Z = (W+((1.09468D0+0.000066D0*T0)+0.018203D0*T)*T)*TAS2R
THETA = ((2004.3109D0+(-0.85330D0-0.000217D0*T0)*T0)
: +((-0.42665D0-0.000217D0*T0)-0.041833D0*T)*T)*TAS2R
* Rotation matrix
CALL sla_DEULER('ZYZ',-ZETA,THETA,-Z,RMATP)
END
SUBROUTINE sla_PVOBS (P, H, STL, PV)
*+
* - - - - - -
* P V O B S
* - - - - - -
*
* Position and velocity of an observing station (double precision)
*
* Given:
* P dp latitude (geodetic, radians)
* H dp height above reference spheroid (geodetic, metres)
* STL dp local apparent sidereal time (radians)
*
* Returned:
* PV dp(6) position/velocity 6-vector (AU, AU/s, true equator
* and equinox of date)
*
* Called: sla_GEOC
*
* IAU 1976 constants are used.
*
* P.T.Wallace Starlink 14 November 1994
*
* Copyright (C) 1995 Rutherford Appleton Laboratory
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see SLA_CONDITIONS); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
*-
IMPLICIT NONE
DOUBLE PRECISION P,H,STL,PV(6)
DOUBLE PRECISION R,Z,S,C,V
* Mean sidereal rate (at J2000) in radians per (UT1) second
DOUBLE PRECISION SR
PARAMETER (SR=7.292115855306589D-5)
* Geodetic to geocentric conversion
CALL sla_GEOC(P,H,R,Z)
* Functions of ST
S=SIN(STL)
C=COS(STL)
* Speed
V=SR*R
* Position
PV(1)=R*C
PV(2)=R*S
PV(3)=Z
* Velocity
PV(4)=-V*S
PV(5)=V*C
PV(6)=0D0
END
|