NCEPLIBS-bufr  12.0.0
i4dy.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Convert a date-time with a 2-digit year to a date-time with
3 C> a 4-digit year
4 C>
5 C> @author J. Woollen @date 1998-07-08
6 
7 C> This function converts a date-time with a 2-digit year (YYMMDDHH)
8 C> to a date-time with a 4-digit year (YYYYMMDDHH) using a windowing
9 C> technique.
10 C>
11 C> All 2-digit years greater than 40 are assumed to have a 4-digit
12 C> year beginning with 19 (i.e. 1941-1999), and all 2-digit years less
13 C> than or equal to 40 are assumed to have a 4-digit year beginning
14 C> with 20 (i.e. 2000-2040). If the input date-time already contains
15 C> a 4-digit year, then the function simply returns that value.
16 C>
17 C> @param[in] IDATE -- integer: Date-time in format of either YYMMDDHH
18 C> (2-digit year) or YYYYMMDDHH (4-digit year)
19 C> @returns i4dy -- integer: Date-time in format of YYYYMMDDHH (4-digit
20 C> year)
21 C>
22 C> @author J. Woollen @date 1998-07-08
23  RECURSIVE FUNCTION i4dy(IDATE) RESULT(IRET)
24 
25  USE modv_im8b
26 
27 C----------------------------------------------------------------------
28 C----------------------------------------------------------------------
29 
30 C Check for I8 integers.
31 
32  IF(im8b) THEN
33  im8b=.false.
34 
35  CALL x84(idate,my_idate,1)
36  iret=i4dy(my_idate)
37 
38  im8b=.true.
39  RETURN
40  ENDIF
41 
42  IF(idate.LT.10**8) THEN
43  iy = idate/10**6
44  IF(iy.GT.40) THEN
45  iret = idate + 19*100000000
46  ELSE
47  iret = idate + 20*100000000
48  ENDIF
49  ELSE
50  iret = idate
51  ENDIF
52 
53  RETURN
54  END
recursive function i4dy(IDATE)
This function converts a date-time with a 2-digit year (YYMMDDHH) to a date-time with a 4-digit year ...
Definition: i4dy.f:24
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19