NCEP Home > NCO Home > Systems Integration Branch > Decoders > BUFRLIB > BUFRLIB Table of Contents > Description and Format of Master BUFR Tables
Printer Friendly Version
Description and Format of Master BUFR Tables
This document describes the format and concept of master BUFR tables. As
explained in the introduction, these are required by the BUFRLIB software
whenever the CIO='SEC3' option is specified
during a call to subroutine OPENBF for the
reading/decoding of a given file of BUFR messages. Otherwise, if a
different value of CIO is specified, then only a
DX BUFR tables file is required,
and master BUFR tables are not needed.
Subroutine MTINFO
Whenever master BUFR tables are required, they are provided to the BUFRLIB
software as a set of four system files. The actual format, content and naming
conventions of these files will be described later, but first we'll show
how to specify the location of these master table files.
CALL MTINFO ( CMTDIR, LUNMT1, LUNMT2 )
Input argument:
CMTDIR CHAR* Directory location of BUFR master tables
on local file system
LUNMT1 INTEGER First logical unit number to use when
reading BUFR master tables on system
LUNMT2 INTEGER Second logical unit number to use when
reading BUFR master tables on system
This subroutine should be called immediately after the corresponding call to
subroutine OPENBF for the BUFR file in question,
but at any rate it must be called before any
subsequent calls to subroutine READMG, READNS or
READERME are attempted on the file. The subroutine
takes three input arguments, the first of which is a string defining the
directory path on the local filesystem where the BUFR master tables are
located. Any full or relative pathname that is legal on the local filesystem
is allowed, up to a total length of 100 characters, and the BUFRLIB software
will automatically
search within this directory for the necessary master table files when it is
time for them to be opened and read. The last two arguments are logical unit
numbers for the software to use when opening and reading these files. These
can be any legal FORTRAN logical unit numbers on the local filesystem, but
they must be distinct from each other and cannot already be assigned to any
other system files within the application program.
Note that no actual master table file names are provided to this subroutine;
rather, only the directory path where all of the master table files reside
on the local filesystem is input to this routine. The names of the table files
themselves are determined automatically by the software as described below.
Whenever master tables need to be read, they are read as a corresponding set
of four system files:
- Standard Table B - an ordered listing of
all descriptors corresponding to an official release (i.e. version number) of the
standard, international BUFR Table B
- Local Table B - an ordered listing of all
local Table B descriptors supplementing the standard BUFR Table B, as
defined for use within a particular local originating center
- Standard Table D - an ordered listing of
all descriptors corresponding to an official release (i.e. version number) of the
standard, international BUFR Table D
- Local Table D - an ordered listing of all
local Table D descriptors supplementing the standard BUFR Table D, as
defined for use within a particular local originating center
Actual filenames follow the following convention:
Standard tables: bufrtab.TableX_STD_M_V
Local tables: bufrtab.TableX_LOC_M_C_L
where: X = Table type ('B' or 'D')
M = Master Table number ('0' for WMO, '10' for IOC, etc.)
V = Version number of Master Table used
C = Originating Center number ('7' for NCEP, etc.)
L = Version number of local tables used
Whenever a new BUFR message is read from a logical unit that was previously opened using
subroutine OPENBF
with CIO='SEC3', the identification section (Section 1) of the message is automatically
scanned to determine the above values for that message, then the software generates the four
necessary filenames using those values and attempts to open and read each of those files from the directory
that was specified by CMTDIR during the previous call to subroutine
MTINFO. This table information is then retained and re-used in memory until a
subsequent message is read which has a different value for any one of the above values, and at which point
a new set of tables is then read in from the same directory in order to be applied to the new message.
With this approach, the user can have multiple master table files stored within the same directory, and the
BUFRLIB software will always locate and read the appropriate ones depending on the corresponding
values stored within Section 1 of each new message
to be decoded. For more details about the above values, see the discussion on Section 1 within the official
WMO Manual #306.
Now that we've discussed the content and naming conventions for master BUFR table files, let's turn our attention
to the actual format of these files:
Table B
As described above, two master Table B files (one standard and one local) are required for each BUFR
message that is to be read and decoded. The BUFRLIB will scan the identification section (Section 1) of
each new message and then open and read the appropriate Table B files from within the directory specified by
CMTDIR during the previous call to subroutine
MTINFO. In particular, a standard Table B file must be available corresponding
to the version number of each BUFR message to be decoded, and the filename must follow the naming
convention described above. In addition, if there are any local descriptors contained within the
messages, then a local Table B file must also be available corresponding to the originating center and
local version numbers encoded within Section 1 of these messages. Otherwise, if the messages to be
decoded contain only standard descriptors (which is normally the case for data exchanged between centers),
then the default local Table B file from NCEP
(originating center 7) can be used as a placeholder since the software will not need
to actually read any information from this table. In this way, users are relieved from having to provide
a local Table B file for every originating center whose messages they wish to decode, and such a table
only becomes necessary when the messages themselves actually contain one or more local descriptors defined
by that particular center.
Here now is the format for each master Table B:
The first line of the file is as follows, where the symbols correspond to those used in the file naming
convention described above. In this way, the software can perform internal consistency checks where
needed. Note that the separator for each field is a '|' character, but otherwise the free use of white
space is allowed within each field:
Standard table: Table B STD | M | V
Local table: Table B LOC | M | C | L
where: M = Master Table number ('0' for WMO, '10' for IOC, etc.)
V = Version number of Master Table used
C = Originating Center number ('7' for NCEP, etc.)
L = Version number of local tables used
Following this first header line, the remainder of the file contains a listing of all possible Table B
descriptors corresponding to the specified version number of the table, ordered in ascending order with
respect to the FXY number as shown below. Blank lines as well as comments (i.e. any line beginning with
the character '#') are permitted throughout the file and will be ignored by the software, up until a line
is reached which contains the string 'END' in the first three characters, and which is a signal to the
software to stop looking for any new Table B descriptor definitions in the table. Each definition line
has the following format, where the '|' and ';' characters are required separators as shown, but
otherwise the additional use of white space is allowed within each field.
F-XX-YYY | SCALE | REFERENCE | BITS | UNITS | MNEMONIC ; CODES ; ELEMENT NAME
The CODES field can be used for any annotations the user may wish to add for
a particular definition line, or it can be left blank. All other fields should be self-explanatory
based on earlier discussions and should contain a value. Here are some examples:
0-01-018 | 0 | 0 | 40 | CCITT IA5 | SSTN ; ; Short station or site name
0-01-041 | 5 | -1073741824 | 31 | m/s | PS00 ; ; Absolute platform velocity - first component
0-05-002 | 2 | -9000 | 15 | Degree(N+,S-) | CLAT ; ; Latitude (coarse accuracy)
0-07-002 | -1 | -40 | 16 | m | HMSL ; ; Height or altitude
The above examples show how additional white space can vary from line to line and can be used
according to individual preferences, but of course for overall readability it's usually best to pick
one format and stick to it within a given table file. Here are some sample master Table B files
that can be downloaded and used:
Sample master Table B files
- Standard Table B for Master Table 0 (WMO), Version 13
- Standard Table B for Master Table 0 (WMO), Version 14
- Standard Table B for Master Table 0 (WMO), Version 15
- Standard Table B for Master Table 0 (WMO), Version 16
- Standard Table B for Master Table 0 (WMO), Version 17
- Standard Table B for Master Table 0 (WMO), Version 18
- Standard Table B for Master Table 0 (WMO), Version 19
- Standard Table B for Master Table 0 (WMO), Version 20
- Standard Table B for Master Table 0 (WMO), Version 21
- Standard Table B for Master Table 0 (WMO), Version 22
- Standard Table B for Master Table 0 (WMO), Version 23
- Standard Table B for Master Table 0 (WMO), Version 24
- Standard Table B for Master Table 0 (WMO), Version 25
- Standard Table B for Master Table 0 (WMO), Version 26
- Standard Table B for Master Table 0 (WMO), Version 27
- Local Table B for Master Table 0 (WMO), Originating Center 7 (NCEP), Version 1
Table D
As was the case for Table B, two master Table D files (one standard and one local) are also required for
each BUFR message that is to be read and decoded, and these files must exist within the directory
specified by CMTDIR during the previous call to subroutine
MTINFO. The BUFRLIB software will scan the identification section (Section 1)
of each BUFR message in order to determine the exact master table files to open and read for that
message, and a local Table D file is necessary whenever local descriptors from the originating center
in question are included within a message; otherwise,
the default local Table D from NCEP
(originating center 7) can be used as a placeholder.
The format of the first line of each master Table D file is the same as for Table B:
Standard table: Table D STD | M | V
Local table: Table D LOC | M | C | L
where: M = Master Table number ('0' for WMO, '10' for IOC, etc.)
V = Version number of Master Table used
C = Originating Center number ('7' for NCEP, etc.)
L = Version number of local tables used
and blank lines and comment lines (beginning with a '#' in column 1) are likewise allowed, but
otherwise the format for a master Table D file differs from that of a master Table B file since
entries now span multiple file lines as shown:
F-XX-YYY | MNEMONIC ; CODES ; SEQUENCE_NAME
| F-XX-YYY > | ELEMENT_NAME
| F-XX-YYY | ELEMENT_NAME
As shown, the first line of each entry contains the FXY number of the Table D sequence, along with
the corresponding sequence name, mnemonic and annotation codes (if any), and then each successive
line contains a single element of that sequence. Each successive element is listed one per line,
and note the '>' character after the FXY number within each element line up to, but not including,
the last element of the sequence. The BUFRLIB software uses the lack of a '>' character to know
when it has reached the last element of the sequence. Here are some examples:
3-01-004 | SFCSTNID ; ; Surface station identification
| 0-01-001 > | WMO block number
| 0-01-002 > | WMO station number
| 0-01-015 > | Station or site name
| 0-02-001 | Type of station
3-01-012 | HHMM ; ;
| 0-04-004 > | Hour
| 0-04-005 | Minute
3-01-023 | LTLONC ; ;
| 0-05-002 > | Latitude (coarse accuracy)
| 0-06-002 | Longitude (coarse accuracy)
3-01-025 | LTLONCDT ; ;
| 3-01-023 > | Latitude and longitude (coarse accuracy)
| 0-04-003 > | Day
| 3-01-012 | Time
3-01-045 | SATLOVEL ; ; Satellite location and velocity
| 3-01-011 > | Year, month, day
| 3-01-012 > | Time (hour, minute)
| 2-01-138 > | Change width to 16 bits
| 2-02-131 > | Change scale to 3
| 0-04-006 > | Second
| 2-01-000 > | Change width back to Table B
| 2-02-000 > | Change scale back to Table B
| 3-04-030 > | Location relative to the Earth's centre
| 3-04-031 | Velocity relative to the Earth's centre
3-03-050 | WDPLRAOB ; ; Wind data at a pressure level with radiosonde position
| 0-04-086 > | Long time period or displacement (since launch time)
| 0-08-042 > | Extended vertical sounding significance
| 0-07-004 > | Pressure
| 0-05-015 > | Latitude displacement since launch site (high accuracy)
| 0-06-015 > | Longitude displacement since launch site (high accuracy)
| 0-11-001 > | Wind direction
| 0-11-002 | Wind speed
As with master Table B files, the entries within a master Table D must all be sorted in ascending
order with respect to the FXY number, and the software will continue reading from the file until
it reaches a line with the string 'END' in the first three characters.
Here are some sample master Table D files that can be downloaded and used:
Sample master Table D files
- Standard Table D for Master Table 0 (WMO), Version 13
- Standard Table D for Master Table 0 (WMO), Version 14
- Standard Table D for Master Table 0 (WMO), Version 15
- Standard Table D for Master Table 0 (WMO), Version 16
- Standard Table D for Master Table 0 (WMO), Version 17
- Standard Table D for Master Table 0 (WMO), Version 18
- Standard Table D for Master Table 0 (WMO), Version 19
- Standard Table D for Master Table 0 (WMO), Version 20
- Standard Table D for Master Table 0 (WMO), Version 21
- Standard Table D for Master Table 0 (WMO), Version 22
- Standard Table D for Master Table 0 (WMO), Version 23
- Standard Table D for Master Table 0 (WMO), Version 24
- Standard Table D for Master Table 0 (WMO), Version 25
- Standard Table D for Master Table 0 (WMO), Version 26
- Standard Table D for Master Table 0 (WMO), Version 27
- Local Table D for Master Table 0 (WMO), Originating Center 7 (NCEP), Version 1
|