NCEPLIBS-bufr
11.6.0
|
Decode the meaning of a numerical value from a code or flag table. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | getcfmng (LUNIT, NEMOI, IVALI, NEMOD, IVALD, CMEANG, LNMNG, IRET) |
This subroutine searches for a specified Table B mnemonic and associated value (code figure or bit number) within the master Code/Flag tables, and if found returns the associated meaning as a character string. More... | |
Decode the meaning of a numerical value from a code or flag table.
Definition in file getcfmng.f.
subroutine getcfmng | ( | LUNIT, | |
character*(*) | NEMOI, | ||
IVALI, | |||
character*(*) | NEMOD, | ||
IVALD, | |||
character*(*) | CMEANG, | ||
LNMNG, | |||
IRET | |||
) |
This subroutine searches for a specified Table B mnemonic and associated value (code figure or bit number) within the master Code/Flag tables, and if found returns the associated meaning as a character string.
[in] | LUNIT | – integer: Fortran logical unit number for BUFR file |
[in] | NEMOI | – character*(*): Mnemonic to search for |
[in] | IVALI | – integer: Value (code figure or bit number) associated with NEMOI |
[in] | NEMOD | – character*(*): Optional second mnemonic upon which the values NEMOI and IVALI depend; set to all blank characters if the meanings of NEMOI and IVALI do not depend on the value of any other mnemonic |
[in] | IVALD | – integer: Value (code figure or bit number) associated with NEMOD; set to (-1) whenever NEMOD is set to all blank characters |
[out] | CMEANG | – character*(*): If the initial search of the master Code/Flag tables was successful, then this string contains the meaning corresponding to NEMOI and IVALI (and to NEMOD and IVALD, if specified). However, if the initial search was unsuccessful, and if no optional second mnemonic and associated value were specified on input, and if a second search of the table determines that the meaning of NEMOI and IVALI indeed depends on one or more other possible second mnemonics, then those possible second series of IRET successive 8-byte substrings. An example of this scenario is included below within the Remarks. |
[out] | LNMNG | – integer: Length (in bytes) of string returned in CMEANG |
[out] | IRET | – integer: return code
|
As noted above, this subroutine first does an initial search of the master Code/Flag tables based on the mnemonics and values provided. The input parameters NEMOI and IVALI specify the mnemonic and corresponding numerical code or flag table value for which the meaning is sought, and the optional secondary parameters NEMOD and IVALD are specified when needed to differentiate between multiple possible results. An example of this particular scenario is included below within the Remarks. Otherwise, if the meaning of NEMOD and IVALD does not depend on the value associated with any other mnemonic, then NEMOD should be set to a field of all blank characters, and IVALD should be set to a value of (-1).
Subroutine codflg() must be called with a CF value of 'Y' prior to calling this subroutine, in order to ensure that master Code/Flag tables have been read into internal memory.
This subroutine can be called at any time after a BUFR message has been read into internal arrays by one of the BUFRLIB message-reading subroutines, and it can be called for any code or flag table mnemonic defined within that particular message. In most cases, this means that the mnemonic must be contained within the subset definition (Section 3) of that message. The only exceptions to this rule are for originating centers, originating subcenters, data types and data subtypes, since those can also be contained within the identification section (Section 1) of a BUFR message.
It is the user's responsibility to provide sufficient allocated space in CMEANG for the returned meaning string; otherwise, the returned string will be truncated.
Program history log:
Date | Programmer | Comments |
---|---|---|
2018-01-11 | J. Ator | Original author |
2018-02-08 | J. Ator | Add special handling for data types and subtypes in Section 1 |
Definition at line 109 of file getcfmng.f.
References bort(), ifxy(), ireadmt(), nemtab(), numtbd(), parstr(), srchtbf(), and status().
Referenced by fdebufr().