ungrib build
[WPS.git] / ungrib / src / ngl / w3 / w3fs21.f
blob3593d6ffeb9b247f38af10885ded163d0abe17b5
1 SUBROUTINE W3FS21(IDATE, NMIN)
2 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
3 C . . . .
4 C SUBPROGRAM: W3FS21 NUMBER OF MINUTES SINCE JAN 1, 1978
5 C PRGMMR: REJONES ORG: NMC421 DATE: 89-07-17
7 C ABSTRACT: CALCULATES THE NUMBER OF MINUTES SINCE 0000,
8 C 1 JANUARY 1978.
10 C PROGRAM HISTORY LOG:
11 C 84-06-21 A. DESMARAIS
12 C 89-07-14 R.E.JONES CONVERT TO CYBER 205 FORTRAN 200,
13 C CHANGE LOGIC SO IT WILL WORK IN
14 C 21 CENTURY.
15 C 89-11-02 R.E.JONES CONVERT TO CRAY CFT77 FORTRAN
17 C USAGE: CALL W3FS21 (IDATE, NMIN)
18 C INPUT ARGUMENT LIST:
19 C IDATE - INTEGER SIZE 5 ARRAY CONTAINING YEAR OF CENTURY,
20 C MONTH, DAY, HOUR AND MINUTE. IDATE(1) MAY BE
21 C A TWO DIGIT YEAR OR 4. IF 2 DIGITS AND GE THAN 78
22 C 1900 IS ADDED TO IT. IF LT 78 THEN 2000 IS ADDED
23 C TO IT. IF 4 DIGITS THE SUBROUTINE WILL WORK
24 C CORRECTLY TO THE YEAR 3300 A.D.
26 C OUTPUT ARGUMENT LIST:
27 C NMIN - INTEGER NUMBER OF MINUTES SINCE 1 JANUARY 1978
29 C SUBPROGRAMS CALLED:
30 C LIBRARY:
31 C W3LIB - IW3JDN
33 C ATTRIBUTES:
34 C LANGUAGE: CRAY CFT77 FORTRAN
35 C MACHINE: CRAY Y-MP8/832
37 C$$$
39 INTEGER IDATE(5)
40 INTEGER NMIN
41 INTEGER JDN78
43 DATA JDN78 / 2443510 /
45 C*** IDATE(1) YEAR OF CENTURY
46 C*** IDATE(2) MONTH OF YEAR
47 C*** IDATE(3) DAY OF MONTH
48 C*** IDATE(4) HOUR OF DAY
49 C*** IDATE(5) MINUTE OF HOUR
51 NMIN = 0
53 IYEAR = IDATE(1)
55 IF (IYEAR.LE.99) THEN
56 IF (IYEAR.LT.78) THEN
57 IYEAR = IYEAR + 2000
58 ELSE
59 IYEAR = IYEAR + 1900
60 ENDIF
61 ENDIF
63 C COMPUTE JULIAN DAY NUMBER FROM YEAR, MONTH, DAY
65 IJDN = IW3JDN(IYEAR,IDATE(2),IDATE(3))
67 C SUBTRACT JULIAN DAY NUMBER OF JAN 1,1978 TO GET THE
68 C NUMBER OF DAYS BETWEEN DATES
70 NDAYS = IJDN - JDN78
72 C*** NUMBER OF MINUTES
74 NMIN = NDAYS * 1440 + IDATE(4) * 60 + IDATE(5)
76 RETURN
77 END