Created a tag for the 2012 HWRF baseline tests.
[WPS-merge.git] / hwrf-baseline-20120103-1354 / ungrib / src / ngl / w3 / iw3jdn.f
blob896d62114bbb09449a37783a60ccbb9532a64a4f
1 FUNCTION IW3JDN(IYEAR,MONTH,IDAY)
2 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
4 C SUBPROGRAM: IW3JDN COMPUTE JULIAN DAY NUMBER
5 C AUTHOR: JONES,R.E. ORG: W342 DATE: 87-03-29
7 C ABSTRACT: COMPUTES JULIAN DAY NUMBER FROM YEAR (4 DIGITS), MONTH,
8 C AND DAY. IW3JDN IS VALID FOR YEARS 1583 A.D. TO 3300 A.D.
9 C JULIAN DAY NUMBER CAN BE USED TO COMPUTE DAY OF WEEK, DAY OF
10 C YEAR, RECORD NUMBERS IN AN ARCHIVE, REPLACE DAY OF CENTURY,
11 C FIND THE NUMBER OF DAYS BETWEEN TWO DATES.
13 C PROGRAM HISTORY LOG:
14 C 87-03-29 R.E.JONES
15 C 89-10-25 R.E.JONES CONVERT TO CRAY CFT77 FORTRAN
17 C USAGE: II = IW3JDN(IYEAR,MONTH,IDAY)
19 C INPUT VARIABLES:
20 C NAMES INTERFACE DESCRIPTION OF VARIABLES AND TYPES
21 C ------ --------- -----------------------------------------------
22 C IYEAR ARG LIST INTEGER YEAR ( 4 DIGITS)
23 C MONTH ARG LIST INTEGER MONTH OF YEAR (1 - 12)
24 C IDAY ARG LIST INTEGER DAY OF MONTH (1 - 31)
26 C OUTPUT VARIABLES:
27 C NAMES INTERFACE DESCRIPTION OF VARIABLES AND TYPES
28 C ------ --------- -----------------------------------------------
29 C IW3JDN FUNTION INTEGER JULIAN DAY NUMBER
30 C JAN. 1,1960 IS JULIAN DAY NUMBER 2436935
31 C JAN. 1,1987 IS JULIAN DAY NUMBER 2446797
33 C REMARKS: JULIAN PERIOD WAS DEVISED BY JOSEPH SCALIGER IN 1582.
34 C JULIAN DAY NUMBER #1 STARTED ON JAN. 1,4713 B.C. THREE MAJOR
35 C CHRONOLOGICAL CYCLES BEGIN ON THE SAME DAY. A 28-YEAR SOLAR
36 C CYCLE, A 19-YEAR LUNER CYCLE, A 15-YEAR INDICTION CYCLE, USED
37 C IN ANCIENT ROME TO REGULATE TAXES. IT WILL TAKE 7980 YEARS
38 C TO COMPLETE THE PERIOD, THE PRODUCT OF 28, 19, AND 15.
39 C SCALIGER NAMED THE PERIOD, DATE, AND NUMBER AFTER HIS FATHER
40 C JULIUS (NOT AFTER THE JULIAN CALENDAR). THIS SEEMS TO HAVE
41 C CAUSED A LOT OF CONFUSION IN TEXT BOOKS. SCALIGER NAME IS
42 C SPELLED THREE DIFFERENT WAYS. JULIAN DATE AND JULIAN DAY
43 C NUMBER ARE INTERCHANGED. A JULIAN DATE IS USED BY ASTRONOMERS
44 C TO COMPUTE ACCURATE TIME, IT HAS A FRACTION. WHEN TRUNCATED TO
45 C AN INTEGER IT IS CALLED AN JULIAN DAY NUMBER. THIS FUNCTION
46 C WAS IN A LETTER TO THE EDITOR OF THE COMMUNICATIONS OF THE ACM
47 C VOLUME 11 / NUMBER 10 / OCTOBER 1968. THE JULIAN DAY NUMBER
48 C CAN BE CONVERTED TO A YEAR, MONTH, DAY, DAY OF WEEK, DAY OF
49 C YEAR BY CALLING SUBROUTINE W3FS26.
51 C ATTRIBUTES:
52 C LANGUAGE: CRAY CFT77 FORTRAN
53 C MACHINE: CRAY Y-MP8/864, CRAY Y-MP EL2/256
55 C$$$
57 IW3JDN = IDAY - 32075
58 & + 1461 * (IYEAR + 4800 + (MONTH - 14) / 12) / 4
59 & + 367 * (MONTH - 2 - (MONTH -14) / 12 * 12) / 12
60 & - 3 * ((IYEAR + 4900 + (MONTH - 14) / 12) / 100) / 4
61 RETURN
62 END