NCEPLIBS-bufr 11.7.1
bufr_interface.h File Reference

Define signatures to enable a number of BUFRLIB subprograms to be called via wrapper functions from C and C++ application programs. More...

Go to the source code of this file.

Functions

void closbf_f (int bufr_unit)
 Wraps BUFRLIB "closbf" subroutine. More...
 
void close_f (int unit)
 Wraps fortran "close" statement so we can close a Fortran file from a C program. More...
 
void delete_table_data_f ()
 Deletes the copies of the moda_tables arrays. More...
 
void exitbufr_f ()
 Wraps BUFRLIB "exitbufr" subroutine. Closes all open file units used by BUFRLIB. More...
 
void get_inode_f (int lun, int *startNode)
 Get the bufr node idx for the start node of the subset. More...
 
void get_inv_f (int lun, int **data, int *len)
 Get pointer to the moda_usrint INV array. More...
 
void get_isc_f (int **data, int *len)
 Get copy of the moda_tables ISC array. More...
 
void get_itp_f (int **data, int *len)
 Get copy of the moda_tables ITP array. More...
 
void get_jmpb_f (int **data, int *len)
 Get copy of the moda_tables JMPB array. More...
 
void get_link_f (int **data, int *len)
 Get copy of the moda_tables LINK array. More...
 
void get_nval_f (int lun, int *numNodes)
 Get the number of values in the current subset. More...
 
void get_tag_f (char **data, int *str_len, int *size)
 Get copy of the moda_tables TAG array. More...
 
void get_typ_f (char **data, int *str_len, int *size)
 Get copy of the moda_tables TYP array. More...
 
void get_val_f (int lun, double **data, int *len)
 Get pointer to the moda_usrint VAL array. More...
 
int ireadmg_f (int bufr_unit, char *subset, int *iddate, int subset_len)
 Wraps BUFRLIB "ireadmg" subroutine. More...
 
int ireadsb_f (int bufr_unit)
 Wraps BUFRLIB "ireadsb" function. More...
 
void mtinfo_f (const char *path, int file_unit_1, int file_unit_2)
 Wraps BUFRLIB "mtinfo" function. 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)
 Gets Table B Unit and Description strings for a mnemonic. Wraps BUFRLIB "nemdefs". More...
 
void nemspecs_f (int file_unit, const char *mnemonic, int mnemonic_idx, int *scale, int *reference, int *bits, int *iret)
 Gets Table B scale, reference, and bits values. Wraps BUFRLIB "nemspecs". More...
 
void nemtab_f (int bufr_unit, const char *mnemonic, int *descriptor, char *table_type, int *table_idx)
 This subroutine returns information about a descriptor from the internal DX BUFR tables, based on the mnemonic associated with that descriptor. More...
 
void nemtbb_f (int bufr_unit, 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)
 Wraps fortran "open" statement so we can open a Fortran file from a C program. More...
 
void openbf_f (int bufr_unit, const char *cio, int table_file_id)
 Wraps BUFRLIB "openbf" subroutine. More...
 
void status_f (int file_unit, int *lun, int *il, int *im)
 Wraps BUFRLIB "status" function. More...
 
void ufbint_f (int bufr_unit, void **c_data, int dim_1, int dim_2, int *iret, const char *table_b_mnemonic)
 Wraps BUFRLIB "ufbint" function. More...
 
void ufbrep_f (int bufr_unit, void **c_data, int dim_1, int dim_2, int *iret, const char *table_b_mnemonic)
 Wraps BUFRLIB "ufbrep" function. More...
 

Detailed Description

Define signatures to enable a number of BUFRLIB subprograms to be called via wrapper functions from C and C++ application programs.

Author
Ronald Mclaren
Date
2020-07-29

This header file defines the signatures for the functions in bufr_interface.f90 which wrap a number of native Fortran subroutines in the BUFRLIB.

Definition in file bufr_interface.h.

Function Documentation

◆ closbf_f()

void closbf_f ( int  bufr_unit)

Wraps BUFRLIB "closbf" subroutine.

Author
Ronald McLaren
Date
2020-07-29
Parameters
[in]bufr_unit- int: the fortran file unit number to close

◆ close_f()

void close_f ( int  unit)

Wraps fortran "close" statement so we can close a Fortran file from a C program.

Author
Ronald McLaren
Date
2020-07-29
Parameters
[in]unit- int: the integer to use as the fortran file unit

◆ delete_table_data_f()

void delete_table_data_f ( )

Deletes the copies of the moda_tables arrays.

Author
Ronald McLaren
Date
2022-03-23

◆ exitbufr_f()

void exitbufr_f ( )

Wraps BUFRLIB "exitbufr" subroutine. Closes all open file units used by BUFRLIB.

Author
Ronald McLaren
Date
2020-07-29

◆ get_inode_f()

void get_inode_f ( int  lun,
int *  startNode 
)

Get the bufr node idx for the start node of the subset.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]lun- int: pointer for the file stream
[out]startNode- int*: the start node of the subset

◆ get_inv_f()

void get_inv_f ( int  lun,
int **  data,
int *  len 
)

Get pointer to the moda_usrint INV array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]lun- int: pointer for the file stream
[out]data- int**: c style pointer to the INV array
[out]len- int*: length of the array

◆ get_isc_f()

void get_isc_f ( int **  data,
int *  len 
)

Get copy of the moda_tables ISC array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]data- int**: c style pointer to the ISC array
[out]len- int: length of the array

◆ get_itp_f()

void get_itp_f ( int **  data,
int *  len 
)

Get copy of the moda_tables ITP array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]data- int**: c style pointer to the ITP array
[out]len- int: length of the array

◆ get_jmpb_f()

void get_jmpb_f ( int **  data,
int *  len 
)

Get copy of the moda_tables JMPB array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]data- int**: c style pointer to the JMPB array
[out]len- int: length of the array

◆ get_link_f()

void get_link_f ( int **  data,
int *  len 
)

Get copy of the moda_tables LINK array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]data- int**: c style pointer to the ISC array
[out]len- int: length of the array

◆ get_nval_f()

void get_nval_f ( int  lun,
int *  numNodes 
)

Get the number of values in the current subset.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]lun- int: pointer for the file stream
[out]startNode- int*: number of values in the subset

◆ get_tag_f()

void get_tag_f ( char **  data,
int *  str_len,
int *  size 
)

Get copy of the moda_tables TAG array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]data- int**: c style pointer to the TAG array
[out]len- int: length of the array

◆ get_typ_f()

void get_typ_f ( char **  data,
int *  str_len,
int *  size 
)

Get copy of the moda_tables TYP array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]data- int**: c style pointer to the TYP array
[out]len- int: length of the array

◆ get_val_f()

void get_val_f ( int  lun,
double **  data,
int *  len 
)

Get pointer to the moda_usrint VAL array.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[out]lun- int: pointer for the file stream
[out]data- double**: c style pointer to the VAL array
[out]len- int*: length of the array

◆ ireadmg_f()

int ireadmg_f ( int  bufr_unit,
char *  subset,
int *  iddate,
int  subset_len 
)

Wraps BUFRLIB "ireadmg" subroutine.

Author
Ronald McLaren
Date
2020-07-29
Parameters
[in]bufr_unit- int: the fortran file unit number to read from
[out]subset- char*: the subset string
[out]iddate- int*: datetime of message
[in]subset_len- int: length of the subset string

◆ ireadsb_f()

int ireadsb_f ( int  bufr_unit)

Wraps BUFRLIB "ireadsb" function.

Author
Ronald McLaren
Date
2020-07-29
Parameters
[in]bufr_unit- int: the fortran file unit number to read from

◆ mtinfo_f()

void mtinfo_f ( const char *  path,
int  file_unit_1,
int  file_unit_2 
)

Wraps BUFRLIB "mtinfo" function.

Author
Ronald McLaren
Date
2021-02-24
Parameters
[in]path- const char*: the path where the WMO tables are stored
[in]file_unit_1- int: number to use for first file unit
[in]file_unit_2- int: number to use for second file unit

◆ nemdefs_f()

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 
)

Gets Table B Unit and Description strings for a mnemonic. Wraps BUFRLIB "nemdefs".

Author
Ronald McLaren
Date
2022-08-08
Parameters
[in]file_unit- int: Fortran file unit for the open file
[in]mnemonic- const char*: mnemonic
[out]unit_c- char*: unit str
[in]unit_str_len- int: unit str length
[out]desc_c- char*: description string
[in]desc_str_len- int: description str length
[out]iret- int*: return value. 0 indicates success -1 indicates failure.

◆ nemspecs_f()

void nemspecs_f ( int  file_unit,
const char *  mnemonic,
int  mnemonic_idx,
int *  scale,
int *  reference,
int *  bits,
int *  iret 
)

Gets Table B scale, reference, and bits values. Wraps BUFRLIB "nemspecs".

Author
Ronald McLaren
Date
2022-08-08
Parameters
[in]file_unit- int: Fortran file unit for the open file
[in]mnemonic- const char*: mnemonic
[in]mnemonic_idx- int: indicates specific mnemonic element (if repeated)
[out]scale- int*: scale of element
[out]reference- int*: reference of element
[out]bits- int*: number of bits representing the element
[out]iret- int*: return value. 0 indicates success -1 indicates failure.

◆ nemtab_f()

void nemtab_f ( int  bufr_unit,
const char *  mnemonic,
int *  descriptor,
char *  table_type,
int *  table_idx 
)

This subroutine returns information about a descriptor from the internal DX BUFR tables, based on the mnemonic associated with that descriptor.

Author
Ronald McLaren
Date
2022-08-16
Parameters
[in]bufr_unit- int: the bufr file pointer
[in]mnemonic- const char*: mnemonic
[out]descriptor- int*: the binary descriptor for the mnemonic
[out]table_typechar*: 'A', 'B', 'C', or 'D', depending on table type
[out]table_idx- int*: the table index, or 0 if not found

◆ nemtbb_f()

void nemtbb_f ( int  bufr_unit,
int  table_idx,
char *  unit_str,
int  unit_str_len,
int *  scale,
int *  reference,
int *  bits 
)

Get information about a Table B descriptor.

Author
Ronald McLaren
Date
2022-08-16
Parameters
[in]bufr_unit- int: the bufr file pointer
[in]table_idx- int: Table B index
[out]unit_str- char*: unit str
[in]unit_str_len- int: unit str length
[out]scale- int*: scale of element
[out]reference- int*: reference of element
[out]bits- int*: bits of element

◆ open_f()

void open_f ( int  unit,
const char *  filepath 
)

Wraps fortran "open" statement so we can open a Fortran file from a C program.

Author
Ronald McLaren
Date
2020-07-29
Parameters
unit- int: the integer to use as the fortran file unit
filepath- const char*: path to the file we want to open.

◆ openbf_f()

void openbf_f ( int  bufr_unit,
const char *  cio,
int  table_file_id 
)

Wraps BUFRLIB "openbf" subroutine.

Author
Ronald McLaren
Date
2020-07-29
Parameters
[in]bufr_unit- int: the fortran file unit number
[in]cio- const char*: cio string (ex "IN", "SEC3", and "OUT")
[in]table_file_id- int: table_file unit number

◆ status_f()

void status_f ( int  file_unit,
int *  lun,
int *  il,
int *  im 
)

Wraps BUFRLIB "status" function.

Author
Ronald McLaren
Date
2022-03-23
Parameters
[in]file_unit- int: the fortran file unit number to read from
[out]lun- int: pointer for the file stream
[out]il- int: file status
[out]im- int: message status

◆ ufbint_f()

void ufbint_f ( int  bufr_unit,
void **  c_data,
int  dim_1,
int  dim_2,
int *  iret,
const char *  table_b_mnemonic 
)

Wraps BUFRLIB "ufbint" function.

Author
Ronald McLaren
Date
2020-07-29
Parameters
[in]bufr_unit- int: the fortran file unit number to read from
[in,out]c_data- void**: c style pointer to a pre-allocated buffer
[in]dim_1,dim_2- int: dimensionality of data to read or write
[out]iret- int: return value, length of data read
[in]table_b_mnemonic- const char*: string of mnemonics

◆ ufbrep_f()

void ufbrep_f ( int  bufr_unit,
void **  c_data,
int  dim_1,
int  dim_2,
int *  iret,
const char *  table_b_mnemonic 
)

Wraps BUFRLIB "ufbrep" function.

Author
Ronald McLaren
Date
2020-07-29
Parameters
[in]bufr_unit- int: the fortran file unit number to read from
[in,out]c_data- void**: c style pointer to a pre-allocated buffer
[in]dim_1,dim_2- int: dimensionality of data to read or write
[out]iret- int: return value, length of data read
[in]table_b_mnemonic- const char*: string of mnemonics