NCEPLIBS-bufr  12.0.1
mesgbc.f File Reference

Get information about a BUFR message. More...

Go to the source code of this file.

Functions/Subroutines

recursive subroutine mesgbc (LUNIN, MESGTYP, ICOMP)
 This subroutine examines a BUFR message and returns both the message type (from Section 1) and message compression indicator (from Section 3). More...
 

Detailed Description

Get information about a BUFR message.

Definition in file mesgbc.f.

Function/Subroutine Documentation

◆ mesgbc()

recursive subroutine mesgbc (   LUNIN,
  MESGTYP,
  ICOMP 
)

This subroutine examines a BUFR message and returns both the message type (from Section 1) and message compression indicator (from Section 3).

Author
D. Keyser
Date
2003-11-04

The message to be examined is obtained in one of two different ways, depending on the sign of LUNIN:

  • If LUNIN > 0, the subroutine reads and examines Section 1 of each message in a BUFR file starting from the beginning of the file, and continuing until it reaches the first message which actually contains report data. This means it will skip any messages containing DX BUFR table information, as well as any "dummy" messages containing the dump center time or dump initiation time within NCEP dump files. It then returns the message type and compression indicator from the first message containing report data. When used this way, the BUFR file in question should not have already been opened via a call to subroutine openbf(), though it should already be associated with Fortran logical unit number LUNIN. In this situation, the subroutine is similar to subroutine mesgbf(), except that mesgbf() doesn't skip past any "dummy" messages within NCEP dump files, nor does it return a compression indicator.
  • If LUNIN < 0, the subroutine simply returns the message type and compression indicator for the BUFR message currently stored in the internal arrays via the most recent call to one of the message-reading subroutines for Fortran logical unit number ABS(LUNIN).
Parameters
[in]LUNIN– integer: Absolute value is Fortran logical unit number for BUFR file
[out]MESGTYP– integer: Message type
  • When LUNIN > 0, a MESGTYP value of -256 means that there was an error reading the BUFR file, or that no messages were read from the file. Otherwise, any other MESGTYP value < 0 means that none of the messages in the BUFR file contained any report data.
[out]ICOMP– integer: Message compression indicator
  • -3 = BUFR file does not exist
  • -2 = none of the messages in the BUFR file contained any report data
  • -1 = error reading the BUFR file
  • 0 = message is not compressed
  • 1 = message is compressed
Author
D. Keyser
Date
2003-11-04

Definition at line 50 of file mesgbc.f.

References closbf(), idxmsg(), modv_im8b::im8b, iupbs01(), iupbs3(), moda_bitbuf::mbay, moda_mgwa::mgwa, openbf(), rdmsgw(), status(), x48(), and x84().

Referenced by copysb().