NCEPLIBS-bufr
11.7.0
|
C language code for debufr utility. More...
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <libgen.h>
#include <unistd.h>
#include "bufrlib.h"
#include "cobfl.h"
Go to the source code of this file.
Macros | |
#define | MXFLEN 500 |
#define | MXFLEN_TBLFIL (MXFLEN+50) |
Functions | |
void | fdebufr (char *, char *, f77int *, char *, char *, char *, char *, char *, size_t, size_t, size_t, size_t, size_t, size_t, size_t) |
int | main (int argc, char *argv[]) |
This program decodes a BUFR file and generates a verbose listing of the contents. More... | |
void | prtusage (char *prgnam) |
This function prints program usage information to standard output. More... | |
C language code for debufr utility.
Definition in file debufr.c.
int main | ( | int | argc, |
char * | argv[] | ||
) |
This program decodes a BUFR file and generates a verbose listing of the contents.
If a DX BUFR Tables file is specified (using the -f option) or if the specified BUFR file contains an embedded DX BUFR tables message as the first message in the file, then this information is used to decode the data messages in the file. Otherwise, or whenever the -m option is specified, master BUFR tables are read and used to decode the data messages in the file.
Usage
debufr [-v] [-h] [-b] [-c] [-m] [-o outfile] [-t tabledir] [-f tablefil] [-p prmstg] bufrfile
where: -v prints version information and exits
-h prints program help and usage information and exits
-b specifies the "basic" option, meaning that only the information in Sections 0-3 will be decoded from each BUFR message in the bufrfile, and no attempt will be made to decode the data in Section 4
-c specifies that code and flag table meanings should not be read from master BUFR tables and included in the output; otherwise this feature is enabled by default
-m specifies that master BUFR tables will be used to decode the data messages in the file, regardless of whether it contains any embedded DX BUFR table messages. This option can be used to view the actual contents of DX BUFR table messages, which otherwise would not be printed in the output listing.
outfile [path/]name of file to contain verbose output listing. The default is "bufrfilename.debufr.out" in the current working directory, where bufrfilename is the basename of the bufrfile (i.e. bufrfile with any preceding [path/] removed).
tabledir [path/]name of directory containing tables to be used for decoding. This directory contains the DX BUFR tables file to be used (if one was specified via the -f option), or it may contain all of the master BUFR tables when these are being used to decode a file. If unspecified, the default directory location is the defined value of the MASTER_TABLE_DIR macro when the utility was built.
tablefil file within tabledir containing DX BUFR tables to be used for decoding.
prmstg string of comma-separated PARAMETER=VALUE pairs, up to a maximum of 20. For each pair, the dynamic allocation PARAMETER will be set to VALUE within the underlying BUFRLIB software, overriding the default value that would otherwise be used. A complete list of parameters that can be dynamically sized is included within the documentation for BUFRLIB function isetprm().
bufrfile [path/]name of BUFR file to be decoded
Program history log:
Date | Programmer | Comments |
---|---|---|
2009-07-01 | J. Ator | Original author |
2012-06-18 | J. Ator | Modified to allow decoding of BUFR files based on NCEP DX dictionary table information. The program can now process any files that previously required the use of ckbufr. |
2012-12-07 | J. Ator | Modified to add -m and -v options and inline version of OPENBT subroutine for mixed BUFR files |
2013-10-07 | J. Ator | Print Section 1 tank receipt time information for NCEP/NCO BUFR messages if available |
2013-11-15 | J. Ator | Add -h option and check for non-existent tablefil |
2014-09-15 | J. Ator | Change default path for tabledir, change default name for outfile, and confirm outfile is writeable |
2018-01-19 | J. Ator | Add print of code and flag table meanings |
2018-04-09 | J. Ator | Add -c option to turn off print of code and flag table meanings (default is "on") |
2018-09-05 | J. Ator | Add -p option to pass in one or more BUFRLIB dynamic allocation parameters to override default settings |
2019-02-01 | J. Ator | Remove limit on length of prmstg, and allow up to 20 PARAMETER=VALUE pairs |
2021-03-02 | J. Ator | Add missing #include files, remove unused errflg variable, and other general cleanup |
2022-04-05 | J. Ator | Increase MXFLEN to 500, use MXFLEN_TBLFIL |
Definition at line 174 of file debufr.c.
References bvers(), ccbfl(), cobfl(), fdebufr(), and prtusage().
void prtusage | ( | char * | prgnam | ) |
This function prints program usage information to standard output.
[in] | prgnam | – char*: [path/]name of program executable |
Program history log:
Date | Programmer | Comments |
---|---|---|
2018-03-01 | J. Ator | Original author |