NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
datebf.F File Reference

Read the Section 1 date-time from the first data message of a BUFR file. More...

Go to the source code of this file.

Functions/Subroutines

subroutine datebf (LUNIT, MEAR, MMON, MDAY, MOUR, IDATE)
 This subroutine reads and returns the Section 1 date-time from the first data message of a BUFR file, bypassing any messages at the beginning of the file which may contain embedded DX BUFR table information. More...
 

Detailed Description

Read the Section 1 date-time from the first data message of a BUFR file.

Definition in file datebf.F.

Function/Subroutine Documentation

subroutine datebf (   LUNIT,
  MEAR,
  MMON,
  MDAY,
  MOUR,
  IDATE 
)

This subroutine reads and returns the Section 1 date-time from the first data message of a BUFR file, bypassing any messages at the beginning of the file which may contain embedded DX BUFR table information.

Author
J. Woollen
Date
1994-01-06
Parameters
[in]LUNIT- integer: Fortran logical unit number for BUFR file
[out]MEAR- integer: Year stored within Section 1 of first data message, in format of either YY or YYYY, depending on the most recent call to subroutine datelen()
[out]MMON- integer: Month stored within Section 1 of first data message
[out]MDAY- integer: Day stored within Section 1 of first data message
[out]MOUR- integer: Hour stored within Section 1 of first data message
[out]IDATE- integer: Date-time stored within Section 1 of first data message, in format of either YYMMDDHH or YYYYMMDDHH, depending on the most recent call to subroutine datelen()

Logical unit LUNIT must already be associated with a filename on the local system, typically via a Fortran "OPEN" statement.

Program history log:

  • 1994-01-06 J. Woollen – Original author
  • 1998-07-08 J. Woollen – Replaced call to Cray library routine ABORT with call to new internal routine bort()
  • 1998-08-31 J. Woollen – Modified to correct an error which led to MEAR being returned as 2-digit when it was requested as 4-digit via a prior call to datelen()
  • 1998-10-27 J. Woollen – Modified to correct problems caused by in-lining code with fpp directives
  • 2003-05-19 M. Shirey – Replaced calls to Fortran insrinsic function ICHAR with the NCEP W3LIB function MOVA2I
  • 2003-11-04 D. Keyser – Modified date calculations to no longer use floating point arithmetic
  • 2004-08-18 J. Ator – Modified 'BUFR' string test for portability to EBCDIC machines
  • 2004-12-20 D. Keyser – Calls wrdlen() to initialize local machine information, in case it has not yet been called
  • 2005-11-29 J. Ator – Use igetdate(), iupbs01() and rdmsgw()
  • 2009-03-23 J. Ator – Use idxmsg() and errwrt()
  • 2012-09-15 J. Woollen – Modified for C/I/O/BUFR interface; use new openbf type 'INX' to open and close the C file without closing the Fortran file
  • 2014-12-10 J. Ator – Use modules instead of COMMON blocks

Definition at line 60 of file datebf.F.

References bort(), closbf(), errwrt(), idxmsg(), igetdate(), openbf(), rdmsgw(), status(), and wrdlen().