NCEPLIBS-bufr 11.7.1
igetdate.f
Go to the documentation of this file.
1C> @file
2C> @brief Read the date-time from Section 1 of a BUFR message.
3
4C> This function returns the date-time from within Section 1 of a
5C> BUFR message.
6C>
7C> <p>The function will work on any BUFR message encoded using BUFR
8C> edition 2, 3, or 4.
9C>
10C> @author J. Ator
11C> @date 2005-11-29
12C>
13C> @param[in] MBAY -- integer(*): BUFR message
14C> @param[out] IYR -- integer: Year stored within Section 1 of MBAY,
15C> in format of either YY or YYYY, depending on
16C> the most recent call to subroutine datelen()
17C> @param[out] IMO -- integer: Month stored within Section 1 of MBAY
18C> @param[out] IDY -- integer: Day stored within Section 1 of MBAY
19C> @param[out] IHR -- integer: Hour stored within Section 1 of MBAY
20C> @returns igetdate -- integer: Date-time stored within Section 1
21C> of MBAY, in format of either YYMMDDHH or
22C> YYYYMMDDHH, depending on the most
23C> recent call to subroutine datelen()
24C>
25C> @remarks
26C> - The start of the BUFR message (i.e. the string 'BUFR') must be
27C> aligned on the first 4 bytes of MBAY.
28C>
29C> <b>Program history log:</b>
30C> | Date | Programmer | Comments |
31C> | -----|------------|----------|
32C> | 2005-11-29 | J. Ator | Original author |
33C>
34 FUNCTION igetdate(MBAY,IYR,IMO,IDY,IHR)
35
36 COMMON /dateln/ lendat
37
38 dimension mbay(*)
39
40C-----------------------------------------------------------------------
41C-----------------------------------------------------------------------
42
43 iyr = iupbs01(mbay,'YEAR')
44 imo = iupbs01(mbay,'MNTH')
45 idy = iupbs01(mbay,'DAYS')
46 ihr = iupbs01(mbay,'HOUR')
47 IF(lendat.NE.10) THEN
48 iyr = mod(iyr,100)
49 ENDIF
50 igetdate = (iyr*1000000) + (imo*10000) + (idy*100) + ihr
51
52 RETURN
53 END
function igetdate(MBAY, IYR, IMO, IDY, IHR)
This function returns the date-time from within Section 1 of a BUFR message.
Definition: igetdate.f:35
function iupbs01(MBAY, S01MNEM)
This function returns a specified value from within Section 0 or Section 1 of a BUFR message.
Definition: iupbs01.f:74