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