NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
getvalnb.f File Reference

Read one data value from a data subset. More...

Go to the source code of this file.

Functions/Subroutines

REAL *8 function getvalnb (LUNIT, TAGPV, NTAGPV, TAGNB, NTAGNB)
 This function can be used to read a data value corresponding to a specific occurrence of a mnemonic within a data subset, based on its position relative to a different mnemonic within the subset. More...
 

Detailed Description

Read one data value from a data subset.

Definition in file getvalnb.f.

Function/Subroutine Documentation

REAL*8 function getvalnb (   LUNIT,
character*(*)  TAGPV,
  NTAGPV,
character*(*)  TAGNB,
  NTAGNB 
)

This function can be used to read a data value corresponding to a specific occurrence of a mnemonic within a data subset, based on its position relative to a different mnemonic within the subset.

The function first searches for a specific occurrence of a pivot mnemonic, counting from the beginning of the subset. From there, it then searches in either a forward or backward direction for a specific occurrence of a nearby mnemonic, and if found returns the data value from the corresponding location within the subset.

Author
J. Ator
Date
2012-09-12
Parameters
[in]LUNIT– integer: Fortran logical unit number for BUFR file
[in]TAGPV– character*(*): Pivot mnemonic; the subroutine will first search for the (NTAGPV)th occurrence of this mnemonic, counting from the beginning of the overall subset definition
[in]NTAGPV– integer: Ordinal occurrence of TAGPV to search for, counting from the beginning of the overall subset definition
[in]TAGNB– character*(*): Nearby mnemonic; assuming TAGPV is successfully found, the subroutine will then search nearby for the (NTAGNB)th occurrence of TAGNB and return the corresponding value
[in]NTAGNB– integer: Ordinal occurrence of TAGNB to search for, counting from the location of TAGPV within the overall subset definition. If NTAGNB is positive, the subroutine will search in a forward direction from the location of TAGPV; otherwise, if NTAGNB is negative, it will instead search in a backwards direction from the location of TAGPV.
Returns
getvalnb – real*8: Value corresponding to (NTAGNB)th occurrence of TAGNB. If for any reason this value cannot be located, then the current placeholder value for "missing" data will be returned instead.

The current placeholder value for "missing" data can be determined via a separate call to function getbmiss().

Before calling this function, a BUFR data subset should already be open for reading via a previous call to one of the BUFRLIB subset-reading subroutines.

Program history log:

Date Programmer Comments
2012-09-12 J. Ator Original author
2014-10-02 J. Ator Modified to use fstag()
2014-12-10 J. Ator Use modules instead of COMMON blocks

Definition at line 57 of file getvalnb.f.

References fstag(), and status().