NCEPLIBS-bufr  12.0.1
ufbtab.f File Reference

Read one or more data values from every data subset in a BUFR file. More...

Go to the source code of this file.

Functions/Subroutines

recursive subroutine ufbtab (LUNIN, TAB, I1, I2, IRET, STR)
 This subroutine reads through every data subset in a BUFR file and returns one or more specified data values from each subset. More...
 

Detailed Description

Read one or more data values from every data subset in a BUFR file.

Author
J. Woollen
Date
1994-01-06

Definition in file ufbtab.f.

Function/Subroutine Documentation

◆ ufbtab()

recursive subroutine ufbtab (   LUNIN,
real*8, dimension(i1,i2)  TAB,
  I1,
  I2,
  IRET,
character*(*)  STR 
)

This subroutine reads through every data subset in a BUFR file and returns one or more specified data values from each subset.

This provides a useful way to scan the ranges of one or more specified data values across all of the data subsets within an entire BUFR file. It is similar to subroutine ufbtam(), except that ufbtam() works on data subsets within internal arrays.

It is the user's responsibility to ensure that TAB is dimensioned sufficiently large enough to accommodate the number of data values that are to be read from the BUFR file. Specifically, each row of TAB will contain the data values read from a different data subset, so the value I2 must be at least as large as the total number of data subsets in the BUFR file.

If logical unit ABS(LUNIN) has already been opened via a previous call to subroutine openbf(), then this subroutine will save the current file position, rewind the file to the beginning, read through the entire file, and then restore it to its previous file position. Otherwise, if logical unit ABS(LUNIN) has not already been opened via a previous call to subroutine openbf(), then this subroutine will open it via an internal call to subroutine openbf(), read through the entire file, and then close it via an internal call to subroutine closbf().

Remarks
  • If LUNIN < 0, the number of data subsets in the BUFR file will still be returned in IRET; however, STR will be ignored, and all of the values returned in TAB will contain the current placeholder value for "missing" data.
  • If any of the Table B mnemonics in STR are replicated within the data subset definition for the BUFR file, then this subroutine will only return the value corresponding to the first occurrence of each such mnemonic (counting from the beginning of the data subset definition) within the corresponding row of TAB.
  • There are a few additional special mnemonics that can be included within STR when calling this subroutine, and which in turn will result in special information being returned within the corresponding location in TAB:
    • IREC - returns the number of the BUFR message within the file pointed to by ABS(LUNIN) (counting from the beginning of the file) in which the current data subset resides
    • ISUB - returns the number of the current data subset within the BUFR message pointed to by IREC, counting from the beginning of the message
Parameters
[in]LUNIN– integer: Absolute value is Fortran logical unit number for BUFR file
[out]TAB– real*8(*,*): Data values
[in]I1– integer: First dimension of TAB as allocated within the calling program
[in]I2– integer: Second dimension of TAB as allocated within the calling program
[out]IRET– integer: Number of data subsets in BUFR file
[in]STR– character*(*): String of blank-separated Table B mnemonics, in one-to-one correspondence with the number of data values that will be read from each data subset within the first dimension of TAB (see DX BUFR Tables for further information about Table B mnemonics)
Author
J. Woollen
Date
1994-01-06

Definition at line 71 of file ufbtab.f.

References modv_bmiss::bmiss, bort(), closbf(), errwrt(), moda_bitbuf::ibit, moda_tables::ibt, modv_im8b::im8b, moda_usrint::inv, ireadmg(), ireadsb(), moda_tables::itp, moda_bitbuf::mbay, moda_bitbuf::mbyt, moda_unptyp::msgunp, moda_msgcwd::msub, moda_msgcwd::nmsg, nmsub(), moda_msgcwd::nsub, moda_usrint::nval, openbf(), parstr(), rewnbf(), status(), string(), up8(), upb(), upb8(), upc(), ups(), usrtpl(), x48(), and x84().

Referenced by sinv().