NCEPLIBS-bufr  12.0.1
setvalnb.f File Reference

Write one data value to a data subset. More...

Go to the source code of this file.

Functions/Subroutines

recursive subroutine setvalnb (LUNIT, TAGPV, NTAGPV, TAGNB, NTAGNB, R8VAL, IRET)
 This subroutine can be used to write 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

Write one data value to a data subset.

Author
J. Ator
Date
2016-07-29

Definition in file setvalnb.f.

Function/Subroutine Documentation

◆ setvalnb()

recursive subroutine setvalnb (   LUNIT,
character*(*)  TAGPV,
  NTAGPV,
character*(*)  TAGNB,
  NTAGNB,
real*8  R8VAL,
  IRET 
)

This subroutine can be used to write 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 subroutine 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 stores the specified data value in the corresponding location within the subset.

Before calling this subroutine, a BUFR message should already be opened and initialized for output via a previous call to one of the BUFRLIB message-writing subroutines.

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 store R8VAL as 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.
[in]R8VAL– real*8: Value to be stored corresponding to (NTAGNB)th occurrence of TAGNB within the subset
[out]IRET– integer: return code
  • 0 = R8VAL was successfully stored
  • -1 = the (NTAGNB)th occurence of mnemonic TAGNB could not be found, or some other error occurred
Author
J. Ator
Date
2016-07-29

Definition at line 50 of file setvalnb.f.

References fstag(), modv_im8b::im8b, moda_msgcwd::inode, moda_usrint::inv, status(), moda_usrint::val, x48(), and x84().