forked from scottransom/pyslalib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
caldj.f
74 lines (65 loc) · 2.05 KB
/
caldj.f
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
SUBROUTINE sla_CALDJ (IY, IM, ID, DJM, J)
*+
* - - - - - -
* C A L D J
* - - - - - -
*
* Gregorian Calendar to Modified Julian Date
*
* (Includes century default feature: use sla_CLDJ for years
* before 100AD.)
*
* 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)
*
* Acceptable years are 00-49, interpreted as 2000-2049,
* 50-99, " " 1950-1999,
* 100 upwards, interpreted literally.
*
* Called: sla_CLDJ
*
* P.T.Wallace Starlink November 1985
*
* 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., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
*-
IMPLICIT NONE
INTEGER IY,IM,ID
DOUBLE PRECISION DJM
INTEGER J
INTEGER NY
* Default century if appropriate
IF (IY.GE.0.AND.IY.LE.49) THEN
NY=IY+2000
ELSE IF (IY.GE.50.AND.IY.LE.99) THEN
NY=IY+1900
ELSE
NY=IY
END IF
* Modified Julian Date
CALL sla_CLDJ(NY,IM,ID,DJM,J)
END