NCEPLIBS-bufr  12.1.0
s013vals.F90 File Reference

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...
 

Detailed Description

Read and write data values within Sections 0, 1, and 3 of BUFR messages.

Author
J. Ator
Date
2005-11-29

Definition in file s013vals.F90.

Function/Subroutine Documentation

◆ cktaba()

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.

Parameters
lun- File ID
subset- Table A mnemonic
  • Returned as a string of all blank characters if iret is equal to 11 (see below) and if Section 3 isn't being used for decoding
jdate- Date-time stored within Section 1 of BUFR, in format of either YYMMDDHH or YYYYMMDDHH depending on datelen() value
iret- Return code:
  • 0 = Normal return
  • -1 = Unrecognized Table A (message type) value
  • 11 = This is a BUFR table (dictionary) message
Author
Woollen
Date
2000-09-19

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().

◆ datebf()

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.

Parameters
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.

Author
J. Woollen
Date
1994-01-06

Definition at line 936 of file s013vals.F90.

References bort(), closbf(), errwrt(), idxmsg(), igetdate(), moda_mgwa::mgwa, openbf(), rdmsgw(), status(), x48(), and x84().

◆ datelen()

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().

Parameters
len- Length of Section 1 date-time values to be output by all future calls to message-reading subroutines:
  • 8 = YYMMDDHH format with 2-digit year (the default)
  • 10 = YYYYMMDDHH format with 4-digit year
Author
J. Woollen
Date
1998-07-08

Definition at line 888 of file s013vals.F90.

References bort(), and x84().

Referenced by fdebufr_c(), and readbp().

◆ dumpbf()

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).

Parameters
lunit- Fortran logical unit number for BUFR dump file
jdate- Dump center date-time stored within Section 1 of first "dummy" message:
  • Index 1 contains the year, in format of either YY or YYYY, depending on the most recent call to subroutine datelen()
  • Index 2 contains the month
  • Index 3 contains the day
  • Index 4 contains the hour
  • Index 5 contains the minute
jdump- Dump initiation date-time stored within Section 1 of second "dummy" message:
  • Index 1 contains the year, in format of either YY or YYYY, depending on the most recent call to subroutine datelen()
  • Index 2 contains the month
  • Index 3 contains the day
  • Index 4 contains the hour
  • Index 5 contains the minute
Author
J. Woollen
Date
1996-12-11

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().

◆ gets1loc()

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.

Parameters
s1mnem- Value whose location within Section 1 is to be determined:
  • 'LEN1' = Length (in bytes) of Section 1
  • 'BMT' = BUFR master table
  • 'OGCE' = Originating center
  • 'GSES' = Originating subcenter
  • 'USN' = Update sequence number
  • 'ISC2' = Flag indicating absence/presence of (optional) Section 2 in BUFR message:
    • 0 = Section 2 absent
    • 1 = Section 2 present
  • 'MTYP' = Data category
  • 'MSBTI' = Data subcategory (international)
  • 'MSBT' = Data subcategory (local)
  • 'MTV' = Version number of master table
  • 'MTVL' = Version number of local tables
  • 'YCEN' = Year of century (1-100)
  • 'CENT' = Century (e.g., 20 for years 1901-2000, 21 for years 2001-2100)
  • 'YEAR' = Year (4-digit)
  • 'MNTH' = Month
  • 'DAYS' = Day
  • 'HOUR' = Hour
  • 'MINU' = Minute
  • 'SECO' = Second
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:
  • 0 = normal return
  • -1 = s1mnem is invalid for BUFR edition iben
Remarks
  • s1mnem = 'GSES' is only valid for iben = 3 or 4
  • s1mnem = 'YCEN' or 'CENT' is only valid for iben = 2 or 3
  • s1mnem = 'YEAR', 'SECO', or 'MSBTI' is only valid for iben = 4
Author
J. Ator
Date
2005-11-29

Definition at line 47 of file s013vals.F90.

References x48(), and x84().

Referenced by iupbs01(), and pkbs1().

◆ i4dy()

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.

Parameters
idate- Date-time in format of either YYMMDDHH (2-digit year) or YYYYMMDDHH (4-digit year)
Returns
i4dy - Date-time in format of YYYYMMDDHH (4-digit year)
Author
J. Woollen
Date
1998-07-08

Definition at line 1069 of file s013vals.F90.

References x84().

Referenced by iupbs01(), openmb(), openmg(), and readmp().

◆ igetdate()

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.

Parameters
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
Returns
igetdate - Date-time stored within Section 1 of mbay, in format of either YYMMDDHH or YYYYMMDDHH, depending on the most recent call to subroutine datelen()
Remarks
  • The start of the BUFR message (i.e. the string 'BUFR') must be aligned on the first 4 bytes of mbay
Author
J. Ator
Date
2005-11-29

Definition at line 1021 of file s013vals.F90.

References iupbs01(), and x48().

Referenced by datebf(), and dumpbf().

◆ iupbs01()

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.

Remarks
  • The start of the BUFR message (i.e. the string 'BUFR') must be aligned on the first 4 bytes of mbay
  • Values corresponding to s01mnem = 'GSES' can only be read from BUFR messages encoded using BUFR edition 3 or 4
  • Values corresponding to s01mnem = 'YCEN' or 'CENT' can only be read from BUFR messages encoded using BUFR edition 2 or 3
  • When reading from BUFR messages encoded using BUFR edition 2 or 3, values corresponding to s01mnem = 'YEAR' will be calculated internally using the values for 'YCEN' and 'CENT', or inferred using a windowing technique
  • Values corresponding to s01mnem = 'SECO' or 'MSBTI' can only be read from BUFR messages encoded using BUFR edition 4
Parameters
mbay- BUFR message
s01mnem- Value to be read from Section 0 or Section 1 of mbay
  • 'LENM' = Length (in bytes) of BUFR message
  • 'LEN0' = Length (in bytes) of Section 0
  • 'LEN1' = Length (in bytes) of Section 1
  • 'BEN' = BUFR edition number
  • 'BMT' = BUFR master table
  • 'OGCE' = Originating center
  • 'GSES' = Originating subcenter
  • 'USN' = Update sequence number
  • 'ISC2' = Flag indicating absence/presence of (optional) Section 2 in BUFR message:
    • 0 = Section 2 absent
    • 1 = Section 2 present
  • 'MTYP' = Data category
  • 'MSBTI' = Data subcategory (international)
  • 'MSBT' = Data subcategory (local)
  • 'MTV' = Version number of master table
  • 'MTVL' = Version number of local tables
  • 'YCEN' = Year of century (1-100)
  • 'CENT' = Century (e.g., 20 for years 1901-2000, 21 for years 2001-2100)
  • 'YEAR' = Year (4-digit)
  • 'MNTH' = Month
  • 'DAYS' = Day
  • 'HOUR' = Hour
  • 'MINU' = Minute
  • 'SECO' = Second
Returns
iupbs01 - Value corresponding to s01mnem:
  • -1 = s01mnem was invalid for the edition of BUFR message in mbay, or some other error occurred
Author
J. Ator
Date
2005-11-29

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().

◆ iupbs3()

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.

Remarks
  • The start of the BUFR message (i.e. the string 'BUFR') must be aligned on the first 4 bytes of mbay
Parameters
mbay- BUFR message
s3mnem- Value to be read from Section 3 of mbay
  • 'NSUB' = Number of data subsets
  • 'IOBS' = Flag indicating whether the message contains observed data:
    • 0 = No
    • 1 = Yes
  • 'ICMP' = Flag indicating whether the message contains compressed data:
    • 0 = No
    • 1 = Yes
Returns
iupbs3 - Value corresponding to s3mnem
  • -1 = s3mnem was invalid
Author
J. Ator
Date
2009-03-23

Definition at line 348 of file s013vals.F90.

References getlens(), and iupb().

Referenced by dumpbf(), mesgbc(), readerme(), stndrd(), and writlc().

◆ iupvs01()

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.

Remarks
  • Values corresponding to s01mnem = 'GSES' can only be read from BUFR messages encoded using BUFR edition 3 or 4
  • Values corresponding to s01mnem = 'YCEN' or 'CENT' can only be read from BUFR messages encoded using BUFR edition 2 or 3
  • When reading from BUFR messages encoded using BUFR edition 2 or 3, values corresponding to s01mnem = 'YEAR' will be calculated internally using the values for 'YCEN' and 'CENT', or inferred using a windowing technique
  • Values corresponding to s01mnem = 'SECO' or 'MSBTI' can only be read from BUFR messages encoded using BUFR edition 4
Parameters
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:
  • 'LENM' = Length (in bytes) of BUFR message
  • 'LEN0' = Length (in bytes) of Section 0
  • 'LEN1' = Length (in bytes) of Section 1
  • 'BEN' = BUFR edition number
  • 'BMT' = BUFR master table
  • 'OGCE' = Originating center
  • 'GSES' = Originating subcenter
  • 'USN' = Update sequence number
  • 'ISC2' = Flag indicating absence/presence of (optional) Section 2 in BUFR message:
    • 0 = Section 2 absent
    • 1 = Section 2 present
  • 'MTYP' = Data category
  • 'MSBTI' = Data subcategory (international)
  • 'MSBT' = Data subcategory (local)
  • 'MTV' = Version number of master table
  • 'MTVL' = Version number of local tables
  • 'YCEN' = Year of century (1-100)
  • 'CENT' = Century (e.g., 20 for years 1901-2000, 21 for years 2001-2100)
  • 'YEAR' = Year (4-digit)
  • 'MNTH' = Month
  • 'DAYS' = Day
  • 'HOUR' = Hour
  • 'MINU' = Minute
  • 'SECO' = Second
Returns
- Value corresponding to s01mnem:
  • -1 = s01mnem was invalid for the edition of BUFR message in internal arrays for lunit, or some other error occurred
Author
J. Ator
Date
2005-11-29

Definition at line 442 of file s013vals.F90.

References bort(), iupbs01(), moda_bitbuf::mbay, status(), and x84().

Referenced by binv(), and split_by_subset().

◆ mesgbc()

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.

Author
D. Keyser
Date
2003-11-04

The message to be examined is obtained in one of two different ways, depending on the sign of lunin:

  • If lunin > 0, the subroutine reads and examines Section 1 of each message in a BUFR file starting from the beginning of the file, and continuing until it reaches the first message which actually contains report data. This means it will skip any messages containing DX BUFR table information, as well as any "dummy" messages containing the dump center time or dump initiation time within NCEP dump files. It then returns the message type and compression indicator from the first message containing report data. When used this way, the BUFR file in question should not have already been opened via a call to subroutine openbf(), though it should already be associated with Fortran logical unit number lunin. In this situation, the subroutine is similar to subroutine mesgbf(), except that mesgbf() doesn't skip past any "dummy" messages within NCEP dump files, nor does it return a compression indicator.
  • If lunin < 0, the subroutine simply returns the message type and compression indicator for the BUFR message currently stored in the internal arrays via the most recent call to one of the message-reading subroutines for Fortran logical unit number abs(lunin).
Parameters
lunin- Absolute value is Fortran logical unit number for BUFR file
mesgtyp- Message type
  • When lunin > 0, a mesgtyp value of -256 means that there was an error reading the BUFR file, or that no messages were read from the file. Otherwise, any other mesgtyp value < 0 means that none of the messages in the BUFR file contained any report data.
icomp- Message compression indicator
  • -3 = BUFR file does not exist
  • -2 = none of the messages in the BUFR file contained any report data
  • 0 = message is not compressed
  • 1 = message is compressed
Author
D. Keyser
Date
2003-11-04

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().

◆ mesgbf()

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.

Parameters
lunit- Fortran logical unit number for BUFR file
mesgtyp- Message type
  • -1 = error reading the BUFR file, or no messages were read from the file
  • 11 = BUFR file only contained DX BUFR table messages
Author
J. Woollen
Date
1994-01-06

Definition at line 1570 of file s013vals.F90.

References closbf(), idxmsg(), iupbs01(), moda_mgwa::mgwa, openbf(), rdmsgw(), x48(), and x84().

◆ minimg()

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.

Parameters
lunit- Fortran logical unit number for BUFR file
mini- Minutes value
Author
J. Woollen
Date
1994-01-06

Definition at line 1223 of file s013vals.F90.

References bort(), moda_bitbuf::mbay, pkbs1(), status(), and x84().

◆ pkbs1()

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.

Parameters
ival- Value to be stored
mbay- BUFR message
s1mnem- Location in Section 1 of mbay within which to store ival:
  • 'BMT' = BUFR master table
  • 'OGCE' = Originating center
  • 'GSES' = Originating subcenter
  • 'USN' = Update sequence number
  • 'MTYP' = Data category
  • 'MSBTI' = Data subcategory (international)
  • 'MSBT' = Data subcategory (local)
  • 'MTV' = Version number of master table
  • 'MTVL' = Version number of local tables
  • 'YCEN' = Year of century (1-100)
  • 'CENT' = Century (e.g., 20 for years 1901-2000, 21 for years 2001-2100)
  • 'YEAR' = Year (4-digit)
  • 'MNTH' = Month
  • 'DAYS' = Day
  • 'HOUR' = Hour
  • 'MINU' = Minute
  • 'SECO' = Second
Remarks
  • The start of the BUFR message (i.e. the string 'BUFR') must be aligned on the first 4 bytes of mbay
  • Values corresponding to s1mnem = 'GSES' can only be stored within BUFR messages encoded using BUFR edition 3 or 4
  • Values corresponding to s1mnem = 'YCEN' or 'CENT' can only be stored within BUFR messages encoded using BUFR edition 2 or 3.
  • Values corresponding to s1mnem = 'YEAR', 'SECO' or 'MSBTI' can only be stored within BUFR messages encoded using BUFR edition 4
Authors
J. Ator, D. Keyser
Date
2005-11-29

Definition at line 520 of file s013vals.F90.

References bort(), gets1loc(), iupbs01(), pkb(), and x84().

Referenced by minimg(), and msgwrt().

◆ pkvs01()

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().

Parameters
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:
  • 'BEN' = BUFR edition number
  • 'BMT' = BUFR master table
  • 'OGCE' = Originating center
  • 'GSES' = Originating subcenter
  • 'USN' = Update sequence number
  • 'MTYP' = Data category
  • 'MSBTI' = Data subcategory (international)
  • 'MSBT' = Data subcategory (local)
  • 'MTV' = Version number of master table
  • 'MTVL' = Version number of local tables
  • 'YCEN' = Year of century (1-100)
  • 'CENT' = Century (e.g., 20 for years 1901-2000, 21 for years 2001-2100)
  • 'YEAR' = Year (4-digit)
  • 'MNTH' = Month
  • 'DAYS' = Day
  • 'HOUR' = Hour
  • 'MINU' = Minute
  • 'SECO' = Second
Remarks
  • A separate call to this subroutine must be made for each value of s01mnem that is to be set within Section 0 or Section 1 of all future output BUFR messages.
  • A call to this subroutine with s01mnem = 'BEN' and ival = 4 will force all future output BUFR messages to be encoded using BUFR edition 4; otherwise, messages will be encoded using BUFR edition 3 by default.
  • Values corresponding to s01mnem = 'YCEN' or 'CENT' can only be stored within BUFR messages encoded using BUFR edition 3.
  • Values corresponding to s01mnem = 'YEAR', 'SECO' or 'MSBTI' can only be stored within BUFR messages encoded using BUFR edition 4.
Author
J. Ator
Date
2005-11-29

Definition at line 618 of file s013vals.F90.

References bort(), moda_s01cm::cmnem, moda_s01cm::ivmnem, moda_s01cm::ns01v, openbf(), and x84().

◆ reads3()

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.

Parameters
lun- File ID
Author
J. Ator
Date
2009-03-23

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().

◆ upds3()

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.

Remarks
  • The start of the BUFR message (i.e. the string 'BUFR') must be aligned on the first 4 bytes of mbay
  • This subroutine does not recursively resolve any Table D descriptors from within Section 3; rather, what is returned in CDS3 is the exact list of data descriptors as it appears within Section 3 of mbay
Parameters
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
Author
J. Ator
Date
2003-11-04

Definition at line 828 of file s013vals.F90.

References adn30(), bort(), getlens(), iupb(), x48(), and x84().

Referenced by fdebufr_c(), ireadmt(), and reads3().