NCEPLIBS-bufr
12.1.0
|
Read or write master table information. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | codflg (cf) |
Specify whether or not code and flag table information should be included during all future reads of master BUFR tables. More... | |
subroutine | getntbe (lunt, ifxyn, line, iret) |
Read the first line of the next entry from the specified ASCII master table B, table D or table F (Code/Flag) file. More... | |
subroutine | gettbh (luns, lunl, tab, imt, imtv, iogce, iltv) |
Read the header lines from two separate ASCII files (one standard and one local) containing master table B, table D, or Code/Flag table information. More... | |
integer function | igetntbl (lunt, line) |
Read the next line from an ASCII master table B, table D or Code/Flag table file, ignoring any blank lines or comment lines in the process. More... | |
integer function | igettdi (iflag) |
Depending on the value of the input flag, either return the next usable scratch Table D index for the current master table, or else reset the index back to its minimum value. More... | |
integer function | ireadmt (lun) |
Check the most recent BUFR message that was read via a call to one of the message-reading subroutines and determine whether the appropriate corresponding BUFR master tables have already been read into internal memory. More... | |
subroutine | mtfnam (imt, imtv, iogce, imtvl, tbltyp, stdfil, locfil) |
Based on the input arguments, determine the names of the corresponding standard and local master table files. More... | |
recursive subroutine | mtinfo (cmtdir, lunmt1, lunmt2) |
Specify the directory location and Fortran logical unit numbers to be used when reading master BUFR tables on the local file system. More... | |
integer function | nemock (nemo) |
Check a mnemonic for validity. More... | |
subroutine | rdmtbb (lunstb, lunltb, mxmtbb, imt, imtv, iogce, iltv, nmtbb, imfxyn, cmscl, cmsref, cmbw, cmunit, cmmnem, cmdsc, cmelem) |
Read master Table B information from two separate ASCII files (one standard and one local) and then merge the output into a single set of arrays. More... | |
subroutine | rdmtbd (lunstd, lunltd, mxmtbd, mxelem, imt, imtv, iogce, iltv, nmtbd, imfxyn, cmmnem, cmdsc, cmseq, nmelem, iefxyn, ceelem) |
Read master Table D information from two separate ASCII files (one standard and one local) and then merge the output into a single set of arrays. More... | |
subroutine | rdmtbf (lunstf, lunltf) |
Read master Code/Flag table information from two separate ASCII files (one standard and one local) and then merge the output into a single set of arrays. More... | |
subroutine | sntbbe (ifxyn, line, mxmtbb, nmtbb, imfxyn, cmscl, cmsref, cmbw, cmunit, cmmnem, cmdsc, cmelem) |
Store an entry that was previously read from an ASCII master Table B file into a set of merged Fortran arrays. More... | |
subroutine | sntbde (lunt, ifxyn, line, mxmtbd, mxelem, nmtbd, imfxyn, cmmnem, cmdsc, cmseq, nmelem, iefxyn, ceelem) |
Store the first line of an entry that was previously read from an ASCII master Table D file into a set of merged Fortran arrays, then read and store all remaining lines of that same entry into the same merged Fortran arrays. More... | |
subroutine | sntbestr (hestr, ifxyn, estr) |
Generate an error-reporting string containing an FXY number. More... | |
subroutine | sntbfe (lunt, ifxyn) |
Read an entire entry from a previously-opened ASCII master Code/Flag table file, then store the information into an internal memory structure. More... | |
subroutine codflg | ( | character, intent(in) | cf | ) |
Specify whether or not code and flag table information should be included during all future reads of master BUFR tables.
cf | - Flag indicating whether or not to include code and flag table information during all future reads of master BUFR tables:
|
See Master BUFR Tables for more information about master BUFR tables. In particlar, note that Table B and Table D files are always read whenever master BUFR tables are being used, but the reading of Code/Flag table files is optional and should only be included if the user intends to make one or more future calls to subroutine getcfmng(); otherwise, the reading of Code/Flag table files will result in the unnecessary use of memory and other system resources.
If Code/Flag tables are to be read and used, they must reside in the same directory as the master Table B and Table D files on the local filesystem, as specified within a separate call to subroutine mtinfo().
The specified value for cf will remain in effect for all future reads of master BUFR tables, unless a subsequent call is made to this subroutine to reset the value of cf again. If this subroutine is never called, a default value of 'N' is used for cf.
Definition at line 1208 of file mastertable.F90.
References bort(), capit(), and moda_tablef::cdmf.
Referenced by fdebufr_c(), and sinv().
subroutine getntbe | ( | integer, intent(in) | lunt, |
integer, intent(out) | ifxyn, | ||
character*(*), intent(out) | line, | ||
integer, intent(out) | iret | ||
) |
Read the first line of the next entry from the specified ASCII master table B, table D or table F (Code/Flag) file.
This line contains, among other things, the FXY number corresponding to this entry.
lunt | - Fortran logical unit number of master table B, table D or Code/Flag table file |
ifxyn | - WMO bit-wise representation of FXY number for next table entry |
line | - First line of next table entry |
iret | - Return code
|
Definition at line 1147 of file mastertable.F90.
subroutine gettbh | ( | integer, intent(in) | luns, |
integer, intent(in) | lunl, | ||
character, intent(in) | tab, | ||
integer, intent(out) | imt, | ||
integer, intent(out) | imtv, | ||
integer, intent(out) | iogce, | ||
integer, intent(out) | iltv | ||
) |
Read the header lines from two separate ASCII files (one standard and one local) containing master table B, table D, or Code/Flag table information.
luns | - Fortran logical unit number for ASCII file containing standard table information |
lunl | - Fortran logical unit number for ASCII file containing local table information |
tab | - Type of table:
|
imt | - Master table
|
imtv | - Version number of master table
|
iogce | - Originating center
|
iltv | - Version number of local table
|
Definition at line 1071 of file mastertable.F90.
integer function igetntbl | ( | integer, intent(in) | lunt, |
character*(*), intent(out) | line | ||
) |
Read the next line from an ASCII master table B, table D or Code/Flag table file, ignoring any blank lines or comment lines in the process.
lunt | - Fortran logical unit number for ASCII file containing table information |
line | - Next non-blank, non-comment line that was read from lunt |
Definition at line 992 of file mastertable.F90.
integer function igettdi | ( | integer, intent(in) | iflag | ) |
Depending on the value of the input flag, either return the next usable scratch Table D index for the current master table, or else reset the index back to its minimum value.
iflag | - Flag:
|
Definition at line 1027 of file mastertable.F90.
References bort().
Referenced by bufr_c2f_interface::igettdi_c().
integer function ireadmt | ( | integer, intent(in) | lun | ) |
Check the most recent BUFR message that was read via a call to one of the message-reading subroutines and determine whether the appropriate corresponding BUFR master tables have already been read into internal memory.
If not, then open the appropriate master BUFR tables on the local file system and read the contents into internal memory, clearing any previous master BUFR table information that may have previously been stored there.
lun | - File ID |
Information about the location of master BUFR tables on the local file system is obtained from the most recent call to subroutine mtinfo(), or else from subroutine bfrini() if subroutine mtinfo() was never called, and in which case Fortran logical unit numbers 98 and 99 will be used by this function for opening and reading master BUFR table files.
Definition at line 177 of file mastertable.F90.
References bort2(), moda_mstabs::cbbw, moda_mstabs::cbelem, moda_mstabs::cbmnem, moda_mstabs::cbscl, moda_mstabs::cbsref, moda_mstabs::cbunit, moda_tablef::cdmf, moda_mstabs::cdmnem, moda_s3list::cds3, moda_mstabs::cdseq, moda_rdmtb::ceelem, moda_rdmtb::cmdscb, moda_rdmtb::cmdscd, errwrt(), moda_mstabs::ibfxyn, moda_mstabs::idefxy, moda_mstabs::idfxyn, moda_rdmtb::iefxyn, ifxy(), moda_sc3bfr::isc3, istdesc(), iupbs01(), moda_bitbuf::mbay, mtfnam(), moda_mstabs::ndelem, moda_mstabs::nmtb, moda_mstabs::nmtd, rdmtbb(), rdmtbd(), rdmtbf(), and upds3().
Referenced by getcfmng(), and ufdump().
subroutine mtfnam | ( | integer, intent(in) | imt, |
integer, intent(in) | imtv, | ||
integer, intent(in) | iogce, | ||
integer, intent(in) | imtvl, | ||
character*(*), intent(in) | tbltyp, | ||
character*(*), intent(out) | stdfil, | ||
character*(*), intent(out) | locfil | ||
) |
Based on the input arguments, determine the names of the corresponding standard and local master table files.
After determining the corresponding file names, this subroutine then confirms the existence of those files on the filesystem, using additional information obtained from the most recent call to subroutine mtinfo(), or else as defined within subroutine bfrini() if subroutine mtinfo() was never called.
imt | - Master table number |
imtv | - Master table version number |
iogce | - Originating center |
imtvl | - Local table version number |
tbltyp | - Table type:
|
stdfil | - Standard master table path/filename |
locfil | - Local master table path/filename |
Definition at line 86 of file mastertable.F90.
References bort2(), errwrt(), and strsuc().
Referenced by ireadmt().
recursive subroutine mtinfo | ( | character*(*), intent(in) | cmtdir, |
integer, intent(in) | lunmt1, | ||
integer, intent(in) | lunmt2 | ||
) |
Specify the directory location and Fortran logical unit numbers to be used when reading master BUFR tables on the local file system.
cmtdir | - Directory location of master BUFR tables on local file system (up to 240 characters) |
lunmt1 | - First Fortran logical unit number to use when reading master BUFR tables on local file system |
lunmt2 | - Second Fortran logical unit number to use when reading master BUFR tables on local file system |
See Master BUFR Tables for more information about master BUFR tables. In particular, note that this subroutine is normally only ever called after a prior call has been made to subroutine openbf() with io = 'SEC3'. But in such cases, any call to this subroutine must be made prior to any subsequent calls to any of the BUFR message-reading subroutines for the associated BUFR file; otherwise, default values for cmtdir, lunmt1 and lunmt2 will be used as defined within subroutine bfrini().
For cmtdir, any full or relative directory pathname that is legal on the local filesystem is permissible, up to a total maximum length of 240 characters. The library will then automatically search within this directory for any necessary master table files and open and read them as needed.
The logical unit numbers lunmt1 and lunmt2 should be distinct from each other but should not already be assigned to any files on the local system.
Definition at line 34 of file mastertable.F90.
References strsuc(), and x84().
Referenced by bfrini(), fdebufr_c(), bufr_c2f_interface::mtinfo_c(), and sinv().
integer function nemock | ( | character*(*), intent(in) | nemo | ) |
Check a mnemonic for validity.
For a mnemonic to be valid, it must have a length of between 1 and 8 characters, and it must only contain characters from the allowable character set.
nemo | - Mnemonic |
Definition at line 1240 of file mastertable.F90.
subroutine rdmtbb | ( | integer, intent(in) | lunstb, |
integer, intent(in) | lunltb, | ||
integer, intent(in) | mxmtbb, | ||
integer, intent(out) | imt, | ||
integer, intent(out) | imtv, | ||
integer, intent(out) | iogce, | ||
integer, intent(out) | iltv, | ||
integer, intent(out) | nmtbb, | ||
integer, dimension(*), intent(out) | imfxyn, | ||
character, dimension(4,*), intent(out) | cmscl, | ||
character, dimension(12,*), intent(out) | cmsref, | ||
character, dimension(4,*), intent(out) | cmbw, | ||
character, dimension(24,*), intent(out) | cmunit, | ||
character, dimension(8,*), intent(out) | cmmnem, | ||
character, dimension(*), intent(out) | cmdsc, | ||
character, dimension(120,*), intent(out) | cmelem | ||
) |
Read master Table B information from two separate ASCII files (one standard and one local) and then merge the output into a single set of arrays.
Each of the two ASCII files must already be individually sorted in ascending order with respect to the FXY numbers.
lunstb | - Fortran logical unit number for ASCII file containing standard Table B information |
lunltb | - Fortran logical unit number for ASCII file containing local Table B information |
mxmtbb | - Dimensioned size (in integers) of merged output arrays; used by the subroutine to ensure that it doesn't overflow these arrays |
imt | - Master table
|
imtv | - Version number of master table
|
iogce | - Originating center
|
iltv | - Version number of local table
|
nmtbb | - Number of entries in merged output arrays |
imfxyn | - Merged array containing WMO bit-wise representations of FXY numbers |
cmscl | - Merged array containing scale factors |
cmsref | - Merged array containing reference values |
cmbw | - Merged array containing bit widths |
cmunit | - Merged array containing units |
cmmnem | - Merged array containing mnemonics |
cmdsc | - Merged array containing descriptor codes |
cmelem | - Merged array containing element names |
Definition at line 370 of file mastertable.F90.
References bort(), getntbe(), gettbh(), and sntbbe().
Referenced by ireadmt().
subroutine rdmtbd | ( | integer, intent(in) | lunstd, |
integer, intent(in) | lunltd, | ||
integer, intent(in) | mxmtbd, | ||
integer, intent(in) | mxelem, | ||
integer, intent(out) | imt, | ||
integer, intent(out) | imtv, | ||
integer, intent(out) | iogce, | ||
integer, intent(out) | iltv, | ||
integer, intent(out) | nmtbd, | ||
integer, dimension(*), intent(out) | imfxyn, | ||
character, dimension(8,*), intent(out) | cmmnem, | ||
character, dimension(*), intent(out) | cmdsc, | ||
character, dimension(120,*), intent(out) | cmseq, | ||
integer, dimension(*), intent(out) | nmelem, | ||
integer, dimension(mxmtbd,mxelem), intent(out) | iefxyn, | ||
character, dimension(mxmtbd,mxelem), intent(out) | ceelem | ||
) |
Read master Table D information from two separate ASCII files (one standard and one local) and then merge the output into a single set of arrays.
Each of the two ASCII files must already be individually sorted in ascending order with respect to the FXY numbers.
lunstd | - Fortran logical unit number for ASCII file containing standard Table D information |
lunltd | - Fortran logical unit number for ASCII file containing local Table D information |
mxmtbd | - Dimensioned size (in integers) of merged output arrays; used by the subroutine to ensure that it doesn't overflow these arrays |
mxelem | - Maximum number of elements to be stored per Table D sequence within merged output arrays; used by the subroutine to ensure that it doesn't overflow these arrays |
imt | - Master table
|
imtv | - Version number of master table
|
iogce | - Originating center
|
iltv | - Version number of local table
|
nmtbd | - Number of entries in merged output arrays |
imfxyn | - Merged array containing WMO bit-wise representations of FXY numbers |
cmmnem | - Merged array containing mnemonics |
cmdsc | - Merged array containing descriptor codes |
cmseq | - Merged array containing sequence names |
nmelem | - Merged array containing number of elements stored for each sequence |
iefxyn | - Merged array containing WMO bit-wise representations of element FXY numbers |
ceelem | - Merged array containing element names |
Definition at line 448 of file mastertable.F90.
References bort(), getntbe(), gettbh(), and sntbde().
Referenced by ireadmt().
subroutine rdmtbf | ( | integer, intent(in) | lunstf, |
integer, intent(in) | lunltf | ||
) |
Read master Code/Flag table information from two separate ASCII files (one standard and one local) and then merge the output into a single set of arrays.
Each of the two ASCII files must already be individually sorted in ascending order with respect to the FXY numbers.
lunstf | - Fortran logical unit number for ASCII file containing standard Code/Flag table information |
lunltf | - Fortran logical unit number for ASCII file containing local Code/Flag table information |
Definition at line 507 of file mastertable.F90.
References bort(), getntbe(), gettbh(), and sntbfe().
Referenced by ireadmt().
subroutine sntbbe | ( | integer, intent(in) | ifxyn, |
character*(*), intent(in) | line, | ||
integer, intent(in) | mxmtbb, | ||
integer, intent(out) | nmtbb, | ||
integer, dimension(*), intent(out) | imfxyn, | ||
character, dimension(4,*), intent(out) | cmscl, | ||
character, dimension(12,*), intent(out) | cmsref, | ||
character, dimension(4,*), intent(out) | cmbw, | ||
character, dimension(24,*), intent(out) | cmunit, | ||
character, dimension(8,*), intent(out) | cmmnem, | ||
character, dimension(*), intent(out) | cmdsc, | ||
character, dimension(120,*), intent(out) | cmelem | ||
) |
Store an entry that was previously read from an ASCII master Table B file into a set of merged Fortran arrays.
ifxyn | - WMO bit-wise representation of FXY number |
line | - Table B entry |
mxmtbb | - Dimensioned size (in integers) of merged output arrays; used by the subroutine to ensure that it doesn't overflow these arrays |
nmtbb | - Number of entries in merged output arrays |
imfxyn | - Merged array containing WMO bit-wise representations of FXY numbers |
cmscl | - Merged array containing scale factors |
cmsref | - Merged array containing reference values |
cmbw | - Merged array containing bit widths |
cmunit | - Merged array containing units |
cmmnem | - Merged array containing mnemonics |
cmdsc | - Merged array containing descriptor codes |
cmelem | - Merged array containing element names |
Definition at line 579 of file mastertable.F90.
References bort(), bort2(), parstr(), and sntbestr().
Referenced by rdmtbb().
subroutine sntbde | ( | integer, intent(in) | lunt, |
integer, intent(in) | ifxyn, | ||
character*(*), intent(in) | line, | ||
integer, intent(in) | mxmtbd, | ||
integer, intent(in) | mxelem, | ||
integer, intent(out) | nmtbd, | ||
integer, dimension(*), intent(out) | imfxyn, | ||
character, dimension(8,*), intent(out) | cmmnem, | ||
character, dimension(*), intent(out) | cmdsc, | ||
character, dimension(120,*), intent(out) | cmseq, | ||
integer, dimension(*), intent(out) | nmelem, | ||
integer, dimension(mxmtbd,mxelem), intent(out) | iefxyn, | ||
character, dimension(mxmtbd,mxelem), intent(out) | ceelem | ||
) |
Store the first line of an entry that was previously read from an ASCII master Table D file into a set of merged Fortran arrays, then read and store all remaining lines of that same entry into the same merged Fortran arrays.
lunt | - Fortran logical unit number for ASCII file containing Table D information |
ifxyn | - WMO bit-wise representation of FXY number |
line | - First line of Table D entry |
mxmtbd | - Dimensioned size (in integers) of merged output arrays; used by the subroutine to ensure that it doesn't overflow these arrays |
mxelem | - Maximum number of elements to be stored per Table D sequence within merged output arrays; used by the subroutine to ensure that it doesn't overflow these arrays |
nmtbd | - Number of entries in merged output arrays |
imfxyn | - Merged array containing WMO bit-wise representations of FXY numbers |
cmmnem | - Merged array containing mnemonics |
cmdsc | - Merged array containing descriptor codes |
cmseq | - Merged array containing sequence names |
nmelem | - Merged array containing number of elements stored for each sequence |
iefxyn | - Merged array containing WMO bit-wise representations of element FXY numbers |
ceelem | - Merged array containing element names |
Definition at line 723 of file mastertable.F90.
References bort(), bort2(), parstr(), and sntbestr().
Referenced by rdmtbd().
subroutine sntbestr | ( | character*(*), intent(in) | hestr, |
integer, intent(in) | ifxyn, | ||
character*(*), intent(out) | estr | ||
) |
Generate an error-reporting string containing an FXY number.
hestr | - Head portion of error-reporting string |
ifxyn | - WMO bit-wise representation of FXY number |
estr | - Error-reporting string |
Definition at line 966 of file mastertable.F90.
subroutine sntbfe | ( | integer, intent(in) | lunt, |
integer, intent(in) | ifxyn | ||
) |
Read an entire entry from a previously-opened ASCII master Code/Flag table file, then store the information into an internal memory structure.
lunt | - Fortran logical unit number for ASCII file containing Code/Flag table information |
ifxyn | - WMO bit-wise representation of FXY number |
Definition at line 835 of file mastertable.F90.
References bort2(), parstr(), sntbestr(), and strnum().
Referenced by rdmtbf().