NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
i4dy.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1998-07-08
3 
4 C> THIS FUNCTION CONVERTS AN EIGHT DIGIT INTEGER DATE
5 C> (YYMMDDHH) TO TEN DIGITS (YYYYMMDDHH) USING THE Y2K "WINDOWING"
6 C> TECHNIQUE. ALL TWO-DIGIT YEARS GREATER THAN "40" ARE ASSUMED TO
7 C> HAVE A FOUR-DIGIT YEAR BEGINNING WITH "19" (1941-1999) AND ALL TWO-
8 C> DIGIT YEARS LESS THAN OR EQUAL TO "40" ARE ASSUMED TO HAVE A FOUR-
9 C> DIGIT YEAR BEGINNING WITH "20" (2000-2040). IF THE INPUT DATE IS
10 C> ALREADY TEN DIGITS, THIS ROUTINE JUST RETURNS ITS VALUE.
11 C>
12 C> PROGRAM HISTORY LOG:
13 C> 1998-07-08 J. WOOLLEN -- ORIGINAL AUTHOR
14 C> 1998-11-24 J. WOOLLEN -- MODIFIED TO CONFORM TO THE NCEP 2-DIGIT
15 C> YEAR TIME WINDOW OF 1921-2020 (BUT
16 C> INADVERTENTLY SET TO 1911-2010)
17 C> 1998-12-14 J. WOOLLEN -- MODIFIED TO USE 20 AS THE 2-DIGIT YEAR FOR
18 C> WINDOWING TO A 4-DIGIT YEAR (00-20 ==> ADD
19 C> 2000; 21-99 ==> ADD 1900), THIS WINDOWING
20 C> TECHNIQUE WAS INADVERTENTLY CHANGED TO 10
21 C> IN THE PREVIOUS IMPLEMENTATION OF I4DY
22 C> (1998-11-24)
23 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
24 C> INTERDEPENDENCIES
25 C> 2003-11-04 D. KEYSER -- MODIFIED DATE CALCULATIONS TO NO LONGER USE
26 C> FLOATING POINT ARITHMETIC SINCE THIS CAN
27 C> LEAD TO ROUND OFF ERROR AND AN IMPROPER
28 C> RESULTING DATE ON SOME MACHINES (E.G.,
29 C> NCEP IBM FROST/SNOW), INCREASES
30 C> PORTABILITY; UNIFIED/PORTABLE FOR WRF;
31 C> ADDED DOCUMENTATION (INCLUDING HISTORY)
32 C> 2018-06-29 J. ATOR -- CHANGED 2-DIGIT->4-DIGIT YEAR WINDOW RANGE
33 C> TO (00-40 ==> ADD 2000; 41-99 ==> ADD 1900)
34 C>
35 C> USAGE: I4DY (IDATE)
36 C> INPUT ARGUMENT LIST:
37 C> IDATE - INTEGER: DATE (EITHER YYMMDDHH OR YYYYMMDDHH),
38 C> DEPENDING ON DATELEN() VALUE
39 C>
40 C> OUTPUT ARGUMENT LIST:
41 C> I4DY - INTEGER: DATE (YYYYMMDDHH)
42 C>
43 C> REMARKS:
44 C> THIS ROUTINE CALLS: None
45 C> THIS ROUTINE IS CALLED BY: CKTABA CMSGINI DATEBF DUMPBF
46 C> IUPBS01 OPENMB OPENMG REWNBF
47 C> Also called by application programs.
48 C>
49  FUNCTION i4dy(IDATE)
50 
51 
52 
53  IF(idate.LT.10**8) THEN
54  iy = idate/10**6
55  IF(iy.GT.40) THEN
56  i4dy = idate + 19*100000000
57  ELSE
58  i4dy = idate + 20*100000000
59  ENDIF
60  ELSE
61  i4dy = idate
62  ENDIF
63 
64  RETURN
65  END
function i4dy(IDATE)
THIS FUNCTION CONVERTS AN EIGHT DIGIT INTEGER DATE (YYMMDDHH) TO TEN DIGITS (YYYYMMDDHH) USING THE Y2...
Definition: i4dy.f:49