NCEPLIBS-bufr  12.0.0
bufr_c2f_interface Module Reference

Wrap Fortran NCEPLIBS-bufr subprograms and variables so they can be called from within C. More...

Functions/Subroutines

subroutine, public bort_c (errstr)
 Log one error message and abort application program. More...
 
subroutine, public bvers_c (cverstr, cverstr_len)
 Get the version number of the NCEPLIBS-bufr software. More...
 
subroutine, public cadn30_c (idn, adn, adn_str_len)
 Convert an FXY value from its WMO bit-wise representation to its six-character representation. More...
 
subroutine, public closbf_c (bufr_unit)
 Close a previously opened file and disconnect it from the library. More...
 
subroutine, public close_c (lunit)
 Close a Fortran file from a C program. More...
 
subroutine, public delete_table_data_c ()
 Deletes the copies of the moda_tables arrays. More...
 
subroutine, public elemdx_c (card, lun)
 Decode the scale factor, reference value, bit width, and units from a Table B mnemonic definition. More...
 
subroutine, public exitbufr_c ()
 Reset the library. More...
 
subroutine, public get_inode_c (lun, start_node)
 Get the bufr node idx for the start node of the subset. More...
 
subroutine, public get_inv_c (lun, inv_ptr, inv_size)
 Get pointer to the moda_usrint INV array. More...
 
subroutine, public get_irf_c (irf_ptr, irf_size)
 Get copy of the moda_tables IRF array. More...
 
subroutine, public get_isc_c (isc_ptr, isc_size)
 Get copy of the moda_tables ISC array. More...
 
subroutine, public get_itp_c (itp_ptr, itp_size)
 Get copy of the moda_tables ITP array. More...
 
subroutine, public get_jmpb_c (jmpb_ptr, jmpb_size)
 Get copy of the moda_tables JMPB array. More...
 
subroutine, public get_link_c (link_ptr, link_size)
 Get copy of the moda_tables LINK array. More...
 
subroutine, public get_nval_c (lun, num_nodes)
 Get the number of values in the current subset. More...
 
subroutine, public get_tag_c (tag_ptr, tag_len, mem_size)
 Get copy of the moda_tables TAG array. More...
 
subroutine, public get_typ_c (typ_ptr, typ_len, mem_size)
 Get copy of the moda_tables TYP array. More...
 
subroutine, public get_val_c (lun, val_ptr, val_size)
 Get pointer to the moda_usrint VAL array. More...
 
integer(c_int) function, public ibfms_c (r8val)
 Test whether a data value is "missing". More...
 
integer(c_int) function, public ifxy_c (cfxy)
 Convert an FXY value from its 6 character representation to its WMO bit-wise representation. More...
 
integer(c_int) function, public igetmxby_c ()
 Get the maximum length of a BUFR message that can be written to an output file. More...
 
integer(c_int) function, public igetntbi_c (lun, table_type)
 Get the next index for storing an entry within an internal DX BUFR table. More...
 
integer(c_int) function, public igetprm_c (cprmnm)
 Get the current value of a parameter. More...
 
integer(c_int) function, public igettdi_c (iflag)
 Get the next usable Table D index for the current master table, or reset the index. More...
 
integer(c_int) function, public imrkopr_c (nemo)
 Check whether a specified mnemonic is a Table C marker operator. More...
 
integer(c_int) function, public ireadmg_c (bufr_unit, c_subset, iddate, subset_str_len)
 Read the next message from a BUFR file. More...
 
integer(c_int) function, public ireadns_c (bufr_unit, c_subset, iddate, subset_str_len)
 Read the next data subset from a BUFR file. More...
 
integer(c_int) function, public ireadsb_c (bufr_unit)
 Read the next data subset from a BUFR message. More...
 
integer(c_int) function, public isetprm_c (cprmnm, ipval)
 Define a customized parameter value for dynamic allocation. More...
 
integer(c_int) function, public istdesc_c (idn)
 Check whether a descriptor is WMO-standard. More...
 
integer(c_int) function, public iupb_c (mbay, nbyt, nbit)
 Decode an integer value from an integer array. More...
 
integer(c_int) function, public iupbs01_c (bufr, mnemonic)
 Read a data value from Section 0 or Section 1 of a BUFR message. More...
 
subroutine, public maxout_c (max0)
 Define a customized maximum length for output BUFR messages. More...
 
subroutine, public mtinfo_c (path, file_unit_1, file_unit_2)
 Specify location of master BUFR tables on local file system. More...
 
subroutine, public nemdefs_c (file_unit, mnemonic, unit_c, unit_str_len, desc_c, desc_str_len, iret)
 Get the element name and units associated with a Table B mnemonic. More...
 
subroutine, public nemspecs_c (file_unit, mnemonic, mnemonic_idx, scale, reference, bits, iret)
 Get the scale factor, reference value and bit width associated with a specified occurrence of a Table B mnemonic. More...
 
subroutine, public nemtab_c (lun, mnemonic, descriptor, table_type, table_idx)
 Get information about a descriptor. More...
 
subroutine, public nemtbb_c (lun, table_idx, unit_str, unit_str_len, scale, reference, bits)
 Get information about a Table B descriptor. More...
 
subroutine, public numtbd_c (lun, idn, nemo, nemo_str_len, tab, iret)
 Search for a Table B or Table D descriptor within the internal DX BUFR tables. More...
 
subroutine, public open_c (lunit, filepath)
 Open a Fortran file from a C program. More...
 
subroutine, public openbf_c (bufr_unit, cio, table_file_id)
 Connect a new file to the library, or initialize the library, or change verbosity associated with already-connected file. More...
 
subroutine, public openmb_c (bufr_unit, c_subset, iddate)
 Open a new message for output in a BUFR file that was previously opened for writing. More...
 
subroutine, public pktdd_c (id, lun, idn, iret)
 Store information about a child mnemonic within the internal arrays. More...
 
subroutine, public status_c (file_unit, lun, il, im)
 Check whether a file is connected to the library. More...
 
subroutine, public stntbi_c (n, lun, numb, nemo, celsq)
 Store a new entry within the internal BUFR Table B or D. More...
 
subroutine, public strnum_c (str, num, iret)
 Decode an integer from a character string. More...
 
subroutine, public ufbint_c (bufr_unit, c_data, dim_1, dim_2, iret, table_b_mnemonic)
 Read/write one or more data values from/to a data subset. More...
 
subroutine, public ufbrep_c (bufr_unit, c_data, dim_1, dim_2, iret, table_b_mnemonic)
 Read/write one or more data values from/to a data subset. More...
 
subroutine, public ufbseq_c (bufr_unit, c_data, dim_1, dim_2, iret, table_d_mnemonic)
 Read/write an entire sequence of data values from/to a data subset. More...
 
subroutine, public uptdd_c (id, lun, ient, iret)
 Get the WMO bit-wise representation of the FXY value corresponding to a child mnemonic of a Table D sequence. More...
 
subroutine, public wrdlen_c ()
 Determine important information about the local machine. More...
 

Detailed Description

Wrap Fortran NCEPLIBS-bufr subprograms and variables so they can be called from within C.

Local copies of some Fortran variables are stored as allocatable objects, especially isc, link, jmpb, tag and typ. It's the application program's responsibility to call delete_table_data_f in order to properly delete these variables.

Author
Ronald Mclaren
Date
2020-07-29

Function/Subroutine Documentation

◆ bort_c()

subroutine, public bufr_c2f_interface::bort_c ( character(kind=c_char, len=1), dimension(*), intent(in)  errstr)

Log one error message and abort application program.

Wraps bort() subroutine.

Parameters
errstr- Error message.
Author
J. Ator
Date
2023-04-07

Definition at line 1015 of file bufr_c2f_interface.F90.

References bort().

◆ bvers_c()

subroutine, public bufr_c2f_interface::bvers_c ( character(kind=c_char, len=1), dimension(*), intent(out)  cverstr,
integer(c_int), intent(in), value  cverstr_len 
)

Get the version number of the NCEPLIBS-bufr software.

Wraps bvers() subroutine.

Parameters
cverstr- Version string.
cverstr_len- Length of the version string.
Author
J. Ator
Date
2023-04-07

Definition at line 1046 of file bufr_c2f_interface.F90.

References bvers().

◆ cadn30_c()

subroutine, public bufr_c2f_interface::cadn30_c ( integer(c_int), intent(in), value  idn,
character(kind=c_char, len=1), dimension(*), intent(out)  adn,
integer(c_int), intent(in), value  adn_str_len 
)

Convert an FXY value from its WMO bit-wise representation to its six-character representation.

Wraps cadn30() function.

Parameters
idn- WMO bit-wise representation of FXY value.
adn- FXY value.
adn_str_len- Length of adn string.
Author
J. Ator
Date
2023-04-07

Definition at line 701 of file bufr_c2f_interface.F90.

References cadn30().

◆ closbf_c()

subroutine, public bufr_c2f_interface::closbf_c ( integer(c_int), intent(in), value  bufr_unit)

Close a previously opened file and disconnect it from the library.

Wraps closbf() subroutine.

Parameters
bufr_unit- Fortran logical unit number to close
Author
Ronald McLaren
Date
2020-07-29

Definition at line 137 of file bufr_c2f_interface.F90.

References closbf().

◆ close_c()

subroutine, public bufr_c2f_interface::close_c ( integer(c_int), intent(in), value  lunit)

Close a Fortran file from a C program.

Parameters
lunit- Fortran logical unit
Author
Ronald McLaren
Date
2020-07-29

Definition at line 106 of file bufr_c2f_interface.F90.

◆ delete_table_data_c()

subroutine, public bufr_c2f_interface::delete_table_data_c

Deletes the copies of the moda_tables arrays.

Author
Ronald McLaren
Date
2022-03-23

Definition at line 593 of file bufr_c2f_interface.F90.

◆ elemdx_c()

subroutine, public bufr_c2f_interface::elemdx_c ( character(kind=c_char, len=1), dimension(*), intent(in)  card,
integer(c_int), intent(in), value  lun 
)

Decode the scale factor, reference value, bit width, and units from a Table B mnemonic definition.

Wraps elemdx() subroutine.

Parameters
card- Mnemonic definition card.
lun- File ID.
Author
J. Ator
Date
2003-11-04

Definition at line 741 of file bufr_c2f_interface.F90.

References elemdx().

◆ exitbufr_c()

subroutine, public bufr_c2f_interface::exitbufr_c

Reset the library.

Wraps exitbufr() subroutine.

Author
Ronald McLaren
Date
2020-07-29

Definition at line 148 of file bufr_c2f_interface.F90.

References exitbufr().

◆ get_inode_c()

subroutine, public bufr_c2f_interface::get_inode_c ( integer(c_int), intent(in), value  lun,
integer(c_int), intent(out)  start_node 
)

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

Parameters
lun- File ID.
start_node- The start node of the subset
Author
Ronald McLaren
Date
2022-03-23

Definition at line 534 of file bufr_c2f_interface.F90.

References moda_msgcwd::inode.

◆ get_inv_c()

subroutine, public bufr_c2f_interface::get_inv_c ( integer(c_int), intent(in), value  lun,
type(c_ptr), intent(inout)  inv_ptr,
integer(c_int), intent(out)  inv_size 
)

Get pointer to the moda_usrint INV array.

Parameters
lun- File ID.
inv_ptr- C-style pointer to the INV array
inv_size- Length of the array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 580 of file bufr_c2f_interface.F90.

References moda_usrint::inv.

◆ get_irf_c()

subroutine, public bufr_c2f_interface::get_irf_c ( type(c_ptr), intent(inout)  irf_ptr,
integer(c_int), intent(out)  irf_size 
)

Get copy of the moda_tables IRF array.

Parameters
irf_ptr- C-style pointer to the IRF array
irf_size- Length of the array
Author
Ronald McLaren
Date
2023-04-05

Definition at line 517 of file bufr_c2f_interface.F90.

References moda_tables::irf, and moda_tables::ntab.

◆ get_isc_c()

subroutine, public bufr_c2f_interface::get_isc_c ( type(c_ptr), intent(inout)  isc_ptr,
integer(c_int), intent(out)  isc_size 
)

Get copy of the moda_tables ISC array.

Parameters
isc_ptr- C-style pointer to the ISC array
isc_size- Size of the ISC array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 409 of file bufr_c2f_interface.F90.

References moda_tables::isc, and moda_tables::ntab.

◆ get_itp_c()

subroutine, public bufr_c2f_interface::get_itp_c ( type(c_ptr), intent(inout)  itp_ptr,
integer(c_int), intent(out)  itp_size 
)

Get copy of the moda_tables ITP array.

Parameters
itp_ptr- C-style pointer to the ITP array
itp_size- Size of the ITP array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 443 of file bufr_c2f_interface.F90.

References moda_tables::itp, and moda_tables::ntab.

◆ get_jmpb_c()

subroutine, public bufr_c2f_interface::get_jmpb_c ( type(c_ptr), intent(inout)  jmpb_ptr,
integer(c_int), intent(out)  jmpb_size 
)

Get copy of the moda_tables JMPB array.

Parameters
jmpb_ptr- C-style pointer to the JMPB array
jmpb_size- Length of the array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 500 of file bufr_c2f_interface.F90.

References moda_tables::jmpb, and moda_tables::ntab.

◆ get_link_c()

subroutine, public bufr_c2f_interface::get_link_c ( type(c_ptr), intent(inout)  link_ptr,
integer(c_int), intent(out)  link_size 
)

Get copy of the moda_tables LINK array.

Parameters
link_ptr- C-style pointer to the LINK array
link_size- Size of the LINK array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 426 of file bufr_c2f_interface.F90.

References moda_tables::link, and moda_tables::ntab.

◆ get_nval_c()

subroutine, public bufr_c2f_interface::get_nval_c ( integer(c_int), intent(in), value  lun,
integer(c_int), intent(out)  num_nodes 
)

Get the number of values in the current subset.

Parameters
lun- File ID.
num_nodes- number of values in the subset
Author
Ronald McLaren
Date
2022-03-23

Definition at line 548 of file bufr_c2f_interface.F90.

References moda_usrint::nval.

◆ get_tag_c()

subroutine, public bufr_c2f_interface::get_tag_c ( type(c_ptr), intent(inout)  tag_ptr,
integer(c_int), intent(out)  tag_len,
integer(c_int), intent(out)  mem_size 
)

Get copy of the moda_tables TAG array.

Parameters
tag_ptr- C-style pointer to the TAG array
tag_len- Length of the tag string
mem_size- Size of TAG array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 481 of file bufr_c2f_interface.F90.

References moda_tables::ntab, and moda_tables::tag.

◆ get_typ_c()

subroutine, public bufr_c2f_interface::get_typ_c ( type(c_ptr), intent(inout)  typ_ptr,
integer(c_int), intent(out)  typ_len,
integer(c_int), intent(out)  mem_size 
)

Get copy of the moda_tables TYP array.

Parameters
typ_ptr- C-style pointer to the TYP array
typ_len- Size of each string within the TYP array
mem_size- Size of the TYP array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 461 of file bufr_c2f_interface.F90.

References moda_tables::ntab, and moda_tables::typ.

◆ get_val_c()

subroutine, public bufr_c2f_interface::get_val_c ( integer(c_int), intent(in), value  lun,
type(c_ptr), intent(inout)  val_ptr,
integer(c_int), intent(out)  val_size 
)

Get pointer to the moda_usrint VAL array.

Parameters
lun- File ID.
val_ptr- C-style pointer to the VAL array
val_size- Length of the array
Author
Ronald McLaren
Date
2022-03-23

Definition at line 563 of file bufr_c2f_interface.F90.

References moda_usrint::val.

◆ ibfms_c()

integer(c_int) function, public bufr_c2f_interface::ibfms_c ( real(c_double), intent(in), value  r8val)

Test whether a data value is "missing".

Wraps ibfms() function.

Parameters
r8val- Data value.
Returns
ibfms_c - 1 if r8val is "missing", or 0 otherwise.
Author
J. Ator
Date
2023-04-07

Definition at line 916 of file bufr_c2f_interface.F90.

References ibfms().

◆ ifxy_c()

integer(c_int) function, public bufr_c2f_interface::ifxy_c ( character(kind=c_char, len=1), dimension(*), intent(in)  cfxy)

Convert an FXY value from its 6 character representation to its WMO bit-wise representation.

Wraps ifxy() function.

Parameters
cfxy- FXY value.
Returns
ifxy_c - WMO bit-wise representation of FXY value.
Author
J. Ator
Date
2023-04-07

Definition at line 789 of file bufr_c2f_interface.F90.

References ifxy().

◆ igetmxby_c()

integer(c_int) function, public bufr_c2f_interface::igetmxby_c

Get the maximum length of a BUFR message that can be written to an output file.

Wraps igetmxby() function.

Returns
igetmxby_c - Maximum length of a BUFR message that can be written to an output file.
Author
J. Ator
Date
2023-04-07

Definition at line 684 of file bufr_c2f_interface.F90.

References igetmxby().

◆ igetntbi_c()

integer(c_int) function, public bufr_c2f_interface::igetntbi_c ( integer(c_int), intent(in), value  lun,
character(kind=c_char,len=1), dimension(*), intent(in)  table_type 
)

Get the next index for storing an entry within an internal DX BUFR table.

Wraps igetntbi() subroutine.

Parameters
lun- File ID.
table_type- Type of internal DX BUFR table ('A', 'B', or 'D')
Returns
igetntbi_c - Next available index within table_type.
Author
Ronald McLaren
Date
2022-08-16

Definition at line 720 of file bufr_c2f_interface.F90.

References igetntbi().

◆ igetprm_c()

integer(c_int) function, public bufr_c2f_interface::igetprm_c ( character(kind=c_char, len=1), dimension(*), intent(in)  cprmnm)

Get the current value of a parameter.

Wraps igetprm() function.

Parameters
cprmnm- Parameter.
Returns
igetprm_c - Value corresponding to cprmnm, or -1 if not found or other error occurred.
Author
J. Ator
Date
2023-04-07

Definition at line 634 of file bufr_c2f_interface.F90.

References igetprm().

◆ igettdi_c()

integer(c_int) function, public bufr_c2f_interface::igettdi_c ( integer(c_int), intent(in), value  iflag)

Get the next usable Table D index for the current master table, or reset the index.

Wraps igettdi() function.

Parameters
iflag- if 0, will reset the index.
Returns
igettdi_c - -1 if iflag=0, otherwise the next usable index.
Author
J. Ator
Date
2023-04-07

Definition at line 981 of file bufr_c2f_interface.F90.

References igettdi().

◆ imrkopr_c()

integer(c_int) function, public bufr_c2f_interface::imrkopr_c ( character(kind=c_char, len=1), dimension(*), intent(in)  nemo)

Check whether a specified mnemonic is a Table C marker operator.

Wraps imrkopr() function.

Parameters
nemo- Mnemonic.
Returns
imrkopr_c - 1 if nemo is a Table C marker operator, else 0.
Author
J. Ator
Date
2023-04-07

Definition at line 829 of file bufr_c2f_interface.F90.

References imrkopr().

◆ ireadmg_c()

integer(c_int) function, public bufr_c2f_interface::ireadmg_c ( integer(c_int), intent(in), value  bufr_unit,
character(kind=c_char, len=1), dimension(*), intent(out)  c_subset,
integer(c_int), intent(out)  iddate,
integer(c_int), intent(in), value  subset_str_len 
)

Read the next message from a BUFR file.

Wraps ireadmg() function.

Parameters
bufr_unit- Fortran logical unit number to read from
c_subset- Subset string
iddate- Datetime of message
subset_str_len- Length of the subset string
Returns
ireadmg_c - Return code:
  • 0 new BUFR message was successfully read into internal arrays.
  • -1 there are no more BUFR messages in bufr_unit.
Author
Ronald McLaren
Date
2020-07-29

Definition at line 166 of file bufr_c2f_interface.F90.

References ireadmg().

◆ ireadns_c()

integer(c_int) function, public bufr_c2f_interface::ireadns_c ( integer(c_int), intent(in), value  bufr_unit,
character(kind=c_char, len=1), dimension(*), intent(out)  c_subset,
integer(c_int), intent(out)  iddate,
integer(c_int), intent(in), value  subset_str_len 
)

Read the next data subset from a BUFR file.

Wraps ireadns() function.

Parameters
bufr_unit- Fortran logical unit number to read from.
c_subset- Subset string.
iddate- Datetime of message.
subset_str_len- Length of the subset string.
Returns
ireadns_c - Return code:
  • 0 new BUFR data subset was successfully read into internal arrays.
  • -1 there are no more BUFR data subsets in bufr_unit.
Author
J. Ator
Date
2023-04-07

Definition at line 891 of file bufr_c2f_interface.F90.

References ireadns().

◆ ireadsb_c()

integer(c_int) function, public bufr_c2f_interface::ireadsb_c ( integer(c_int), intent(in), value  bufr_unit)

Read the next data subset from a BUFR message.

Wraps ireadsb() function.

Parameters
bufr_unit- Fortran logical unit number to read from
Returns
ireadsb_c - Return code:
  • 0 new BUFR data subset was successfully read into internal arrays.
  • -1 there are no more BUFR data subsets in the BUFR message associated with bufr_unit
Author
Ronald McLaren
Date
2020-07-29

Definition at line 192 of file bufr_c2f_interface.F90.

References ireadsb().

◆ isetprm_c()

integer(c_int) function, public bufr_c2f_interface::isetprm_c ( character(kind=c_char, len=1), dimension(*), intent(in)  cprmnm,
integer(c_int), intent(in), value  ipval 
)

Define a customized parameter value for dynamic allocation.

Wraps isetprm() function.

Parameters
cprmnm- Parameter.
ipval- Value to be set for cprmnm.
Returns
isetprm_c - 0 if successful, or -1 if cprmnm unknown.
Author
J. Ator
Date
2023-04-07

Definition at line 652 of file bufr_c2f_interface.F90.

References isetprm().

◆ istdesc_c()

integer(c_int) function, public bufr_c2f_interface::istdesc_c ( integer(c_int), intent(in), value  idn)

Check whether a descriptor is WMO-standard.

Wraps istdesc() function.

Parameters
idn- WMO bit-wise representation of FXY value for descriptor.
Returns
istdesc_c - 1 if idn is WMO-standard, else 0.
Author
J. Ator
Date
2023-04-07

Definition at line 846 of file bufr_c2f_interface.F90.

References istdesc().

◆ iupb_c()

integer(c_int) function, public bufr_c2f_interface::iupb_c ( integer(c_int), dimension(*), intent(in)  mbay,
integer(c_int), intent(in), value  nbyt,
integer(c_int), intent(in), value  nbit 
)

Decode an integer value from an integer array.

Wraps iupb() function.

Parameters
mbay- Array containing encoded value.
nbyt- Byte within mbay at whose first bit to begin decoding.
nbit- Number of bits to decode.
Returns
iupb_c - Decoded value.
Author
J. Ator
Date
2023-04-07

Definition at line 1075 of file bufr_c2f_interface.F90.

References cmpmsg(), and iupb().

◆ iupbs01_c()

integer(c_int) function, public bufr_c2f_interface::iupbs01_c ( integer(c_int), dimension(*), intent(in)  bufr,
character(kind=c_char, len=1), dimension(*), intent(in)  mnemonic 
)

Read a data value from Section 0 or Section 1 of a BUFR message.

Wraps iupbs01() function.

Parameters
bufr- BUFR message.
mnemonic- Value to be read from Section 0 or Section 1 of BUFR message.
Returns
iupbs01_c - Value corresponding to mnemonic, or -1 if not found or other error occurred.
Author
J. Ator
Date
2023-04-07

Definition at line 615 of file bufr_c2f_interface.F90.

References iupbs01().

◆ maxout_c()

subroutine, public bufr_c2f_interface::maxout_c ( integer(c_int), intent(in), value  max0)

Define a customized maximum length for output BUFR messages.

Wraps maxout() subroutine.

Parameters
max0- New maximum length (in bytes) for all BUFR messages written to all output files.
Author
J. Ator
Date
2023-04-07

Definition at line 669 of file bufr_c2f_interface.F90.

References maxout().

◆ mtinfo_c()

subroutine, public bufr_c2f_interface::mtinfo_c ( character(kind=c_char, len=1), dimension(*), intent(in)  path,
integer(c_int), intent(in), value  file_unit_1,
integer(c_int), intent(in), value  file_unit_2 
)

Specify location of master BUFR tables on local file system.

Wraps mtinfo() subroutine.

Parameters
path- 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
Author
Ronald McLaren
Date
2020-07-29

Definition at line 255 of file bufr_c2f_interface.F90.

References mtinfo().

◆ nemdefs_c()

subroutine, public bufr_c2f_interface::nemdefs_c ( integer(c_int), intent(in), value  file_unit,
character(kind=c_char,len=1), dimension(*), intent(in)  mnemonic,
character(kind=c_char, len=1), dimension(*), intent(out)  unit_c,
integer(c_int), intent(in), value  unit_str_len,
character(kind=c_char, len=1), dimension(*), intent(out)  desc_c,
integer(c_int), intent(in), value  desc_str_len,
integer(c_int), intent(out)  iret 
)

Get the element name and units associated with a Table B mnemonic.

Wraps nemdefs() subroutine.

Parameters
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- Return value. 0 indicates success -1 indicates failure.
Author
Ronald McLaren
Date
2022-08-08

Definition at line 295 of file bufr_c2f_interface.F90.

References nemdefs().

◆ nemspecs_c()

subroutine, public bufr_c2f_interface::nemspecs_c ( integer(c_int), intent(in), value  file_unit,
character(kind=c_char,len=1), dimension(*), intent(in)  mnemonic,
integer(c_int), intent(in), value  mnemonic_idx,
integer(c_int), intent(out)  scale,
integer(c_int), intent(out)  reference,
integer(c_int), intent(out)  bits,
integer(c_int), intent(out)  iret 
)

Get the scale factor, reference value and bit width associated with a specified occurrence of a Table B mnemonic.

Wraps nemspecs() subroutine.

Parameters
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 value of element.
bits- Number of bits representing the element.
iret- Return value. 0 indicates success -1 indicates failure.
Author
Ronald McLaren
Date
2022-08-08

Definition at line 333 of file bufr_c2f_interface.F90.

References nemspecs().

◆ nemtab_c()

subroutine, public bufr_c2f_interface::nemtab_c ( integer(c_int), intent(in), value  lun,
character(kind=c_char,len=1), dimension(*), intent(in)  mnemonic,
integer(c_int), intent(out)  descriptor,
character(kind=c_char,len=1), dimension(*), intent(out)  table_type,
integer(c_int), intent(out)  table_idx 
)

Get information about a descriptor.

Wraps nemtab() subroutine.

Parameters
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
Author
Ronald McLaren
Date
2022-08-16

Definition at line 358 of file bufr_c2f_interface.F90.

References nemtab().

◆ nemtbb_c()

subroutine, public bufr_c2f_interface::nemtbb_c ( integer(c_int), intent(in), value  lun,
integer(c_int), intent(in), value  table_idx,
character(kind=c_char,len=1), dimension(*), intent(out)  unit_str,
integer(c_int), intent(in), value  unit_str_len,
integer(c_int), intent(out)  scale,
integer(c_int), intent(out)  reference,
integer(c_int), intent(out)  bits 
)

Get information about a Table B descriptor.

Wraps nemtbb() subroutine.

Parameters
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 the element.
Author
Ronald McLaren
Date
2022-08-16

Definition at line 386 of file bufr_c2f_interface.F90.

References nemtbb().

◆ numtbd_c()

subroutine, public bufr_c2f_interface::numtbd_c ( integer(c_int), intent(in), value  lun,
integer(c_int), intent(in), value  idn,
character(kind=c_char,len=1), dimension(*), intent(out)  nemo,
integer(c_int), intent(in), value  nemo_str_len,
character(kind=c_char,len=1), dimension(*), intent(out)  tab,
integer(c_int), intent(out)  iret 
)

Search for a Table B or Table D descriptor within the internal DX BUFR tables.

Wraps numtbd() subroutine.

Parameters
lun- File ID.
idn- Bit-wise representation of FXY value.
nemo- Mnemonic.
nemo_str_len- Length of nemo string.
tab- Type of internal DX BUFR table ('B', or 'D').
iret- Positional index of idn within Table B or D, or 0 if not found.
Author
J. Ator
Date
2003-11-04

Definition at line 765 of file bufr_c2f_interface.F90.

References numtbd().

◆ open_c()

subroutine, public bufr_c2f_interface::open_c ( integer(c_int), intent(in), value  lunit,
character(kind=c_char, len=1)  filepath 
)

Open a Fortran file from a C program.

Parameters
lunit- Fortran logical unit
filepath- Path to the file we want to open.
Author
Ronald McLaren
Date
2020-07-29

Definition at line 94 of file bufr_c2f_interface.F90.

◆ openbf_c()

subroutine, public bufr_c2f_interface::openbf_c ( integer(c_int), intent(in), value  bufr_unit,
character(kind=c_char, len=1), dimension(*), intent(in)  cio,
integer(c_int), intent(in), value  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.

Parameters
bufr_unit- Fortran logical unit number
cio- cio string
table_file_id- table_file unit number
Author
Ronald McLaren
Date
2020-07-29

Definition at line 122 of file bufr_c2f_interface.F90.

References openbf().

◆ openmb_c()

subroutine, public bufr_c2f_interface::openmb_c ( integer(c_int), intent(in), value  bufr_unit,
character(kind=c_char, len=1), dimension(*), intent(in)  c_subset,
integer(c_int), intent(in), value  iddate 
)

Open a new message for output in a BUFR file that was previously opened for writing.

Wraps openmb() subroutine.

Parameters
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.
Author
J. Ator
Date
2023-04-07

Definition at line 1031 of file bufr_c2f_interface.F90.

References openmb().

◆ pktdd_c()

subroutine, public bufr_c2f_interface::pktdd_c ( integer(c_int), intent(in), value  id,
integer(c_int), intent(in), value  lun,
integer(c_int), intent(in), value  idn,
integer(c_int), intent(out)  iret 
)

Store information about a child mnemonic within the internal arrays.

Wraps pktdd() subroutine.

Parameters
id- Index of parent mnemonic within internal BUFR Table D array.
lun- File ID.
idn- WMO bit-wise representation of FXY value corresponding to child mnemonic; set to 0 to delete all child mnemonic information.
iret- 0 if idn=0; -1 if error occurred; otherwise, the total number of child mnemonics stored so far for parent mnemonic id.
Author
J. Ator
Date
2023-04-07

Definition at line 1001 of file bufr_c2f_interface.F90.

References pktdd().

◆ status_c()

subroutine, public bufr_c2f_interface::status_c ( integer(c_int), intent(in), value  file_unit,
integer(c_int), intent(out)  lun,
integer(c_int), intent(out)  il,
integer(c_int), intent(out)  im 
)

Check whether a file is connected to the library.

Wraps status() subroutine.

Parameters
file_unit- Fortran logical unit number of file.
lun- File ID.
il- File status.
im- Message status.
Author
Ronald McLaren
Date
2022-03-23

Definition at line 273 of file bufr_c2f_interface.F90.

References status().

◆ stntbi_c()

subroutine, public bufr_c2f_interface::stntbi_c ( integer(c_int), intent(in), value  n,
integer(c_int), intent(in), value  lun,
character(kind=c_char, len=1), dimension(*), intent(in)  numb,
character(kind=c_char, len=1), dimension(*), intent(in)  nemo,
character(kind=c_char, len=1), dimension(*), intent(in)  celsq 
)

Store a new entry within the internal BUFR Table B or D.

Wraps stntbi() subroutine.

Parameters
n- Storage index into internal Table B or D.
lun- File ID.
numb- FXY number for new entry.
nemo- Mnemonic corresponding to numb.
celsq- Element or sequence description corresponding to numb.
Author
J. Ator
Date
2023-04-07

Definition at line 951 of file bufr_c2f_interface.F90.

References stntbi().

◆ strnum_c()

subroutine, public bufr_c2f_interface::strnum_c ( character(kind=c_char, len=1), dimension(*), intent(in)  str,
integer(c_int), intent(out)  num,
integer(c_int), intent(out)  iret 
)

Decode an integer from a character string.

Wraps strnum() subroutine.

Parameters
str- String.
num- Value decoded from str.
iret- 0 if successful, -1 otherwise.
Author
J. Ator
Date
2003-11-04

Definition at line 933 of file bufr_c2f_interface.F90.

References strnum().

◆ ufbint_c()

subroutine, public bufr_c2f_interface::ufbint_c ( integer(c_int), intent(in), value  bufr_unit,
type(c_ptr), intent(inout)  c_data,
integer(c_int), intent(in), value  dim_1,
integer(c_int), intent(in), value  dim_2,
integer(c_int), intent(out)  iret,
character(kind=c_char, len=1), dimension(*), intent(in)  table_b_mnemonic 
)

Read/write one or more data values from/to a data subset.

Wraps ufbint() subroutine.

Parameters
bufr_unit- Fortran logical unit number to read from
c_data- C-style pointer to a pre-allocated buffer
dim_1,dim_2- Dimensionality of data to read or write
iret- Return value, length of data read
table_b_mnemonic- String of mnemonics
Author
Ronald McLaren
Date
2020-07-29

Definition at line 211 of file bufr_c2f_interface.F90.

References ufbint().

◆ ufbrep_c()

subroutine, public bufr_c2f_interface::ufbrep_c ( integer(c_int), intent(in), value  bufr_unit,
type(c_ptr), intent(inout)  c_data,
integer(c_int), intent(in), value  dim_1,
integer(c_int), intent(in), value  dim_2,
integer(c_int), intent(out)  iret,
character(kind=c_char, len=1), dimension(*), intent(in)  table_b_mnemonic 
)

Read/write one or more data values from/to a data subset.

Wraps ufbrep() subroutine.

Parameters
bufr_unit- Fortran logical unit number to read from
c_data- C-style pointer to a pre-allocated buffer
dim_1,dim_2- Dimensionality of data to read or write
iret- Return value, length of data read
table_b_mnemonic- String of mnemonics
Author
Ronald McLaren
Date
2020-07-29

Definition at line 234 of file bufr_c2f_interface.F90.

References ufbrep().

◆ ufbseq_c()

subroutine, public bufr_c2f_interface::ufbseq_c ( integer(c_int), intent(in), value  bufr_unit,
type(c_ptr), intent(inout)  c_data,
integer(c_int), intent(in), value  dim_1,
integer(c_int), intent(in), value  dim_2,
integer(c_int), intent(out)  iret,
character(kind=c_char, len=1), dimension(*), intent(in)  table_d_mnemonic 
)

Read/write an entire sequence of data values from/to a data subset.

Wraps ufbseq() subroutine.

Parameters
bufr_unit- Fortran logical unit number to read from
c_data- C-style pointer to a pre-allocated buffer
dim_1,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.
Author
J. Ator
Date
2023-04-07

Definition at line 865 of file bufr_c2f_interface.F90.

References ufbseq().

◆ uptdd_c()

subroutine, public bufr_c2f_interface::uptdd_c ( integer(c_int), intent(in), value  id,
integer(c_int), intent(in), value  lun,
integer(c_int), intent(in), value  ient,
integer(c_int), intent(out)  iret 
)

Get the WMO bit-wise representation of the FXY value corresponding to a child mnemonic of a Table D sequence.

Wraps uptdd() subroutine.

Parameters
id- Positional index of parent mnemonic within internal BUFR Table D array.
lun- File ID.
ient- Ordinal indicator of child mnemonic to return from within parent sequence; set to 0 to request a count of the total number of child mnemonics.
iret- Total number of child mnemonics if ient = 0; otherwise the WMO bit-wise representation of the FXY value corresponding to the ient'th mnemonic.
Author
J. Ator
Date
2023-04-07

Definition at line 813 of file bufr_c2f_interface.F90.

References uptdd().

◆ wrdlen_c()

subroutine, public bufr_c2f_interface::wrdlen_c

Determine important information about the local machine.

Wraps wrdlen() subroutine.

Author
J. Ator
Date
2023-04-07

Definition at line 1060 of file bufr_c2f_interface.F90.

References wrdlen().