NCEPLIBS-bufr
12.1.0
|
Read and write data values within Sections 0, 1, and 3 of BUFR messages. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | cktaba (lun, subset, jdate, iret) |
Get the Table A mnemonic from Sections 1 and 3 of a BUFR message. More... | |
recursive subroutine | datebf (lunit, mear, mmon, mday, mour, idate) |
Get the Section 1 date-time from the first data message of a BUFR file, bypassing any messages at the beginning of the file which may contain embedded DX BUFR table information. More... | |
recursive subroutine | datelen (len) |
Specify the format of Section 1 date-time values that will be output by future calls to any of the NCEPLIBS-bufr message-reading subroutines. More... | |
recursive subroutine | dumpbf (lunit, jdate, jdump) |
Read the Section 1 date-time from the first two "dummy" messages of an NCEP dump file. More... | |
recursive subroutine | gets1loc (s1mnem, iben, isbyt, iwid, iret) |
Get the location of a specified value within Section 1 of a BUFR message. More... | |
recursive integer function | i4dy (idate) |
Convert a date-time with a 2-digit year (YYMMDDHH) to a date-time with a 4-digit year (YYYYMMDDHH) using a windowing technique. More... | |
recursive integer function | igetdate (mbay, iyr, imo, idy, ihr) |
Get the date-time from within Section 1 of a BUFR message. More... | |
recursive integer function | iupbs01 (mbay, s01mnem) |
Read a specified value from within Section 0 or Section 1 of a BUFR message. More... | |
recursive integer function | iupbs3 (mbay, s3mnem) |
Read a specified value from within Section 3 of a BUFR message. More... | |
recursive integer function | iupvs01 (lunit, s01mnem) |
Read a specified value from within Section 0 or 1 of a BUFR message. More... | |
recursive subroutine | mesgbc (lunin, mesgtyp, icomp) |
Return the message type (from Section 1) and message compression indicator (from Section 3) of a BUFR message. More... | |
recursive subroutine | mesgbf (lunit, mesgtyp) |
Read through a BUFR file (starting from the beginning of the file) and return the message type (from Section 1) of the first message encountered which does not contain DX BUFR table information. More... | |
recursive subroutine | minimg (lunit, mini) |
Write a minutes value into Section 1 of the BUFR message that was most recently opened for writing via a call to one of the message-writing subroutines for a specified Fortran logical unit. More... | |
recursive subroutine | pkbs1 (ival, mbay, s1mnem) |
Write a specified value into a specified location within Section 1 of a BUFR message, overwriting the value previously stored in that location. More... | |
recursive subroutine | pkvs01 (s01mnem, ival) |
Specify a value to be written into a specified location within Section 0 or Section 1 of all BUFR messages output by future calls to other message-writing subroutines and subset-writing subroutines. More... | |
subroutine | reads3 (lun) |
Read the Section 3 descriptors from the BUFR message in mbay(1,lun), then use the BUFR master tables to generate the necessary information for those descriptors within the internal BUFR table arrays. More... | |
recursive subroutine | upds3 (mbay, lcds3, cds3, nds3) |
Read the sequence of data descriptors contained within Section 3 of a BUFR message. More... | |
Read and write data values within Sections 0, 1, and 3 of BUFR messages.
Definition in file s013vals.F90.
subroutine cktaba | ( | integer, intent(in) | lun, |
character*8, intent(out) | subset, | ||
integer, intent(out) | jdate, | ||
integer, intent(out) | iret | ||
) |
Get the Table A mnemonic from Sections 1 and 3 of a BUFR message.
The BUFR message must have been previously read from lun using one of the message-reading subroutines.
lun | - File ID |
subset | - Table A mnemonic
|
jdate | - Date-time stored within Section 1 of BUFR, in format of either YYMMDDHH or YYYYMMDDHH depending on datelen() value |
iret | - Return code:
|
Definition at line 1271 of file s013vals.F90.
References bort(), errwrt(), getlens(), moda_msgcwd::idate, moda_msgcwd::inode, moda_sc3bfr::isc3, moda_bitbuf::mbay, moda_bitbuf::mbyt, moda_unptyp::msgunp, moda_msgcwd::msub, nemtbax(), moda_msgcwd::nmsg, moda_msgcwd::nsub, numtab(), openbt(), rdusdx(), and moda_sc3bfr::tamnem.
Referenced by rdmemm(), readerme(), and readmg().
recursive subroutine datebf | ( | integer, intent(in) | lunit, |
integer, intent(out) | mear, | ||
integer, intent(out) | mmon, | ||
integer, intent(out) | mday, | ||
integer, intent(out) | mour, | ||
integer, intent(out) | idate | ||
) |
Get the Section 1 date-time from the first data message of a BUFR file, bypassing any messages at the beginning of the file which may contain embedded DX BUFR table information.
lunit | - Fortran logical unit number for BUFR file |
mear | - Year stored within Section 1 of first data message, in format of either YY or YYYY, depending on the most recent call to subroutine datelen() |
mmon | - Month stored within Section 1 of first data message |
mday | - Day stored within Section 1 of first data message |
mour | - Hour stored within Section 1 of first data message |
idate | - Date-time stored within Section 1 of first data message, in format of either YYMMDDHH or YYYYMMDDHH, depending on the most recent call to subroutine datelen() -1 = First data message could not be found in BUFR file |
Logical unit lunit must already be associated with a filename on the local system, typically via a Fortran "OPEN" statement.
Definition at line 936 of file s013vals.F90.
References bort(), closbf(), errwrt(), idxmsg(), igetdate(), moda_mgwa::mgwa, openbf(), rdmsgw(), status(), x48(), and x84().
recursive subroutine datelen | ( | integer, intent(in) | len | ) |
Specify the format of Section 1 date-time values that will be output by future calls to any of the NCEPLIBS-bufr message-reading subroutines.
This subroutine can be called at any time from within the application program, and the specified value for len will remain in effect for all future calls to any of the NCEPLIBS-bufr subroutines which read BUFR messages, unless a subsequent call is made to this subroutine to reset the value of len again. If this subroutine is never called, a default value of 8 is used for len, as set within subroutine bfrini().
len | - Length of Section 1 date-time values to be output by all future calls to message-reading subroutines:
|
Definition at line 888 of file s013vals.F90.
Referenced by fdebufr_c(), and readbp().
recursive subroutine dumpbf | ( | integer, intent(in) | lunit, |
integer, dimension(*), intent(out) | jdate, | ||
integer, dimension(*), intent(out) | jdump | ||
) |
Read the Section 1 date-time from the first two "dummy" messages of an NCEP dump file.
This bypasses any messages at the beginning of the file which may contain embedded DX BUFR table information. Normally, the first of these two "dummy" messages contains the dump center date-time in Section 1, while the second message contains the dump initiation date-time in Section 1. Neither of these two "dummy" messages should contain any data subsets in Section 4.
Logical unit lunit must already be associated with a filename on the local system, typically via a Fortran "OPEN" statement.
If the subroutine fails to locate either of the two "dummy" messages within the file pointed to by lunit, then the corresponding jdate or jdump array will be filled with all values set to (-1).
lunit | - Fortran logical unit number for BUFR dump file |
jdate | - Dump center date-time stored within Section 1 of first "dummy" message:
|
jdump | - Dump initiation date-time stored within Section 1 of second "dummy" message:
|
Definition at line 1135 of file s013vals.F90.
References bort(), closbf(), errwrt(), idxmsg(), igetdate(), iupbs01(), iupbs3(), moda_mgwa::mgwa, openbf(), rdmsgw(), status(), x48(), and x84().
recursive subroutine gets1loc | ( | character*(*), intent(in) | s1mnem, |
integer, intent(in) | iben, | ||
integer, intent(out) | isbyt, | ||
integer, intent(out) | iwid, | ||
integer, intent(out) | iret | ||
) |
Get the location of a specified value within Section 1 of a BUFR message.
The location and availability of any particular value within Section 1 of a BUFR message can vary depending on the edition number used to encode the message. This subroutine will work for BUFR edition 2, 3, or 4.
s1mnem | - Value whose location within Section 1 is to be determined:
|
iben | - BUFR edition number |
isbyt | - Number of starting byte within Section 1 which contains value corresponding to s1mnem |
iwid | - Width (in bits) of value corresponding to s1mnem, counting from the first bit of the byte pointed to by isbyt |
iret | - Return code:
|
Definition at line 47 of file s013vals.F90.
recursive integer function i4dy | ( | integer, intent(in) | idate | ) |
Convert a date-time with a 2-digit year (YYMMDDHH) to a date-time with a 4-digit year (YYYYMMDDHH) using a windowing technique.
All 2-digit years greater than 40 are assumed to have a 4-digit year beginning with 19 (i.e. 1941-1999), and all 2-digit years less than or equal to 40 are assumed to have a 4-digit year beginning with 20 (i.e. 2000-2040). If the input date-time already contains a 4-digit year, then the function simply returns that value.
idate | - Date-time in format of either YYMMDDHH (2-digit year) or YYYYMMDDHH (4-digit year) |
Definition at line 1069 of file s013vals.F90.
References x84().
recursive integer function igetdate | ( | integer, dimension(*), intent(in) | mbay, |
integer, intent(out) | iyr, | ||
integer, intent(out) | imo, | ||
integer, intent(out) | idy, | ||
integer, intent(out) | ihr | ||
) |
Get the date-time from within Section 1 of a BUFR message.
The function will work on any BUFR message encoded using BUFR edition 2, 3, or 4.
mbay | - BUFR message |
iyr | - Year stored within Section 1 of mbay, in format of either YY or YYYY, depending on the most recent call to subroutine datelen() |
imo | - Month stored within Section 1 of mbay |
idy | - Day stored within Section 1 of mbay |
ihr | - Hour stored within Section 1 of mbay |
Definition at line 1021 of file s013vals.F90.
recursive integer function iupbs01 | ( | integer, dimension(*), intent(in) | mbay, |
character*(*), intent(in) | s01mnem | ||
) |
Read a specified value from within Section 0 or Section 1 of a BUFR message.
This function will work on any BUFR message encoded using BUFR edition 2, 3, or 4. It is similar to function iupvs01(), except that it operates on a BUFR message passed in via a memory array, whereas iupvs01() operates on the BUFR message that was read into internal arrays via the most recent call to any of the other message-reading subroutines for a specified Fortran logical unit.
mbay | - BUFR message |
s01mnem | - Value to be read from Section 0 or Section 1 of mbay
|
Definition at line 246 of file s013vals.F90.
References gets1loc(), i4dy(), and iupb().
Referenced by atrcpt(), cnved4(), copybf(), copymg(), cpymem(), dumpbf(), getlens(), idxmsg(), igetdate(), ireadmt(), bufr_c2f_interface::iupbs01_c(), iupvs01(), mesgbc(), mesgbf(), nmwrd(), pkbs1(), rtrcptb(), stndrd(), and ufbmex().
recursive integer function iupbs3 | ( | integer, dimension(*), intent(in) | mbay, |
character*(*), intent(in) | s3mnem | ||
) |
Read a specified value from within Section 3 of a BUFR message.
mbay | - BUFR message |
s3mnem | - Value to be read from Section 3 of mbay
|
Definition at line 348 of file s013vals.F90.
References getlens(), and iupb().
Referenced by dumpbf(), mesgbc(), readerme(), stndrd(), and writlc().
recursive integer function iupvs01 | ( | integer, intent(in) | lunit, |
character*(*), intent(in) | s01mnem | ||
) |
Read a specified value from within Section 0 or 1 of a BUFR message.
This function will work on any BUFR message encoded using BUFR edition 2, 3, or 4. It is similar to function iupbs01(), except that iupbs01() operates on a BUFR message passed in via a memory array, whereas this function operates on the BUFR message that was read into internal arrays via the most recent call to any of the other message-reading subroutines for a specified Fortran logical unit.
lunit | - Fortran logical unit number for BUFR file |
s01mnem | - Value to be read from Section 0 or Section 1 of BUFR message in internal arrays for lunit:
|
Definition at line 442 of file s013vals.F90.
References bort(), iupbs01(), moda_bitbuf::mbay, status(), and x84().
Referenced by binv(), and split_by_subset().
recursive subroutine mesgbc | ( | integer, intent(in) | lunin, |
integer, intent(out) | mesgtyp, | ||
integer, intent(out) | icomp | ||
) |
Return the message type (from Section 1) and message compression indicator (from Section 3) of a BUFR message.
The message to be examined is obtained in one of two different ways, depending on the sign of lunin:
lunin | - Absolute value is Fortran logical unit number for BUFR file |
mesgtyp | - Message type
|
icomp | - Message compression indicator
|
Definition at line 1481 of file s013vals.F90.
References closbf(), idxmsg(), iupbs01(), iupbs3(), moda_bitbuf::mbay, moda_mgwa::mgwa, openbf(), rdmsgw(), status(), x48(), and x84().
Referenced by copysb().
recursive subroutine mesgbf | ( | integer, intent(in) | lunit, |
integer, intent(out) | mesgtyp | ||
) |
Read through a BUFR file (starting from the beginning of the file) and return the message type (from Section 1) of the first message encountered which does not contain DX BUFR table information.
The BUFR file should not have already been opened via a call to subroutine openbf(); however, it should already be associated with Fortran logical unit number lunit.
This subroutine is similar to subroutine mesgbc(), except that this subroutine will only skip past DX BUFR table messages at the beginning of a file, whereas mesgbc() will also skip past any "dummy" messages containing the dump center time or dump initiation time within NCEP dump files. Furthermore, mesgbc() also returns a message compression indicator, and it also has an option to operate on a BUFR message that has already been read into the internal arrays.
lunit | - Fortran logical unit number for BUFR file |
mesgtyp | - Message type
|
Definition at line 1570 of file s013vals.F90.
References closbf(), idxmsg(), iupbs01(), moda_mgwa::mgwa, openbf(), rdmsgw(), x48(), and x84().
recursive subroutine minimg | ( | integer, intent(in) | lunit, |
integer, intent(in) | mini | ||
) |
Write a minutes value into Section 1 of the BUFR message that was most recently opened for writing via a call to one of the message-writing subroutines for a specified Fortran logical unit.
lunit | - Fortran logical unit number for BUFR file |
mini | - Minutes value |
Definition at line 1223 of file s013vals.F90.
References bort(), moda_bitbuf::mbay, pkbs1(), status(), and x84().
recursive subroutine pkbs1 | ( | integer, intent(in) | ival, |
integer, dimension(*), intent(inout) | mbay, | ||
character*(*), intent(in) | s1mnem | ||
) |
Write a specified value into a specified location within Section 1 of a BUFR message, overwriting the value previously stored in that location.
This subroutine will work on any BUFR message encoded using BUFR edition 2, 3, or 4. It is similar to subroutine pkvs01(), except that it operates on a BUFR message passed in via a memory array, whereas pkvs01() operates on BUFR messages stored internally within the software.
ival | - Value to be stored |
mbay | - BUFR message |
s1mnem | - Location in Section 1 of mbay within which to store ival:
|
Definition at line 520 of file s013vals.F90.
References bort(), gets1loc(), iupbs01(), pkb(), and x84().
recursive subroutine pkvs01 | ( | character*(*), intent(in) | s01mnem, |
integer, intent(in) | ival | ||
) |
Specify a value to be written into a specified location within Section 0 or Section 1 of all BUFR messages output by future calls to other message-writing subroutines and subset-writing subroutines.
This subroutine is similar to subroutine pkbs1(), except that pkbs1() operates on a single BUFR message passed in via a memory array. Alternatively, whenever this subroutine is called, the specified IVAL will be written into all BUFR messages output by all future calls to other message-writing subroutines and subset-writing subroutines, for all Fortran logical units that are open for output within the application program, unless a subsequent call is made to this subroutine with the same value of s01mnem in order to reset the corresponding IVAL again. Otherwise, if this subroutine is never called for a particular value of s01mnem, then a default value is used for the corresponding ival, as set within subroutine msgini(), cmsgini() or dxmini().
ival | - Value to be stored |
s01mnem | - Location where ival is to be stored within Section 0 or Section 1 of all future output BUFR messages:
|
Definition at line 618 of file s013vals.F90.
References bort(), moda_s01cm::cmnem, moda_s01cm::ivmnem, moda_s01cm::ns01v, openbf(), and x84().
subroutine reads3 | ( | integer, intent(in) | lun | ) |
Read the Section 3 descriptors from the BUFR message in mbay(1,lun), then use the BUFR master tables to generate the necessary information for those descriptors within the internal BUFR table arrays.
lun | - File ID |
Definition at line 685 of file s013vals.F90.
References bort(), moda_s3list::cds3, moda_dscach::cnem, dxinit(), errwrt(), moda_dscach::idcach, moda_s3list::ids3, makestab(), moda_bitbuf::mbay, moda_dscach::ncnem, moda_dscach::ndc, stntbia(), moda_sc3bfr::tamnem, and upds3().
Referenced by readerme(), and readmg().
recursive subroutine upds3 | ( | integer, dimension(*), intent(in) | mbay, |
integer, intent(in) | lcds3, | ||
character*6, dimension(*), intent(out) | cds3, | ||
integer, intent(out) | nds3 | ||
) |
Read the sequence of data descriptors contained within Section 3 of a BUFR message.
mbay | - BUFR message |
lcds3 | - Dimensioned size (in integers) of cds3 in the calling program; used by the subroutine to ensure that it doesn't overflow the cds3 array |
cds3 | - Data descriptor sequence within Section 3 of mbay |
nds3 | - Number of data descriptors in cds3 |
Definition at line 828 of file s013vals.F90.
References adn30(), bort(), getlens(), iupb(), x48(), and x84().
Referenced by fdebufr_c(), ireadmt(), and reads3().