NCEPLIBS-bufr  11.7.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 C> <b>Program history log:</b>
30 C> | Date | Programmer | Comments |
31 C> | -----|------------|----------|
32 C> | 2005-11-29 | J. Ator | Original author |
33 C>
34  FUNCTION igetdate(MBAY,IYR,IMO,IDY,IHR)
35 
36  COMMON /dateln/ lendat
37 
38  dimension mbay(*)
39 
40 C-----------------------------------------------------------------------
41 C-----------------------------------------------------------------------
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:34
function iupbs01(MBAY, S01MNEM)
This function returns a specified value from within Section 0 or Section 1 of a BUFR message...
Definition: iupbs01.f:73