NCEPLIBS-bufr
12.1.0
|
Read or write DX BUFR table information. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | dxinit (lun, ioi) |
Clear out the internal arrays (in module moda_tababd) holding the DX BUFR table, then optionally initialize the table with apriori Table B and D entries. More... | |
subroutine | dxmini (mbay, mbyt, mb4, mba, mbb, mbd) |
Initialize a DX BUFR tables (dictionary) message, writing all the preliminary information into Sections 0, 1, 3, 4. More... | |
subroutine | elemdx (card, lun) |
Decode the scale factor, reference value, bit width and units (i.e., the "elements") from a Table B mnemonic definition card that was previously read from a user-supplied DX BUFR table file in character format by subroutine rdusdx(). More... | |
integer function | idxmsg (mesg) |
Check whether a BUFR message contains DX BUFR tables information that was generated by the NCEPLIBS-bufr software. More... | |
integer function | igetntbi (lun, ctb) |
Get the next available index for storing an entry within a specified internal DX BUFR table. More... | |
recursive subroutine | nemdefs (lunit, nemo, celem, cunit, iret) |
Get the element name and units associated with a Table B descriptor. More... | |
subroutine | nemtba (lun, nemo, mtyp, msbt, inod) |
Get information about a Table A descriptor from the internal DX BUFR tables. More... | |
subroutine | nemtbax (lun, nemo, mtyp, msbt, inod) |
Get information about a Table A descriptor from the internal DX BUFR tables. More... | |
subroutine | nemtbb (lun, itab, unit, iscl, iref, ibit) |
Get information about a Table B descriptor from the internal DX BUFR tables. More... | |
subroutine | nemtbd (lun, itab, nseq, nems, irps, knts) |
Get information about a Table D descriptor from the internal DX BUFR tables. More... | |
subroutine | nenubd (nemo, numb, lun) |
Confirm that a mnemonic and FXY value haven't already been defined. More... | |
subroutine | pktdd (id, lun, idn, iret) |
Store information about a child mnemonic within the internal BUFR Table D. More... | |
subroutine | rdbfdx (lunit, lun) |
Beginning at the current file pointer location within lunit, read a complete DX BUFR table into internal memory arrays in module moda_tababd. More... | |
subroutine | rdusdx (lundx, lun) |
Read and parse a file containing a user-supplied DX BUFR table in character format, then store this information into internal arrays in module moda_tababd. More... | |
subroutine | readdx (lunit, lun, lundx) |
Initialize modules moda_tababd and moda_msgcwd with DX BUFR (dictionary) tables. More... | |
subroutine | rsvfvm (nem1, nem2) |
Process a "following value" mnemonic. More... | |
subroutine | seqsdx (card, lun) |
Decode the Table D sequence information from a mnemonic definition card that was previously read from a user-supplied DX BUFR table in character format by subroutine rdusdx(), then add this information to the already-existing entry for that mnemonic within the internal BUFR Table D arrays in module moda_tababd. More... | |
subroutine | stbfdx (lun, mesg) |
Copy a DX BUFR tables message into the internal memory arrays in module moda_tababd. More... | |
subroutine | stntbi (n, lun, numb, nemo, celsq) |
Store a new entry within internal BUFR Table B or D. More... | |
subroutine | stntbia (n, lun, numb, nemo, celsq) |
Store a new entry within internal BUFR Table A. More... | |
subroutine | uptdd (id, lun, ient, iret) |
Get the WMO bit-wise representation of the FXY value corresponding to a child mnemonic in a Table D sequence. More... | |
recursive subroutine | wrdxtb (lundx, lunot) |
Generate one or more BUFR messages from the DX BUFR tables information associated with a given BUFR file, then write out those messages to the same or possibly a different BUFR file. More... | |
subroutine | writdx (lunit, lun, lundx) |
Write DX BUFR table (dictionary) messages to the beginning of an output BUFR file in lunit. More... | |
subroutine dxinit | ( | integer, intent(in) | lun, |
integer, intent(in) | ioi | ||
) |
Clear out the internal arrays (in module moda_tababd) holding the DX BUFR table, then optionally initialize the table with apriori Table B and D entries.
lun | - File ID |
ioi | - Switch:
|
Definition at line 605 of file dxtable.F90.
References moda_tababd::idnb, moda_tababd::idnd, moda_tababd::mtab, moda_tababd::ntba, moda_tababd::ntbb, moda_tababd::ntbd, pktdd(), moda_tababd::taba, moda_tababd::tabb, and moda_tababd::tabd.
Referenced by cpbfdx(), rdbfdx(), rdmemm(), rdusdx(), readerme(), and reads3().
subroutine dxmini | ( | integer, dimension(*), intent(out) | mbay, |
integer, intent(out) | mbyt, | ||
integer, intent(out) | mb4, | ||
integer, intent(out) | mba, | ||
integer, intent(out) | mbb, | ||
integer, intent(out) | mbd | ||
) |
Initialize a DX BUFR tables (dictionary) message, writing all the preliminary information into Sections 0, 1, 3, 4.
Subroutine wrdxtb() will be called later to add this information into the message.
mbay | - BUFR message |
mbyt | - Length (in bytes) of mbay |
mb4 | - Byte number in message of first byte in Section 4 |
mba | - Byte number in message of fourth byte in Section 4 |
mbb | - Byte number in message of fifth byte in Section 4 |
mbd | - Byte number in message of sixth byte in Section 4 |
Definition at line 696 of file dxtable.F90.
References bort(), pkb(), and pkc().
Referenced by wrdxtb().
subroutine elemdx | ( | character*80, intent(in) | card, |
integer, intent(in) | lun | ||
) |
Decode the scale factor, reference value, bit width and units (i.e., the "elements") from a Table B mnemonic definition card that was previously read from a user-supplied DX BUFR table file in character format by subroutine rdusdx().
These decoded values are then added to the already-existing entry for that mnemonic within the internal BUFR Table B array tabb(*,lun) in module moda_tababd.
card | - Mnemonic definition card that was read from a user-supplied DX BUFR table |
lun | - File ID |
Definition at line 515 of file dxtable.F90.
References bort2(), capit(), jstnum(), nemtab(), and moda_tababd::tabb.
Referenced by bufr_c2f_interface::elemdx_c(), and rdusdx().
integer function idxmsg | ( | integer, dimension(*), intent(in) | mesg | ) |
Check whether a BUFR message contains DX BUFR tables information that was generated by the NCEPLIBS-bufr software.
mesg | - BUFR message |
Definition at line 1122 of file dxtable.F90.
References iupbs01().
Referenced by datebf(), dumpbf(), mesgbc(), mesgbf(), readerme(), readmg(), and ufbmem().
integer function igetntbi | ( | integer, intent(in) | lun, |
character, intent(in) | ctb | ||
) |
Get the next available index for storing an entry within a specified internal DX BUFR table.
lun | - File ID |
ctb | - Type of internal DX BUFR table for which to return the next available index:
|
Definition at line 1152 of file dxtable.F90.
References bort(), moda_tababd::ntba, moda_tababd::ntbb, and moda_tababd::ntbd.
Referenced by bufr_c2f_interface::igetntbi_c().
recursive subroutine nemdefs | ( | integer, intent(in) | lunit, |
character*(*), intent(in) | nemo, | ||
character*(*), intent(out) | celem, | ||
character*(*), intent(out) | cunit, | ||
integer, intent(out) | iret | ||
) |
Get the element name and units associated with a Table B descriptor.
Given a Table B mnemonic defined in the DX BUFR Tables associated with a BUFR file (or in the master BUFR tables, if the file was opened in subroutine openbf() with io = 'SEC3'), this subroutine returns the element name and units associated with that mnemonic.
lunit | - Fortran logical unit number for BUFR file |
nemo | - Mnemonic for Table B descriptor |
celem | - Element name associated with nemo |
cunit | - Units associated with nemo |
iret | - Return code
|
Logical unit lunit should have already been opened for input or output operations via a previous call to subroutine openbf().
Definition at line 1445 of file dxtable.F90.
References nemtab(), status(), moda_tababd::tabb, x48(), and x84().
Referenced by bufr_c2f_interface::nemdefs_c().
subroutine nemtba | ( | integer, intent(in) | lun, |
character*(*), intent(in) | nemo, | ||
integer, intent(out) | mtyp, | ||
integer, intent(out) | msbt, | ||
integer, intent(out) | inod | ||
) |
Get information about a Table A descriptor from the internal DX BUFR tables.
This subroutine is similar to subroutine nemtbax(), except that it calls subroutine bort() if the descriptor is not found in Table A, whereas nemtbax() will return an inod value of 0 in such cases.
lun | - File ID associated with DX BUFR tables |
nemo | - Mnemonic for Table A descriptor |
mtyp | - Message type corresponding to nemo |
msbt | - Message subtype corresponding to nemo |
inod | - Positional index of nemo within internal Table A, if found |
Definition at line 1246 of file dxtable.F90.
References bort(), and nemtbax().
Referenced by cmsgini(), copymg(), cpymem(), lcmgdf(), msgini(), openmb(), and openmg().
subroutine nemtbax | ( | integer, intent(in) | lun, |
character*(*), intent(in) | nemo, | ||
integer, intent(out) | mtyp, | ||
integer, intent(out) | msbt, | ||
integer, intent(out) | inod | ||
) |
Get information about a Table A descriptor from the internal DX BUFR tables.
This subroutine is similar to subroutine nemtba(), except it returns an inod value of 0 if the descriptor is not found in Table A, whereas nemtba() will call subroutine bort() in such cases.
lun | - File ID associated with DX BUFR tables |
nemo | - Mnemonic for Table A descriptor |
mtyp | - Message type corresponding to nemo |
msbt | - Message subtype corresponding to nemo |
inod | - Positional index of nemo within internal Table A, if found
|
Definition at line 1196 of file dxtable.F90.
References bort(), moda_tababd::idna, moda_tababd::mtab, moda_tababd::ntba, and moda_tababd::taba.
subroutine nemtbb | ( | integer, intent(in) | lun, |
integer, intent(in) | itab, | ||
character*24, intent(out) | unit, | ||
integer, intent(out) | iscl, | ||
integer, intent(out) | iref, | ||
integer, intent(out) | ibit | ||
) |
Get information about a Table B descriptor from the internal DX BUFR tables.
lun | - File ID |
itab | - Positional index of descriptor within internal Table B |
unit | - Units of descriptor |
iscl | - Scale factor of descriptor |
iref | - Reference value of descriptor |
ibit | - Bit width of descriptor |
Definition at line 1277 of file dxtable.F90.
References bort(), moda_tababd::idnb, moda_tababd::ntbb, strnum(), and moda_tababd::tabb.
Referenced by chekstab(), bufr_c2f_interface::nemtbb_c(), and tabent().
subroutine nemtbd | ( | integer, intent(in) | lun, |
integer, intent(in) | itab, | ||
integer, intent(out) | nseq, | ||
character*8, dimension(*), intent(out) | nems, | ||
integer, dimension(*), intent(out) | irps, | ||
integer, dimension(*), intent(out) | knts | ||
) |
Get information about a Table D descriptor from the internal DX BUFR tables.
lun | - File ID associated with DX BUFR tables |
itab | - Positional index of descriptor within internal Table D |
nseq | - Number of child mnemonics for descriptor |
nems | - Child mnemonics |
irps | - Array of values corresponding to nems
|
knts | - Array of values corresponding to nems
|
Definition at line 1345 of file dxtable.F90.
References bort(), moda_tababd::idnd, moda_tababd::ntbd, numtab(), rsvfvm(), moda_tababd::tabd, and uptdd().
Referenced by chekstab(), dxdump(), getabdb(), and tabsub().
subroutine nenubd | ( | character, intent(in) | nemo, |
character, intent(in) | numb, | ||
integer, intent(in) | lun | ||
) |
Confirm that a mnemonic and FXY value haven't already been defined.
Check a mnemonic and FXY value pair that were read from a user-supplied BUFR DX dictionary table in character format, in order to confirm that neither value has already been defined within internal BUFR table B or D (in module moda_tababd) for the given lun. If either value has already been defined for this lun, then an appropriate call is made to subroutine bort().
nemo | - Mnemonic |
numb | - FXY value associated with nemo |
lun | - File ID |
Definition at line 1513 of file dxtable.F90.
References bort(), moda_tababd::ntbb, moda_tababd::ntbd, moda_tababd::tabb, and moda_tababd::tabd.
subroutine pktdd | ( | integer, intent(in) | id, |
integer, intent(in) | lun, | ||
integer, intent(in) | idn, | ||
integer, intent(out) | iret | ||
) |
Store information about a child mnemonic within the internal BUFR Table D.
Store information about a child mnemonic within the internal BUFR table D entry (in module moda_tababd) for a table D sequence (parent) mnemonic when the child mnemonic is contained within the sequence represented by the parent mnemonic (as determined within seqsdx()).
id | - Positional index of parent mnemonic within internal BUFR table D array tabd(*,*) |
lun | - File ID |
idn | - WMO bit-wise representation of FXY value corresponding to child mnemonic
|
iret | - Total number of child mnemonics stored thus far (including idn) for the parent mnemonic given by tabd(id,lun)
|
Definition at line 1665 of file dxtable.F90.
References errwrt(), ipkm(), and moda_tababd::tabd.
Referenced by dxinit(), bufr_c2f_interface::pktdd_c(), seqsdx(), and stbfdx().
subroutine rdbfdx | ( | integer, intent(in) | lunit, |
integer, intent(in) | lun | ||
) |
Beginning at the current file pointer location within lunit, read a complete DX BUFR table into internal memory arrays in module moda_tababd.
A DX BUFR table consists of one or more consecutive DX BUFR messages.
This subroutine performs a function similar to rdusdx(), except that rdusdx() reads from a file containing a user-supplied DX BUFR table in character format. See rdusdx() for a description of the arrays that are filled in module moda_tababd.
This subroutine performs a function similar to cpdxmm(), except that cpdxmm() writes to the internal memory arrays in module moda_msgmem, for use with a file of BUFR messages that is being read and stored into internal memory via subroutine ufbmem().
lunit | - Fortran logical unit number for BUFR file |
lun | - File ID associated with lunit |
Definition at line 120 of file dxtable.F90.
References bort(), dxinit(), errwrt(), makestab(), moda_mgwa::mgwa, rdmsgw(), and stbfdx().
subroutine rdusdx | ( | integer, intent(in) | lundx, |
integer, intent(in) | lun | ||
) |
Read and parse a file containing a user-supplied DX BUFR table in character format, then store this information into internal arrays in module moda_tababd.
This subroutine performs a function similar to subroutine rdbfdx(), except that rdbfdx() reads the DX BUFR table directly from messages at the beginning of an input BUFR file.
lundx | - Fortran logical unit number for user-supplied DX BUFR table in character format |
lun | - File ID |
Definition at line 196 of file dxtable.F90.
References bort2(), dxinit(), elemdx(), moda_tababd::idna, makestab(), seqsdx(), stntbi(), and stntbia().
subroutine readdx | ( | integer, intent(in) | lunit, |
integer, intent(in) | lun, | ||
integer, intent(in) | lundx | ||
) |
Initialize modules moda_tababd and moda_msgcwd with DX BUFR (dictionary) tables.
These tables are needed to read, write, initialize or append a BUFR file.
The modules are initialized from either:
If the modules are initialized by the BUFR file indicated by lunit, then it must have been opened for input processing and positioned at a dictionary table message somewhere in the file.
Once initialzed, the dictionary arrays are associated with the BUFR file indicated by lunit, until the file is closed with closbf().
lunit | - Fortran logical unit number for BUFR file being read, written, initialized or appended |
lun | - file ID associated with LUNIT |
lundx | - Fortran logical unit number containing dictionary table information to be used in reading/writing from/to lunit (depending on the case); may be set equal to lunit if dictionary table information is already embedded in lunit (but only if lunit is being read) |
Definition at line 28 of file dxtable.F90.
References bort(), cpbfdx(), errwrt(), makestab(), rdbfdx(), rdusdx(), and status().
subroutine rsvfvm | ( | character*8, intent(inout) | nem1, |
character*8, intent(in) | nem2 | ||
) |
Process a "following value" mnemonic.
Step through the "following value" mnemonic nem1 and, for each "." character encountered (except for the initial one), overwrite it with the next corresponding character from nem2.
For example:
if, on input: nem1 = ".DTH...." nem2 = "MXTM " then, on output: nem1 = ".DTHMXTM"
nem1 | - Mnemonic
|
nem2 | - Mnemonic immediately following nem1 within DX BUFR table |
Definition at line 1794 of file dxtable.F90.
subroutine seqsdx | ( | character*80, intent(in) | card, |
integer, intent(in) | lun | ||
) |
Decode the Table D sequence information from a mnemonic definition card that was previously read from a user-supplied DX BUFR table in character format by subroutine rdusdx(), then add this information to the already-existing entry for that mnemonic within the internal BUFR Table D arrays in module moda_tababd.
card | - Mnemonic definition card that was read from a user-supplied DX BUFR table |
lun | - File ID |
Definition at line 332 of file dxtable.F90.
References bort2(), nemtab(), numtab(), parstr(), pktdd(), rsvfvm(), and strnum().
Referenced by rdusdx().
subroutine stbfdx | ( | integer, intent(in) | lun, |
integer, dimension(*), intent(in) | mesg | ||
) |
Copy a DX BUFR tables message into the internal memory arrays in module moda_tababd.
lun | - File ID |
mesg | - DX BUFR tables message |
Definition at line 989 of file dxtable.F90.
References bort(), capit(), getlens(), moda_tababd::idnb, moda_tababd::idnd, nenubd(), moda_tababd::ntbb, moda_tababd::ntbd, pktdd(), stntbia(), moda_tababd::taba, moda_tababd::tabb, moda_tababd::tabd, and upc().
Referenced by rdbfdx(), rdmemm(), and readerme().
subroutine stntbi | ( | integer, intent(in) | n, |
integer, intent(in) | lun, | ||
character*(*), intent(in) | numb, | ||
character*(*), intent(in) | nemo, | ||
character*(*), intent(in) | celsq | ||
) |
Store a new entry within internal BUFR Table B or D.
n | - Storage index into internal Table B or D |
lun | - File ID |
numb | - FXY number for new Table B or D entry |
nemo | - Mnemonic corresponding to numb |
celsq | - Element or sequence description corresponding to numb |
Definition at line 1620 of file dxtable.F90.
References moda_tababd::idnb, moda_tababd::idnd, nenubd(), moda_tababd::ntbb, moda_tababd::ntbd, moda_tababd::tabb, and moda_tababd::tabd.
Referenced by rdusdx(), and bufr_c2f_interface::stntbi_c().
subroutine stntbia | ( | integer, intent(in) | n, |
integer, intent(in) | lun, | ||
character*(*), intent(in) | numb, | ||
character*(*), intent(in) | nemo, | ||
character*(*), intent(in) | celsq | ||
) |
Store a new entry within internal BUFR Table A.
n | - Storage index into internal Table A |
lun | - File ID |
numb | - FXY number for new Table A entry |
nemo | - Mnemonic corresponding to numb |
celsq | - Sequence description corresponding to numb |
Definition at line 1559 of file dxtable.F90.
References bort(), moda_tababd::idna, moda_tababd::ntba, and moda_tababd::taba.
subroutine uptdd | ( | integer, intent(in) | id, |
integer, intent(in) | lun, | ||
integer, intent(in) | ient, | ||
integer, intent(out) | iret | ||
) |
Get the WMO bit-wise representation of the FXY value corresponding to a child mnemonic in a Table D sequence.
For a description of the WMO bit-wise representation of the FXY value, see ifxy().
id | - Positional index of parent mnemonic within internal BUFR Table D array tabd |
lun | - File ID |
ient | - Ordinal indicator of child mnemonic to return from within tabd(id,lun) sequence
|
iret | - Return value:
|
Definition at line 1740 of file dxtable.F90.
References bort(), and moda_tababd::tabd.
Referenced by nemtbd(), and bufr_c2f_interface::uptdd_c().
recursive subroutine wrdxtb | ( | integer, intent(in) | lundx, |
integer, intent(in) | lunot | ||
) |
Generate one or more BUFR messages from the DX BUFR tables information associated with a given BUFR file, then write out those messages to the same or possibly a different BUFR file.
Logical units lundx and lunot should have already been opened via previous calls to subroutine openbf(), and in particular logical unit lunot must have been opened for output operations. lundx and lunot may be the same if it is desired to append to lunot with DX BUFR messages generated from its own internal tables.
lundx | - Fortran logical unit number associated with DX BUFR table information to be written out |
lunot | - Fortran logical unit number of BUFR file to which messages are to be written |
Definition at line 849 of file dxtable.F90.
References adn30(), bort(), cpbfdx(), dxmini(), getlens(), iupb(), iupm(), moda_mgwa::mgwa, msgfull(), msgwrt(), moda_tababd::ntba, moda_tababd::ntbb, moda_tababd::ntbd, pkb(), pkc(), status(), moda_tababd::taba, moda_tababd::tabb, moda_tababd::tabd, and x84().
Referenced by apxdx(), makestab(), and writdx().
subroutine writdx | ( | integer, intent(in) | lunit, |
integer, intent(in) | lun, | ||
integer, intent(in) | lundx | ||
) |
Write DX BUFR table (dictionary) messages to the beginning of an output BUFR file in lunit.
The table messages are read from arrays in internal memory (module moda_tababd). An initial call to subroutine readdx() generates these internal arrays.
lunit | - Fortran logical unit number for BUFR file being written. |
lun | - File ID of open BUFR file. |
lundx | - Fortran logical unit number containing dictionary table information to be used (by readdx()) to create internal tables written to lunit; if set equal to lunit, this subroutine calls bort(). |
Definition at line 811 of file dxtable.F90.
References bort(), readdx(), and wrdxtb().
Referenced by openbf().