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

Go to the source code of this file.

Functions/Subroutines

subroutine rewnbf (LUNIT, ISR)
 THIS SUBROUTINE, DEPENDING ON THE VALUE OF ISR, WILL EITHER: 1) 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 2) RESTORE THE BUFR FILE CONNECTED TO LUNIT TO THE PARAMETERS IT HAD PRIOR TO 1) ABOVE USING THE INFORMATION SAVED IN 1) ABOVE. More...
 

Detailed Description

Author
WOOLLEN
Date
2003-11-04

Definition in file rewnbf.f.

Function/Subroutine Documentation

subroutine rewnbf (   LUNIT,
  ISR 
)

THIS SUBROUTINE, DEPENDING ON THE VALUE OF ISR, WILL EITHER: 1) 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 2) RESTORE THE BUFR FILE CONNECTED TO LUNIT TO THE PARAMETERS IT HAD PRIOR TO 1) ABOVE USING THE INFORMATION SAVED IN 1) ABOVE.

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 A PARTICULAR BUFR FILE 1) ABOVE MUST PRECEDE 2) ABOVE. 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. ALSO, BUFR ARCHIVE LIBRARY SUBROUTINE UFBTAB WILL CALL THIS ROUTINE IF THE BUFR FILE IT IS ACTING UPON IS ALREADY OPEN FOR INPUT OR OUTPUT.

PROGRAM HISTORY LOG: 2003-11-04 J. WOOLLEN – ORIGINAL AUTHOR (WAS IN VERIFICATION VERSION BUT MAY HAVE BEEN IN THE PRODUCTION VERSION AT ONE TIME AND THEN REMOVED) 2003-11-04 D. KEYSER – UNIFIED/PORTABLE FOR WRF; ADDED DOCUMENTATION; OUTPUTS MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE TERMINATES ABNORMALLY 2004-08-09 J. ATOR – MAXIMUM MESSAGE LENGTH INCREASED FROM 20,000 TO 50,000 BYTES 2009-03-23 J. ATOR – MODIFIED TO HANDLE EMBEDDED BUFR TABLE (DICTIONARY) MESSAGES 2011-09-26 J. WOOLLEN – FIXED BUG TO PREVENT SKIP OF FIRST DATA MESSAGE AFTER REWIND 2012-09-15 J. WOOLLEN – MODIFIED FOR C/I/O/BUFR INTERFACE; REPLACE FORTRAN REWIND WITH C CEWIND 2014-12-10 J. ATOR – USE MODULES INSTEAD OF COMMON BLOCKS

USAGE: CALL REWNBF (LUNIT, ISR) INPUT ARGUMENT LIST: LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE ISR - INTEGER: SWITCH: 0 = store current parameters associated with BUFR file, set file status to read, 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

INPUT FILES: UNIT "LUNIT" - BUFR FILE

REMARKS: THIS ROUTINE CALLS: BORT I4DY READMG STATUS WTSTAT CEWIND THIS ROUTINE IS CALLED BY: UFBINX UFBTAB Also called by application programs.

Definition at line 64 of file rewnbf.f.

References bort(), cewind(), i4dy(), readmg(), status(), and wtstat().

Referenced by ufbinx(), and ufbtab().