NCEPLIBS-bufr  12.0.1
readmg.f File Reference

Read the next message from a BUFR file that was previously opened for reading. More...

Go to the source code of this file.

Functions/Subroutines

recursive subroutine readmg (LUNXX, SUBSET, JDATE, IRET)
 Reads the next BUFR message from logical unit ABS(LUNXX) into internal arrays. More...
 

Detailed Description

Read the next message from a BUFR file that was previously opened for reading.

Authors
J. Woollen, J. Ator
Date
1994-01-06

Definition in file readmg.f.

Function/Subroutine Documentation

◆ readmg()

recursive subroutine readmg (   LUNXX,
character*8  SUBSET,
  JDATE,
  IRET 
)

Reads the next BUFR message from logical unit ABS(LUNXX) into internal arrays.

Logical unit ABS(LUNXX) should have already been opened for input operations via a previous call to subroutine openbf().

Whenever this subroutine returns with IRET = 0, this indicates that a new BUFR message of type SUBSET and date-time JDATE was successfully read into internal arrays within the NCEPLIBS-bufr software, and from where it can then be easily manipulated or further parsed via a call to one of the subset-reading subroutines. Otherwise, if the subroutine returns with IRET = -1, then this indicates that there are no more BUFR messages (i.e. end-of-file) within the file connected to logical unit ABS(LUNXX).

Remarks
  • Any DX BUFR table messages encountered within ABS(LUNXX) will be automatically processed and stored internally, so a successful return from this subroutine will always result in a BUFR message containing actual data values within the internal arrays.
  • In prior versions of the NCEPLIBS-bufr software, an input value of LUNXX < 0 was an indicator to the subroutine to treat any read error from ABS(LUNXX) the same as an end-of-file condition. This option is no longer supported, but the capability to call this subroutine with LUNXX < 0 is itself still supported for backwards-compatibility with certain legacy application programs.
Parameters
[in]LUNXX– integer: Absolute value is Fortran logical unit number for BUFR file
[out]SUBSET– character*8: Table A mnemonic for type of BUFR message that was read (see DX BUFR Tables for further information about Table A mnemonics)
[out]JDATE– integer: Date-time stored within Section 1 of BUFR message that was read, in format of either YYMMDDHH or YYYYMMDDHH, depending on the most recent call to subroutine datelen()
[out]IRET– integer: return code
  • 0 = new BUFR message was successfully read into internal arrays.
  • -1 = there are no more BUFR messages in the file connected to logical unit ABS(LUNXX).
Authors
J. Woollen, J. Ator
Date
1994-01-06

Definition at line 51 of file readmg.f.

References bort(), cktaba(), errwrt(), moda_msgcwd::idate, idxmsg(), modv_im8b::im8b, moda_msgcwd::inode, moda_sc3bfr::isc3, moda_bitbuf::mbay, rdbfdx(), rdmsgw(), reads3(), status(), wtstat(), x48(), and x84().

Referenced by cmpbqm(), ireadmg(), rdmgsb(), readns(), rewnbf(), sinv(), ufbinx(), and ufbpos().