NCEPLIBS-bufr
12.1.0
|
Process mnemonic strings. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | parstr (str, tags, mtag, ntag, sep, limit80) |
Parse a string containing one or more substrings into an array of substrings. More... | |
subroutine | parusr (str, lun, i1, io) |
Initiate the process to parse out mnemonics from a user-specified character string, then separate them into store and condition nodes. More... | |
subroutine | parutg (lun, io, utg, nod, kon, val) |
Parse a mnemonic from a character string. More... | |
subroutine | strcln |
Reset the internal mnemonic string cache. More... | |
subroutine | string (str, lun, i1, io) |
Check whether a string is in the internal mnemonic string cache. More... | |
subroutine parstr | ( | character*(*), intent(in) | str, |
character*(*), dimension(mtag), intent(out) | tags, | ||
integer, intent(in) | mtag, | ||
integer, intent(out) | ntag, | ||
character, intent(in) | sep, | ||
logical, intent(in) | limit80 | ||
) |
Parse a string containing one or more substrings into an array of substrings.
The separator for the substrings is specified during input, and multiple adjacent occurrences of this character will be treated as a single occurrence when the string is actually parsed.
str | - String |
tags | - Array of substrings |
mtag | - Dimensioned size of tags within calling program; used by the subroutine to make sure it doesn't overflow the tags array |
ntag | - Number of substrings returned in tags |
sep | - Separator character for substrings |
limit80 | - .true. if an abort should occur when str is longer than 80 characters |
Definition at line 472 of file strings.F90.
References bort2().
Referenced by fdebufr_c(), fstag(), getcfmng(), getntbe(), gettbh(), parusr(), readlc(), seqsdx(), sntbbe(), sntbde(), sntbfe(), ufbseq(), ufbtab(), ufbtam(), and writlc().
subroutine parusr | ( | character*(*), intent(in) | str, |
integer, intent(in) | lun, | ||
integer, intent(in) | i1, | ||
integer, intent(in) | io | ||
) |
Initiate the process to parse out mnemonics from a user-specified character string, then separate them into store and condition nodes.
Information about the string mnemonics is stored in arrays in common block /usrstr/. Condition nodes are sorted in the order expected in the internal jump/link tables and several checks are performed on them.
str | - String of blank-separated mnemonics |
lun | - File ID |
i1 | - A number greater than or equal to the number of blank-separated mnemonics in str |
iO | - Status indicator for BUFR file associated with lun:
|
Definition at line 148 of file strings.F90.
References bort2(), parstr(), and parutg().
Referenced by string().
subroutine parutg | ( | integer, intent(in) | lun, |
integer, intent(in) | io, | ||
character*(*), intent(in) | utg, | ||
integer, intent(out) | nod, | ||
integer, intent(out) | kon, | ||
real, intent(out) | val | ||
) |
Parse a mnemonic from a character string.
Parse 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 moda_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():
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:
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:
lun | - File ID |
io | - Status indicator for BUFR file associated with lun:
|
utg | - User-supplied tag representing a value to be encoded/decoded to/from BUFR file |
nod | - Positional index in internal jump/link subset table for utg:
|
kon | - Indicator for type of condition character found in UTG:
|
val | - Condition value associated with condition character found in utg:
|
Definition at line 348 of file strings.F90.
References bort(), bort2(), moda_msgcwd::inode, moda_tables::isc, strnum(), moda_tables::tag, and moda_tables::typ.
subroutine strcln |
Reset the internal mnemonic string cache.
The string cache is a performance-enhancing feature which saves processing time when the same mnemonics are encountered repeatedly.
Definition at line 115 of file strings.F90.
Referenced by makestab().
subroutine string | ( | character*(*), intent(in) | str, |
integer, intent(in) | lun, | ||
integer, intent(in) | i1, | ||
integer, intent(in) | io | ||
) |
Check whether a string is in the internal mnemonic string cache.
Check to see if a user-specified character string is already in the internal cache (arrays in common blocks /stcach/ and /stords/). If not, then call subroutine parusr() to perform the task of separating and checking the individual mnemonics so that they can then be added to the cache.
The mnemonic string cache is a performance enhancing device which saves time when the same mnemonic strings are repeatedly encountered within an application program.
str | - String of blank-separated mnemonics |
lun | - File ID |
i1 | - A number greater than or equal to the number of blank-separated mnemonics in str |
io | - Status indicator for BUFR file associated with lun:
|
Definition at line 24 of file strings.F90.
References bort2(), moda_msgcwd::inode, and parusr().
Referenced by ufbevn(), ufbget(), ufbin3(), ufbint(), ufbovr(), ufbrep(), ufbstp(), ufbtab(), and ufbtam().