71 RECURSIVE SUBROUTINE ufbtab(LUNIN,TAB,I1,I2,IRET,STR)
82 COMMON /usrstr/ nnod,ncon,nods(20),nodc(10),ivls(10),kons(10)
90 CHARACTER*8 subset,cval
91 equivalence(cval,rval)
92 INTEGER*8 ival,lref,ninc,mps,lps
93 LOGICAL openit,just_count
94 real*8 tab(i1,i2),rval,
ups
99 mps(node) = 2_8**(
ibt(node))-1
100 lps(lbit) = max(2_8**(lbit)-1,1)
109 CALL x84(lunin,my_lunin,1)
112 CALL ufbtab(my_lunin,tab,my_i1,my_i2,iret,str)
113 CALL x48(iret,iret,1)
132 just_count = lunin.LT.lunit
139 CALL status(lunit,lun,il,im)
147 CALL openbf(lunit,
'INX',lunit)
173 DO WHILE(
ireadmg(-lunit,subset,jdate).GE.0)
174 iret = iret+
nmsub(lunit)
182 CALL parstr(str,tgs,maxtg,ntg,
' ',.true.)
184 IF(tgs(i).EQ.
'IREC') irec = i
185 IF(tgs(i).EQ.
'ISUB') isub = i
191 10
IF(
ireadmg(-lunit,subset,jdate).LT.0)
GOTO 25
193 IF(irec.GT.0) nods(irec) = 0
194 IF(isub.GT.0) nods(isub) = 0
199 if(
msgunp(lun)==2)
goto 115
207 15
IF(
nsub(lun).EQ.
msub(lun))
GOTO 10
208 IF(iret+1.GT.i2)
GOTO 99
212 nods(i) = abs(nods(i))
224 20
IF(n+1.LE.
nval(lun))
THEN
229 IF(
itp(node).EQ.1)
THEN
230 CALL upb8(ival,nbit,mbit,
mbay(1,lun))
235 IF(nods(i).EQ.node)
THEN
236 IF(
itp(node).EQ.1)
THEN
237 CALL upb8(ival,nbit,mbit,
mbay(1,lun))
239 ELSEIF(
itp(node).EQ.2)
THEN
240 CALL upb8(ival,nbit,mbit,
mbay(1,lun))
241 IF(ival.LT.mps(node)) tab(i,iret) =
ups(ival,node)
242 ELSEIF(
itp(node).EQ.3)
THEN
245 CALL upc(cval,nbit/8,
mbay(1,lun),kbit,.true.)
253 IF(nods(i).GT.0)
GOTO 20
264 elseif(
msgunp(lun)==1)
then
269 IF(irec.GT.0) tab(irec,iret) =
nmsg(lun)
270 IF(isub.GT.0) tab(isub,iret) =
nsub(lun)
282 115
IF(iret+
msub(lun).GT.i2)
GOTO 99
287 IF(irec.GT.0.OR.isub.GT.0)
THEN
289 IF(irec.GT.0) tab(irec,iret+nsb) =
nmsg(lun)
290 IF(isub.GT.0) tab(isub,iret+nsb) = nsb
307 120
DO n=n+1,
nval(lun)
317 nods(i) = abs(nods(i))
321 IF(nods(i).GT.0)
GOTO 125
329 125
IF(ityp.EQ.1.OR.ityp.EQ.2)
THEN
333 ELSEIF(ityp.EQ.3)
THEN
347 CALL up8(ninc,linc,
mbay(1,lun),jbit)
349 CALL usrtpl(lun,n,int(ival))
361 IF(node.NE.nods(i))
GOTO 130
368 IF(ityp.EQ.1.OR.ityp.EQ.2)
THEN
370 jbit =
ibit + linc*(nsb-1)
371 CALL up8(ninc,linc,
mbay(1,lun),jbit)
374 IF(ninc.LT.lps(linc)) tab(i,lret) =
ups(ival,node)
376 ELSEIF(ityp.EQ.3)
THEN
381 jbit =
ibit + linc*(nsb-1)*8
383 CALL upc(cval,linc,
mbay(1,lun),jbit,.true.)
389 CALL bort(
'UFBTAB - INVALID ELEMENT TYPE SPECIFIED')
403 135 iret = iret+
msub(lun)
420 DO WHILE(
ireadmg(-lunit,subset,jdate).GE.0)
421 nrep = nrep+
nmsub(lunit)
424 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
425 WRITE ( unit=errstr, fmt=
'(A,A,I8,A,A)' )
426 .
'BUFRLIB: UFBTAB - THE NO. OF DATA SUBSETS IN THE BUFR FILE ',
427 . .GT.
'IS LIMIT OF ', i2,
' IN THE 4TH ARG. (INPUT) - ',
430 WRITE ( unit=errstr, fmt=
'(A,I8,A,I8,A)' )
431 .
'>>>UFBTAB STORED ', iret,
' REPORTS OUT OF ', nrep,
'<<<'
433 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
subroutine bort(STR)
Log one error message and abort application program.
recursive subroutine closbf(LUNIT)
Close the connection between logical unit LUNIT and the NCEPLIBS-bufr software.
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
recursive function ireadmg(LUNIT, SUBSET, IDATE)
Calls NCEPLIBS-bufr subroutine readmg() and passes back its return code as the function value.
recursive function ireadsb(LUNIT)
Calls NCEPLIBS-bufr subroutine readsb() and passes back its return code as the function value.
This module contains array and variable declarations used to store BUFR messages internally for multi...
integer ibit
Bit pointer within IBAY.
integer, dimension(:,:), allocatable mbay
Current BUFR message for each internal I/O stream.
integer, dimension(:), allocatable mbyt
Length (in bytes) of current BUFR message for each internal I/O stream.
This module contains declarations for arrays used to store information about the current BUFR 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 array and variable declarations used to store the internal jump/link table.
integer, dimension(:), allocatable ibt
Bit widths corresponding to tag and typ:
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
This module contains an array declaration used to store, for each I/O stream index from which a BUFR ...
integer, dimension(:), allocatable msgunp
Flag indicating how to unpack data subsets from BUFR message:
This module contains declarations for arrays used to store data values and associated metadata for th...
integer, dimension(:), allocatable nval
Number of data values in BUFR data subset.
integer, dimension(:,:), allocatable, target inv
Inventory pointer which links each data value to its corresponding node in the internal jump/link tab...
This module declares and initializes the BMISS variable.
real *8, public bmiss
Current placeholder value to represent "missing" data when reading from or writing to BUFR files; thi...
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 ...
recursive function nmsub(LUNIT)
This function returns the total number of data subsets available within the BUFR message that was mos...
recursive subroutine openbf(LUNIT, IO, LUNDX)
Connects a new file to the NCEPLIBS-bufr software for input or output operations, or initializes the ...
subroutine parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
Parse a string containing one or more substrings into an array of substrings.
subroutine rewnbf(LUNIT, ISR)
This subroutine, depending on the value of ISR, will either:
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
subroutine string(STR, LUN, I1, IO)
This subroutine checks to see if a user-specified character string is in the string cache (arrays in ...
recursive subroutine ufbtab(LUNIN, TAB, I1, I2, IRET, STR)
This subroutine reads through every data subset in a BUFR file and returns one or more specified data...
subroutine up8(nval, nbits, ibay, ibit)
This subroutine decodes an 8-byte integer value from within a specified number of bits of an integer ...
subroutine upb8(nval, nbits, ibit, ibay)
This subroutine decodes an 8-byte integer value from within a specified number of bits of an integer ...
subroutine upb(NVAL, NBITS, IBAY, IBIT)
This subroutine decodes an integer value from within a specified number of bits of an integer array,...
subroutine upc(CHR, NCHR, IBAY, IBIT, CNVNULL)
Decode a character string from an integer array.
real *8 function ups(IVAL, NODE)
This function unpacks a real*8 user value from a packed BUFR integer by applying the proper scale and...
subroutine usrtpl(LUN, INVN, NBMP)
Store the subset template into internal arrays.
subroutine x48(IIN4, IOUT8, NVAL)
Encode one or more 4-byte integer values as 8-byte integer values.
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.