NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
ufbmem.f File Reference

Connect a new system file to the BUFRLIB software, and read the entire file contents into internal arrays. More...

Go to the source code of this file.

Functions/Subroutines

subroutine ufbmem (LUNIT, INEW, IRET, IUNIT)
 This subroutine connects a new system file to the BUFRLIB software for input operations, then reads the entire file contents into internal arrays so that any of the individual BUFR messages can later be accessed from memory, instead of having to read them one at a time sequentially from the system file. More...
 

Detailed Description

Connect a new system file to the BUFRLIB software, and read the entire file contents into internal arrays.

Definition in file ufbmem.f.

Function/Subroutine Documentation

subroutine ufbmem (   LUNIT,
  INEW,
  IRET,
  IUNIT 
)

This subroutine connects a new system file to the BUFRLIB software for input operations, then reads the entire file contents into internal arrays so that any of the individual BUFR messages can later be accessed from memory, instead of having to read them one at a time sequentially from the system file.

Any embedded DX BUFR tables contained within the file are also read and processed into separate internal arrays for later use.

Author
J. Woollen
Date
1994-01-06
Parameters
[in]LUNIT- integer: Fortran logical unit number for BUFR file
[in]INEW- integer: Processing option
  • 0 = Initialize the internal arrays, then read all BUFR messages from LUNIT into internal arrays
  • Otherwise, read all BUFR messages from LUNIT and append them to the existing messages within the internal arrays
[out]IRET- integer: Number of BUFR messages that were read from LUNIT and stored into internal arrays
[out]IUNIT- integer: File status
  • 0 = LUNIT was empty, so no messages were read
  • Otherwise, the Fortran logical unit number to use for later access to any of the messages from the internal arrays

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

When INEW = 0, the output value IUNIT will be set equal to the input value LUNIT. Otherwise, the output value IUNIT will be set to the value of LUNIT that was input when this subroutine was previously called with INEW = 0, and the system file connected to LUNIT will be closed via an internal call to subroutine closbf() before exiting this subroutine. In either case, IUNIT can now be used to access all BUFR messages that were read and stored by all previous calls to this subroutine.

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()
  • 1999-11-18 J. Woollen – Increased MAXMEM from 4 Mb to 8 Mb
  • 2000-09-19 J. Woollen – Maximum message length increased from 10,000 to 20,000 bytes
  • 2001-08-15 D. Keyser – Increased MAXMEM from 8 Mb to 16 Mb
  • 2003-11-04 S. Bender – Added remarks and routine interdependencies
  • 2003-11-04 D. Keyser – Unified/portable for WRF; added history documentation; outputs more complete diagnostic info when routine terminates abnormally; increased MAXMSG from 50000 to 200000
  • 2004-08-09 J. Ator – Maximum message length increased from 20,000 to 50,000 bytes
  • 2004-11-15 D. Keyser – Don't abort when there are either MAXMSG or MAXMEM is exceeded; instead, just store up to MAXMSG messages or MAXMEM bytes and print a diagnostic
  • 2005-11-29 J. Ator – Use rdmsgw() and nmwrd()
  • 2009-03-23 J. Ator – Modified to handle embedded DX tables
  • 2012-09-15 J. Woollen – Modified for C/I/O/BUFR interface; call status() to get LUN; replace Fortran REWIND and BACKSPACE with C routines cewind() and backbufr()
  • 2014-12-10 J. Ator – Use modules instead of COMMON blocks
  • 2015-09-24 D. Stokes – Fix missing declaration of COMMON /QUIET/

Definition at line 76 of file ufbmem.f.

References backbufr(), bort(), cewind(), closbf(), cpdxmm(), errwrt(), idxmsg(), nmwrd(), openbf(), rdmsgw(), and status().