NCEPLIBS-bufr  12.0.0
rewnbf.f File Reference

Store or restore parameters associated with a BUFR file. More...

Go to the source code of this file.

Functions/Subroutines

subroutine rewnbf (LUNIT, ISR)
 This subroutine, depending on the value of ISR, will either: More...
 

Detailed Description

Store or restore parameters associated with a BUFR file.

Author
Woollen
Date
2003-11-04

Definition in file rewnbf.f.

Function/Subroutine Documentation

◆ rewnbf()

subroutine rewnbf (   LUNIT,
  ISR 
)

This subroutine, depending on the value of ISR, will either:

  • store the current parameters associated with a BUFR file connected to LUNIT (read/write pointers, etc.), set the file status to read, then rewind the BUFR file and position it such that the next BUFR message read will be the first message in the file containing actual subsets with data; or
  • restore the BUFR file connected to LUNIT to the parameters it had prior to the previous call, and using the information that was saved previously

This allows information to be extracted from a particular subset in a BUFR file which is in the midst of being read from or written to by an application program. Note that, for any given BUFR file, a call to this subroutine with ISR = 0 must precede a call to this same subroutine with ISR = 1. An application program might first call this subroutine with ISR = 0, then call either BUFR archive library subroutine rdmgsb() or ufbinx() to get info from a subset, then call this routine again with ISR = 1 to restore the pointers in the BUFR file to their original location. For example, this subroutine is called internally by BUFR archive library subroutine ufbtab() whenever the BUFR file it is acting upon is already open for input or output.

Parameters
[in]LUNIT- integer: fortran logical unit number for BUFR file.
[in]ISR- integer: switch:
  • 0 store current parameters associated with BUFR file, set file status to read, and rewind file such that next message read is first message containing subset data
  • 1 restore BUFR file with parameters saved from the previous call to this routine with ISR = 0
Author
Woollen
Date
2003-11-04

Definition at line 37 of file rewnbf.f.

References bort(), i4dy(), moda_bitbuf::ibit, moda_msgcwd::idate, moda_msgcwd::inode, moda_bufrsr::jbay, moda_bufrsr::jbit, moda_bufrsr::jbyt, moda_bufrsr::jdat, moda_bufrsr::jill, moda_bufrsr::jimm, moda_bufrsr::jmsg, moda_bufrsr::jnod, moda_bufrsr::jsr, moda_bufrsr::jsub, moda_bufrsr::junn, moda_bufrsr::ksub, moda_bitbuf::mbay, moda_bitbuf::mbyt, moda_msgcwd::msub, moda_msgcwd::nmsg, moda_msgcwd::nsub, readmg(), status(), and wtstat().

Referenced by ufbinx(), and ufbtab().