123 RECURSIVE SUBROUTINE openbf(LUNIT,IO,LUNDX)
141 CHARACTER*255 filename,fileacc
142 CHARACTER*128 bort_str,errstr
143 CHARACTER*28 cprint(0:3)
147 .
' (limited - default) ',
148 .
' (all warnings) ',
149 .
' (all warning+informational)'/
160 CALL x84(lunit,my_lunit,1)
161 CALL x84(lundx,my_lundx,1)
162 CALL openbf(my_lunit,io,my_lundx)
174 IF(io.EQ.
'QUIET')
THEN
178 IF(iprt.LT.-1) iprt = -1
179 IF(iprt.GT. 2) iprt = 2
181 CALL errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
182 WRITE ( unit=errstr, fmt=
'(A,I3,A,A,I3,A)' )
183 .
'BUFRLIB: OPENBF - DEGREE OF MESSAGE PRINT INDICATOR '//
184 .
'CHNGED FROM',iprtprv,cprint(iprtprv+1),
' TO',iprt,cprint(iprt+1)
186 CALL errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
210 IF(io.EQ.
'FIRST')
GOTO 100
211 IF(io.EQ.
'QUIET')
GOTO 100
216 CALL status(lunit,lun,il,im)
217 IF(lun.EQ.0)
GOTO 900
218 IF(il .NE.0)
GOTO 901
227 IF (io.NE.
'NUL' .AND. io.NE.
'INUL')
THEN
228 INQUIRE(lunit,access=fileacc)
229 IF(fileacc==
'UNDEFINED')
OPEN(lunit)
230 INQUIRE(lunit,name=filename)
231 filename=trim(filename)//char(0)
248 CALL wtstat(lunit,lun,-1,0)
249 CALL readdx(lunit,lun,lundx)
250 ELSE IF(io.EQ.
'INUL')
THEN
251 CALL wtstat(lunit,lun,-1,0)
252 IF(lunit.NE.lundx)
CALL readdx(lunit,lun,lundx)
254 ELSE IF(io.EQ.
'NUL')
THEN
255 CALL wtstat(lunit,lun, 1,0)
256 IF(lunit.NE.lundx)
CALL readdx(lunit,lun,lundx)
258 ELSE IF(io.EQ.
'INX')
THEN
260 CALL wtstat(lunit,lun,-1,0)
262 ELSE IF(io.EQ.
'OUX')
THEN
264 CALL wtstat(lunit,lun, 1,0)
265 ELSE IF(io.EQ.
'SEC3')
THEN
267 CALL wtstat(lunit,lun,-1,0)
269 ELSE IF(io.EQ.
'OUT')
THEN
271 CALL wtstat(lunit,lun, 1,0)
272 CALL writdx(lunit,lun,lundx)
273 ELSE IF(io.EQ.
'NODX')
THEN
275 CALL wtstat(lunit,lun, 1,0)
276 CALL readdx(lunit,lun,lundx)
277 ELSE IF(io.EQ.
'APN' .OR. io.EQ.
'APX')
THEN
279 CALL wtstat(lunit,lun, 1,0)
280 IF(lunit.NE.lundx)
CALL readdx(lunit,lun,lundx)
293 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
294 WRITE ( unit=errstr, fmt=
'(A,I3,A)' )
295 .
'BUFRLIB: OPENBF - INPUT BUFR FILE IN UNIT ', lunit,
298 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
301 CALL wtstat(lunit,lun,-1,0)
312 900
WRITE(bort_str,
'("BUFRLIB: OPENBF - THERE ARE ALREADY",I3,'//
313 .
'" BUFR FILES OPENED, CANNOT OPEN FILE CONNECTED TO UNIT",I4)')
316 901
WRITE(bort_str,
'("BUFRLIB: OPENBF - THE FILE CONNECTED TO UNIT"'//
317 .
',I5," IS ALREADY OPEN")') lunit
319 904
CALL bort(
'BUFRLIB: OPENBF - SECOND (INPUT) ARGUMENT MUST BE'//
320 .
' "IN", "OUT", "NODX", "NUL", "APN", "APX", "SEC3"'//
subroutine arallocf
This subroutine is called internally during the first call to subroutine openbf() from an application...
subroutine bfrini
This subroutine initializes numerous global variables and arrays within internal modules and COMMON b...
subroutine bort(STR)
Log one error message and abort application program.
subroutine dxinit(LUN, IOI)
This subroutine initializes the internal arrays (in module moda_tababd) holding the DX BUFR table.
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
Wrap C NCEPLIBS-bufr functions so they can be called from within the Fortran part of the library.
This module contains a declaration for an array used by subroutine makestab() to keep track of which ...
integer, dimension(:), allocatable lus
Tracking index for each I/O internal stream index.
This module contains declarations for arrays used to store information about the current BUFR message...
integer, dimension(:), allocatable inode
Table A mnemonic for type of BUFR message.
integer, dimension(:), allocatable idate
Section 1 date-time of message.
integer, dimension(:), allocatable nmsg
Current message pointer within logical unit.
integer, dimension(:), allocatable msub
Total number of data subsets in message.
integer, dimension(:), allocatable nsub
Current subset pointer within message.
This module contains an array declaration used to store a switch for each internal I/O stream index,...
integer, dimension(:), allocatable null
Output switch for each internal I/O stream index:
This module contains an array declaration used to store a switch for each internal I/O stream index,...
integer, dimension(:), allocatable isc3
Section 3 switch for each internal I/O stream index:
This module contains array declarations used to store file and message status indicators for all logi...
This module contains an array declaration used to store a status code for each internal I/O stream in...
integer, dimension(:), allocatable iscodes
Abnormal status codes.
This module declares and initializes the IFOPBF variable.
integer, public ifopbf
Status indicator to keep track of whether subroutine openbf() has already been called:
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
This module declares and initializes the NFILES variable.
integer, public nfiles
Maximum number of BUFR files that can be connected to the BUFRLIB software (for reading or writing) a...
recursive subroutine openbf(LUNIT, IO, LUNDX)
Connects a new file to the NCEPLIBS-bufr software for input or output operations, or initializes the ...
subroutine posapx(LUNXX)
Reads to the end of the file pointed to by abs(LUNXX) and positions it for appending.
subroutine readdx(LUNIT, LUN, LUNDX)
This subroutine initializes modules moda_tababd and moda_msgcwd with DX BUFR (dictionary) tables.
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
subroutine wrdlen
Determine important information about the local machine.
subroutine writdx(LUNIT, LUN, LUNDX)
Write DX BUFR tables messages to the beginning of a BUFR file.
subroutine wtstat(LUNIT, LUN, IL, IM)
Update file status in library internals.
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.