NCEPLIBS-bufr
11.5.0
|
Connect a new system file to the BUFRLIB software for reading or writing BUFR messages. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | openbf (LUNIT, IO, LUNDX) |
This subroutine connects a new file to the BUFRLIB software for input or output operations. More... | |
Connect a new system file to the BUFRLIB software for reading or writing BUFR messages.
Definition in file openbf.F.
subroutine openbf | ( | LUNIT, | |
character*(*) | IO, | ||
LUNDX | |||
) |
This subroutine connects a new file to the BUFRLIB software for input or output operations.
[in] | LUNIT | - integer: Fortran logical unit number for BUFR file (unless IO is set to 'FIRST' or 'QUIET', in which case this is a dummy argument) |
[in] | IO | - character*(*): flag indicating how LUNIT is to be used by the software:
|
[in] | LUNDX | - integer:
|
The logical unit numbers LUNIT and LUNDX must already be associated with actual filenames on the local system, typically via a Fortran "OPEN" statement. Multiple logical units can be connected to the BUFRLIB software at any one time.
The argument IO is a character string describing how the file connected to LUNIT will be used, e.g. 'IN' is used to access an existing file of BUFR messages for input (i.e. reading/decoding BUFR), and 'OUT' is used to access a new file for output (i.e. writing/encoding BUFR). An option 'APX' is also available which behaves like 'OUT', except that output is then appended to an existing BUFR file rather than creating a new one from scratch, and there are also some additional options 'NUL' and 'NODX' which can likewise be used instead of 'OUT' for some very special cases as needed. There's also an option 'SEC3' which can be used in place of 'IN' for certain cases when the user is attempting to read BUFR messages whose content and descriptor layout are unknown in advance. However, all of these additional options are basically just variations of 'IN' or 'OUT', again depending on whether the intent is to read or write BUFR messages from the file connected to LUNIT. The only exceptions are when IO = 'FIRST' or 'QUIET'. When IO = 'FIRST', the subroutine simply checks whether it has already been called from within the application program and, if not, goes ahead and initializes the library without actually connecting any files in LUNIT or LUNDX. Alternatively, when IO = 'QUIET', the subroutine simply sets or resets the internal print verbosity switch to the value of input argument LUNDX, overriding its previous value and/or its internal default value of 0.
The third and final call argument LUNDX identifies the logical unit which contains the definition of the DX BUFR tables to be associated with unit LUNIT. Except when IO = 'SEC3', every BUFR file that is linked to the BUFRLIB software must have a DX BUFR tables file associated with it, and these tables may be defined within a separate ASCII text file (see Description and Format of DX BUFR Tables for more info.) or, in the case of an existing BUFR file, may be embedded within the first few BUFR messages of the file itself, and in which case the user can denote this to the subroutine by setting LUNDX to the same value as LUBFR.
Program history log:
Definition at line 157 of file openbf.F.
References arallocc(), arallocf(), bfrini(), bort(), dxinit(), errwrt(), openab(), openrb(), openwb(), posapx(), readdx(), status(), wrdlen(), writdx(), and wtstat().
Referenced by copybf(), datebf(), dumpbf(), fdebufr(), getbmiss(), igetmxby(), mesgbc(), mesgbf(), bufr_c_interface_mod::openbf_c(), pkvs01(), rdmgsb(), setblock(), setbmiss(), split_by_subset(), ufbinx(), ufbmem(), ufbmex(), and ufbtab().