NCEPLIBS-bufr
12.1.0
|
Enable a number of NCEPLIBS-bufr subprograms to be called from within C and C++ application programs. More...
Go to the source code of this file.
Macros | |
#define | VERS_STR_LEN 8 |
Size of a character string needed to store a library version number. More... | |
Functions | |
void | bvers_f (char *cverstr, int cverstr_len) |
Get the version number of the NCEPLIBS-bufr software. More... | |
void | ccbfl (void) |
Close all files that were opened via previous calls to function cobfl(). More... | |
void | closbf_f (int bufr_unit) |
Close a previously opened file and disconnect it from the library. More... | |
void | close_f (int unit) |
Close a Fortran file from a C program. More... | |
void | cmpmsg_f (char *cf) |
Specify the use of compression when writing BUFR messages. More... | |
void | cobfl (char *bfl, char io) |
Open a new file for reading or writing BUFR messages via a C language interface. More... | |
void | crbmg (char *bmg, int mxmb, int *nmb, int *iret) |
Read the next BUFR message from the file that was opened via the most recent call to function cobfl() with io = 'r'. More... | |
void | cwbmg (char *bmg, int nmb, int *iret) |
Write a BUFR message to the file that was opened via the most recent call to function cobfl() with io = 'w'. More... | |
void | delete_table_data_f () |
Deletes the copies of the moda_tables arrays. More... | |
void | exitbufr_f () |
Reset the library. More... | |
void | get_inode_f (int lun, int *start_node) |
Get the bufr node idx for the start node of the subset. More... | |
void | get_inv_f (int lun, int **inv_ptr, int *inv_size) |
Get pointer to the moda_usrint INV array. More... | |
void | get_irf_f (int **irf_ptr, int *irf_size) |
Get copy of the moda_tables IRF array. More... | |
void | get_isc_f (int **isc_ptr, int *isc_size) |
Get copy of the moda_tables ISC array. More... | |
void | get_itp_f (int **itp_ptr, int *itp_size) |
Get copy of the moda_tables ITP array. More... | |
void | get_jmpb_f (int **jmpb_ptr, int *jmpb_size) |
Get copy of the moda_tables JMPB array. More... | |
void | get_link_f (int **link_ptr, int *link_size) |
Get copy of the moda_tables LINK array. More... | |
void | get_nval_f (int lun, int *num_nodes) |
Get the number of values in the current subset. More... | |
void | get_tag_f (char **tag_ptr, int *tag_len, int *mem_size) |
Get copy of the moda_tables TAG array. More... | |
void | get_typ_f (char **typ_ptr, int *typ_len, int *mem_size) |
Get copy of the moda_tables TYP array. More... | |
void | get_val_f (int lun, double **val_ptr, int *val_size) |
Get pointer to the moda_usrint VAL array. More... | |
int | ibfms_f (double r8val) |
Test whether a data value is "missing". More... | |
int | igetmxby_f (void) |
Get the maximum length of a BUFR message that can be written to an output file. More... | |
int | igetprm_f (char *cprmnm) |
Get the current value of a parameter. More... | |
int | ireadmg_f (int bufr_unit, char *subset, int *iddate, int subset_len) |
Read the next message from a BUFR file. More... | |
int | ireadns_f (int bufr_unit, char *subset, int *iddate, int subset_len) |
Read the next data subset from a BUFR file. More... | |
int | ireadsb_f (int bufr_unit) |
Read the next data subset from a BUFR message. More... | |
int | isetprm_f (char *cprmnm, int ipval) |
Define a customized parameter value for dynamic allocation. More... | |
int | iupbs01_f (int *bufr, char *mnemonic) |
Read a data value from Section 0 or Section 1 of a BUFR message. More... | |
void | maxout_f (int max0) |
Define a customized maximum length for output BUFR messages. More... | |
void | mtinfo_f (const char *path, int file_unit_1, int file_unit_2) |
Specify location of master BUFR tables on local file system. More... | |
void | nemdefs_f (int file_unit, const char *mnemonic, char *unit_c, int unit_str_len, char *desc_c, int desc_str_len, int *iret) |
Get the element name and units associated with a Table B mnemonic. More... | |
void | nemspecs_f (int file_unit, const char *mnemonic, int mnemonic_idx, int *scale, int *reference, int *bits, int *iret) |
Get the scale factor, reference value and bit width associated with a specified occurrence of a Table B mnemonic. More... | |
void | nemtab_f (int lun, const char *mnemonic, int *descriptor, char *table_type, int *table_idx) |
Get information about a descriptor. More... | |
void | nemtbb_f (int lun, int table_idx, char *unit_str, int unit_str_len, int *scale, int *reference, int *bits) |
Get information about a Table B descriptor. More... | |
void | open_f (int unit, const char *filepath) |
Open a Fortran file from a C program. More... | |
void | openbf_f (int bufr_unit, const char *cio, int table_file_id) |
Connect a new file to the library, or initialize the library, or change verbosity associated with already-connected file. More... | |
void | openmb_f (int bufr_unit, char *c_subset, int iddate) |
Open a new message for output in a BUFR file that was previously opened for writing. More... | |
void | readlc_f (int lunit, const char *str_id, char *output_str, int output_str_len) |
Function used to get long strings from the BUFR file. More... | |
void | status_f (int file_unit, int *lun, int *il, int *im) |
Check whether a file is connected to the library. More... | |
void | ufbint_f (int bufr_unit, void **c_data, int dim_1, int dim_2, int *iret, const char *table_b_mnemonic) |
Read/write one or more data values from/to a data subset. More... | |
void | ufbrep_f (int bufr_unit, void **c_data, int dim_1, int dim_2, int *iret, const char *table_b_mnemonic) |
Read/write one or more data values from/to a data subset. More... | |
void | ufbseq_f (int bufr_unit, void **c_data, int dim_1, int dim_2, int *iret, const char *table_d_mnemonic) |
Read/write an entire sequence of data values from/to a data subset. More... | |
Enable a number of NCEPLIBS-bufr subprograms to be called from within C and C++ application programs.
This header file defines the signatures which wrap a number of native Fortran subprograms in the library. It also contains prototypes for native C functions in the library which are expected to be called from C and C++ application programs.
Definition in file bufr_interface.h.
#define VERS_STR_LEN 8 |
Size of a character string needed to store a library version number.
Definition at line 21 of file bufr_interface.h.
void bvers_f | ( | char * | cverstr, |
int | cverstr_len | ||
) |
void ccbfl | ( | void | ) |
void closbf_f | ( | int | bufr_unit | ) |
Close a previously opened file and disconnect it from the library.
Wraps closbf() subroutine.
bufr_unit | - the Fortran logical unit number to close. |
void close_f | ( | int | unit | ) |
Close a Fortran file from a C program.
unit | - the integer to use as the Fortran logical unit. |
void cmpmsg_f | ( | char * | cf | ) |
Specify the use of compression when writing BUFR messages.
Wraps cmpmsg() subroutine.
cf | - Flag indicating whether future BUFR output messages are to be compressed ('Y' = Yes, 'N' = No). |
void cobfl | ( | char * | bfl, |
char | io | ||
) |
Open a new file for reading or writing BUFR messages via a C language interface.
This function is designed to be easily callable from application program written in either C or Fortran. It is functionally equivalent to subroutine openbf(); however, there are some important differences:
Any errors encountered when using this function are automatically logged to standard output, or to an alternate location previously specified via a call to subroutine errwrt().
bfl | - System file to be opened. Inclusion of directory prefixes or other local filesystem notation is allowed, up to 200 total characters. |
io | - Flag indicating how bfl is to be opened:
|
Definition at line 120 of file crwbmg.c.
References bort_f(), MXFNLEN, and pbf.
Referenced by main().
void crbmg | ( | char * | bmg, |
int | mxmb, | ||
int * | nmb, | ||
int * | iret | ||
) |
Read the next BUFR message from the file that was opened via the most recent call to function cobfl() with io = 'r'.
This function is designed to be easily callable from application program written in either C or Fortran.
bmg | - BUFR message |
mxmb | - Number of elements in bmg array;; used by the function to ensure that it doesn't overflow the array. |
nmb | - Size (in bytes) of BUFR message in bmg. |
iret | - return code:
|
Definition at line 195 of file crwbmg.c.
References bort_f(), iupbs01_f(), pbf, and rbytes().
void cwbmg | ( | char * | bmg, |
int | nmb, | ||
int * | iret | ||
) |
Write a BUFR message to the file that was opened via the most recent call to function cobfl() with io = 'w'.
This function is designed to be easily callable from application program written in either C or Fortran.
bmg | - BUFR message |
nmb | - Size (in bytes) of BUFR message in bmg |
iret | - return code:
|
void delete_table_data_f | ( | ) |
Deletes the copies of the moda_tables arrays.
void exitbufr_f | ( | ) |
void get_inode_f | ( | int | lun, |
int * | start_node | ||
) |
Get the bufr node idx for the start node of the subset.
lun | - File ID. |
start_node | - the start node of the subset. |
void get_inv_f | ( | int | lun, |
int ** | inv_ptr, | ||
int * | inv_size | ||
) |
Get pointer to the moda_usrint INV array.
lun | - File ID. |
inv_ptr | - pointer to a pointer to the INV array. |
inv_size | - size of the INV array. |
void get_irf_f | ( | int ** | irf_ptr, |
int * | irf_size | ||
) |
Get copy of the moda_tables IRF array.
irf_ptr | - pointer to a pointer to the IRF array. |
irf_size | - size of the IRF array. |
void get_isc_f | ( | int ** | isc_ptr, |
int * | isc_size | ||
) |
Get copy of the moda_tables ISC array.
isc_ptr | - pointer to a pointer to the ISC array. |
isc_size | - size of the ISC array. |
void get_itp_f | ( | int ** | itp_ptr, |
int * | itp_size | ||
) |
Get copy of the moda_tables ITP array.
itp_ptr | - pointer to a pointer to the ITP array. |
itp_size | - size of the ITP array. |
void get_jmpb_f | ( | int ** | jmpb_ptr, |
int * | jmpb_size | ||
) |
Get copy of the moda_tables JMPB array.
jmpb_ptr | - pointer to a pointer to the JMPB array. |
jmpb_size | - size of the JMPB array. |
void get_link_f | ( | int ** | link_ptr, |
int * | link_size | ||
) |
Get copy of the moda_tables LINK array.
link_ptr | - pointer to a pointer to the LINK array. |
link_size | - size of the LINK array. |
void get_nval_f | ( | int | lun, |
int * | num_nodes | ||
) |
Get the number of values in the current subset.
lun | - File ID. |
num_nodes | - number of values in the subset. |
void get_tag_f | ( | char ** | tag_ptr, |
int * | tag_len, | ||
int * | mem_size | ||
) |
Get copy of the moda_tables TAG array.
tag_ptr | - pointer to a pointer to the TAG array. |
tag_len | - size of each string within the TAG array. |
mem_size | - size of the TAG array. |
void get_typ_f | ( | char ** | typ_ptr, |
int * | typ_len, | ||
int * | mem_size | ||
) |
Get copy of the moda_tables TYP array.
typ_ptr | - pointer to a pointer to the TYP array. |
typ_len | - size of each string within the TYP array. |
mem_size | - size of the TYP array. |
void get_val_f | ( | int | lun, |
double ** | val_ptr, | ||
int * | val_size | ||
) |
Get pointer to the moda_usrint VAL array.
lun | - File ID. |
val_ptr | - pointer to a pointer to the VAL array. |
val_size | - size of the VAL array. |
int ibfms_f | ( | double | r8val | ) |
Test whether a data value is "missing".
Wraps ibfms() function.
r8val | - Data value. |
int igetmxby_f | ( | void | ) |
Get the maximum length of a BUFR message that can be written to an output file.
int igetprm_f | ( | char * | cprmnm | ) |
Get the current value of a parameter.
cprmnm | - Parameter. |
Referenced by arallocc(), inittbf(), restd(), and stseq().
int ireadmg_f | ( | int | bufr_unit, |
char * | subset, | ||
int * | iddate, | ||
int | subset_len | ||
) |
Read the next message from a BUFR file.
Wraps ireadmg() function.
bufr_unit | - the Fortran logical unit number to read from. |
subset | - the subset string. |
iddate | - datetime of message. |
subset_len | - length of the subset string. |
int ireadns_f | ( | int | bufr_unit, |
char * | subset, | ||
int * | iddate, | ||
int | subset_len | ||
) |
Read the next data subset from a BUFR file.
Wraps ireadns() function.
bufr_unit | - the Fortran logical unit number to read from. |
subset | - the subset string. |
iddate | - datetime of message. |
subset_len | - length of the subset string. |
int ireadsb_f | ( | int | bufr_unit | ) |
Read the next data subset from a BUFR message.
Wraps ireadsb() function.
bufr_unit | - the Fortran logical unit number to read from. |
int isetprm_f | ( | char * | cprmnm, |
int | ipval | ||
) |
Define a customized parameter value for dynamic allocation.
cprmnm | - Parameter. |
ipval | - Value to be set for cprmnm. |
int iupbs01_f | ( | int * | bufr, |
char * | mnemonic | ||
) |
Read a data value from Section 0 or Section 1 of a BUFR message.
Wraps iupbs01() function.
bufr | - BUFR message. |
mnemonic | - Value to be read from Section 0 or Section 1. |
void maxout_f | ( | int | max0 | ) |
Define a customized maximum length for output BUFR messages.
Wraps maxout() subroutine.
max0 | - New maximum length (in bytes) for all BUFR messages written to all output files. |
void mtinfo_f | ( | const char * | path, |
int | file_unit_1, | ||
int | file_unit_2 | ||
) |
Specify location of master BUFR tables on local file system.
Wraps mtinfo() subroutine.
path | - the path where the WMO tables are stored. |
file_unit_1 | - number to use for first logical unit. |
file_unit_2 | - number to use for second logical unit. |
void nemdefs_f | ( | int | file_unit, |
const char * | mnemonic, | ||
char * | unit_c, | ||
int | unit_str_len, | ||
char * | desc_c, | ||
int | desc_str_len, | ||
int * | iret | ||
) |
Get the element name and units associated with a Table B mnemonic.
Wraps nemdefs() subroutine.
file_unit | - Fortran logical unit for the open file. |
mnemonic | - Mnemonic. |
unit_c | - Unit string. |
unit_str_len | - Unit string length. |
desc_c | - Description string. |
desc_str_len | - Description string length. |
iret | - 0 indicates success -1 indicates failure. |
void nemspecs_f | ( | int | file_unit, |
const char * | mnemonic, | ||
int | mnemonic_idx, | ||
int * | scale, | ||
int * | reference, | ||
int * | bits, | ||
int * | iret | ||
) |
Get the scale factor, reference value and bit width associated with a specified occurrence of a Table B mnemonic.
Wraps nemspecs() subroutine.
file_unit | - Fortran logical unit for the open file. |
mnemonic | - Mnemonic. |
mnemonic_idx | - Ordinal indicator of specific mnemonic element (if repeated). |
scale | - Scale of element. |
reference | - Reference of element. |
bits | - Number of bits representing the element. |
iret | - 0 indicates success -1 indicates failure. |
void nemtab_f | ( | int | lun, |
const char * | mnemonic, | ||
int * | descriptor, | ||
char * | table_type, | ||
int * | table_idx | ||
) |
Get information about a descriptor.
Wraps nemtab() subroutine.
lun | - File ID. |
mnemonic | - Mnemonic. |
descriptor | - The binary descriptor for the mnemonic. |
table_type | - Type of internal DX BUFR table ('B', 'C', or 'D'). |
table_idx | - The table index, or 0 if not found. |
Referenced by stseq().
void nemtbb_f | ( | int | lun, |
int | table_idx, | ||
char * | unit_str, | ||
int | unit_str_len, | ||
int * | scale, | ||
int * | reference, | ||
int * | bits | ||
) |
Get information about a Table B descriptor.
Wraps nemtbb() subroutine.
lun | - File ID. |
table_idx | - Table B index. |
unit_str | - Unit string. |
unit_str_len | - Unit string length. |
scale | - Scale of element. |
reference | - Reference value of element. |
bits | - Number of bits representing theelement. |
Referenced by restd().
void open_f | ( | int | unit, |
const char * | filepath | ||
) |
Open a Fortran file from a C program.
unit | - the integer to use as the Fortran logical unit. |
filepath | - path to the file we want to open. |
void openbf_f | ( | int | bufr_unit, |
const char * | cio, | ||
int | table_file_id | ||
) |
Connect a new file to the library, or initialize the library, or change verbosity associated with already-connected file.
Wraps openbf() subroutine.
bufr_unit | - the Fortran logical unit number. |
cio | - cio string (ex "IN", "SEC3", and "OUT"). |
table_file_id | - table_file unit number. |
void openmb_f | ( | int | bufr_unit, |
char * | c_subset, | ||
int | iddate | ||
) |
Open a new message for output in a BUFR file that was previously opened for writing.
Wraps openmb() subroutine.
bufr_unit | - Fortran logical unit number to write to. |
c_subset | - Table A mnemonic of message. |
iddate | - Date-time to be stored within Section 1 of message. |
void readlc_f | ( | int | lunit, |
const char * | str_id, | ||
char * | output_str, | ||
int | output_str_len | ||
) |
Function used to get long strings from the BUFR file.
lunit | - Fortran logical unit. |
str_id | - Mnemonic for the string for the source field plus the index number (ex: 'IDMN#2') |
output_str | - The pre-allocated result string |
output_str_len | - Size of the result string buffer |
void status_f | ( | int | file_unit, |
int * | lun, | ||
int * | il, | ||
int * | im | ||
) |
Check whether a file is connected to the library.
Wraps status() subroutine.
file_unit | - Fortran logical unit number of file. |
lun | - File ID. |
il | - File status. |
im | - Message status. |
void ufbint_f | ( | int | bufr_unit, |
void ** | c_data, | ||
int | dim_1, | ||
int | dim_2, | ||
int * | iret, | ||
const char * | table_b_mnemonic | ||
) |
Read/write one or more data values from/to a data subset.
Wraps ufbint() subroutine.
bufr_unit | - the Fortran logical unit number to read from. |
c_data | - pointer to a pointer to a pre-allocated buffer. |
dim_1 | - dimensionality of data to read or write. |
dim_2 | - dimensionality of data to read or write. |
iret | - return value, length of data read. |
table_b_mnemonic | - string of mnemonics. |
void ufbrep_f | ( | int | bufr_unit, |
void ** | c_data, | ||
int | dim_1, | ||
int | dim_2, | ||
int * | iret, | ||
const char * | table_b_mnemonic | ||
) |
Read/write one or more data values from/to a data subset.
Wraps ufbrep() subroutine.
bufr_unit | - the Fortran logical unit number to read from. |
c_data | - pointer to a pointer to a pre-allocated buffer. |
dim_1 | - dimensionality of data to read or write. |
dim_2 | - dimensionality of data to read or write. |
iret | - length of data read. |
table_b_mnemonic | - string of mnemonics. |
void ufbseq_f | ( | int | bufr_unit, |
void ** | c_data, | ||
int | dim_1, | ||
int | dim_2, | ||
int * | iret, | ||
const char * | table_d_mnemonic | ||
) |
Read/write an entire sequence of data values from/to a data subset.
Wraps ufbseq() subroutine.
bufr_unit | - the Fortran logical unit number to read from. |
c_data | - pointer to a pointer to a pre-allocated buffer. |
dim_1 | - dimensionality of data to read or write. |
dim_2 | - dimensionality of data to read or write. |
iret | - return value, length of data read. |
table_d_mnemonic | - Table A or Table D mnemonic. |