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