NCEPLIBS-bufr  12.0.0
parutg.f File Reference

Parse a mnemonic from a character string. More...

Go to the source code of this file.

Functions/Subroutines

subroutine parutg (LUN, IO, UTG, NOD, KON, VAL)
 Parse a mnemonic from a character string. More...
 

Detailed Description

Parse a mnemonic from a character string.

Author
Woollen
Date
1994-01-06

Definition in file parutg.f.

Function/Subroutine Documentation

◆ parutg()

subroutine parutg (   LUN,
  IO,
character*(*)  UTG,
  NOD,
  KON,
  VAL 
)

Parse a mnemonic from a character string.

This subroutine parses a user-specified tag (mnemonic) (UTG) that represents a value either being decoded from a bufr file (if it is being read) or encoded into a bufr file (if it is being written). This subroutine first checks to see if the tag contains a condition character ('=', '!', '<', '>', '^' or '#'). If it does not, nothing happens at this point. If it does, then the type of condition character is noted and the tag is stripped of all characters at and beyond the condition character. In either event, the resultant tag is checked against those in the internal jump/ link subset table (in module tables). If found, the node associated with the tag is returned (and it is either a "condition" node or a "store" node depending of the presence or absence of a condition character in UTG). Otherwise the node is returned as zero. if the tag represents a condition node, then the condition value (numeric characters beyond the condition character in the user-specified tag input here) is returned.

As an example of condition character usage, consider the following example of a call to ufbint():

real*8 usr(4,50)
....
....
CALL ufbint(lunin,usr,4,50,iret,'PRLC<50000 TMDB WDIR WSPD')
recursive subroutine ufbint(LUNIN, USR, I1, I2, IRET, STR)
Read/write one or more data values from/to a data subset.
Definition: ufbint.f:121

Assuming that LUNIN points to a BUFR file open for input (reading), then the USR array now contains IRET levels of data (up to a maximum of 50) where the value of PRLC is/was less than 50000, along with the corresponding values for TMDB, WDIR and WSPD at those levels.

As another example, consider the following example of a call to readlc() for a long character string:

CHARACTER*200 LCHR
....
....
CALL READLC(LUNIN,LCHR,'NUMID#3')

Assuming that LUNIN points to a BUFR file open for input (reading), then the LCHR string now contains the value corresponding to the third occurrence of NUMID within the current subset.

Valid condition codes include:

  • '<' - less than
  • '>' - greater than
  • '=' - equal to
  • '!' - not equal to
  • '#' - ordinal identifier for a particular occurrence of a long character string
Parameters
[in]LUN- integer: File ID.
[in]IO- integer: status indicator for BUFR file associated with LUN:
  • 0 input file
  • 1 output file
[in]UTGcharacter*(*): user-supplied tag representing a value to be encoded/decoded to/from BUFR file.
[out]NOD- integer: positional index in internal jump/link subset table for TAG.
  • 0 TAG not found in table
[out]KON- integer: indicator for type of condition character found in UTG:
  • 0 no condition character found (NOD is a store node)
  • 1 character '=' found (NOD is a condition node)
  • 2 character '!' found (NOD is a condition node)
  • 3 character '<' found (NOD is a condition node)
  • 4 character '>' found (NOD is a condition node)
  • 5 character '^' found (NOD is a condition node; specifically, a "bump" node)
  • 6 character '#' found (NOD is a condition node)
[out]VAL- real: condition value associated with condition character found in utg:
  • 0 = UTG does not have a condition character
Author
Woollen
Date
1994-01-06

Definition at line 82 of file parutg.f.

References bort(), bort2(), moda_msgcwd::inode, moda_tables::isc, strnum(), moda_tables::tag, and moda_tables::typ.

Referenced by parusr(), readlc(), and writlc().