NCEPLIBS-w3emc  2.11.0
w3fs21.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Number of minutes since jan 1, 1978
3 C> @author A. Desmarais @date 1984-06-21
4 
5 C> Calculates the number of minutes since 0000, 1 January 1978.
6 C>
7 C> ### Program History Log:
8 C> Date | Programmer | Comments
9 C> -----|------------|---------
10 C> 1984-06-21 | A. Desmarais | Initial.
11 C> 1989-07-14 | Ralph Jones | Convert to cyber 205 fortran 200, change logic so it will work in 21 century.
12 C> 1989-11-02 | Ralph Jones | Convert to cray cft77 fortran.
13 C>
14 C> @param[in] IDATE (INTEGER Size 5) Array containing year of century, month,
15 C> day, hour and minute. IDATE(1) may be a two digit year or 4. If 2 digits
16 c> and GE than 78 1900 is added to it. If LT 78 then 2000 is added to it. If 4
17 C> digits the subroutine will work correctly to the year 3300 A.D.
18 C> @param[out] NMIN (INTEGER) Number of minutes since 1 January 1978.
19 C>
20 C> @author A. Desmarais @date 1984-06-21
21  SUBROUTINE w3fs21(IDATE, NMIN)
22 C
23  INTEGER IDATE(5)
24  INTEGER NMIN
25  INTEGER JDN78
26 C
27  DATA jdn78 / 2443510 /
28 C
29 C*** IDATE(1) YEAR OF CENTURY
30 C*** IDATE(2) MONTH OF YEAR
31 C*** IDATE(3) DAY OF MONTH
32 C*** IDATE(4) HOUR OF DAY
33 C*** IDATE(5) MINUTE OF HOUR
34 C
35  nmin = 0
36 C
37  iyear = idate(1)
38 C
39  IF (iyear.LE.99) THEN
40  IF (iyear.LT.78) THEN
41  iyear = iyear + 2000
42  ELSE
43  iyear = iyear + 1900
44  ENDIF
45  ENDIF
46 C
47 C COMPUTE JULIAN DAY NUMBER FROM YEAR, MONTH, DAY
48 C
49  ijdn = iw3jdn(iyear,idate(2),idate(3))
50 C
51 C SUBTRACT JULIAN DAY NUMBER OF JAN 1,1978 TO GET THE
52 C NUMBER OF DAYS BETWEEN DATES
53 C
54  ndays = ijdn - jdn78
55 C
56 C*** NUMBER OF MINUTES
57 C
58  nmin = ndays * 1440 + idate(4) * 60 + idate(5)
59 C
60  RETURN
61  END
function iw3jdn(IYEAR, MONTH, IDAY)
Computes julian day number from year (4 digits), month, and day.
Definition: iw3jdn.f:42
subroutine w3fs21(IDATE, NMIN)
Calculates the number of minutes since 0000, 1 January 1978.
Definition: w3fs21.f:22