197 SUBROUTINE ufbtab(LUNIN,TAB,I1,I2,IRET,STR)
205 COMMON /usrstr/ nnod,ncon,nods(20),nodc(10),ivls(10),kons(10)
210 CHARACTER*128 bort_str,errstr
212 CHARACTER*10 tgs(100)
213 CHARACTER*8 subset,cval
214 equivalence(cval,rval)
215 LOGICAL openit,just_count
216 REAL*8 tab(i1,i2),rval,
ups
221 mps(node) = 2**(ibt(node))-1
222 lps(lbit) = max(2**(lbit)-1,1)
238 just_count = lunin.LT.lunit
245 CALL
status(lunit,lun,il,im)
253 CALL
openbf(lunit,
'INX',lunit)
279 DO WHILE(
ireadmg(-lunit,subset,idate).GE.0)
280 iret = iret+
nmsub(lunit)
288 CALL
parstr(str,tgs,maxtg,ntg,
' ',.true.)
290 IF(tgs(i).EQ.
'IREC') irec = i
291 IF(tgs(i).EQ.
'ISUB') isub = i
297 10
IF(
ireadmg(-lunit,subset,jdate).LT.0) goto 25
299 IF(irec.GT.0) nods(irec) = 0
300 IF(isub.GT.0) nods(isub) = 0
305 CALL
mesgbc(-lunit,mtyp,icmp)
308 ELSEIF(icmp.EQ.1)
then
320 15
IF(nsub(lun).EQ.msub(lun)) goto 10
321 IF(iret+1.GT.i2) goto 99
325 nods(i) = abs(nods(i))
331 mbit = mbyt(lun)*8 + 16
335 20
IF(n+1.LE.nval(lun))
THEN
340 IF(itp(node).EQ.1)
THEN
341 CALL
upbb(ival,nbit,mbit,mbay(1,lun))
345 IF(nods(i).EQ.node)
THEN
346 IF(itp(node).EQ.1)
THEN
347 CALL
upbb(ival,nbit,mbit,mbay(1,lun))
349 ELSEIF(itp(node).EQ.2)
THEN
350 CALL
upbb(ival,nbit,mbit,mbay(1,lun))
351 IF(ival.LT.mps(node)) tab(i,iret) =
ups(ival,node)
352 ELSEIF(itp(node).EQ.3)
THEN
355 CALL
upc(cval,nbit/8,mbay(1,lun),kbit,.true.)
363 IF(nods(i).GT.0) goto 20
371 CALL
upb(nbyt,16,mbay(1,lun),ibit)
372 mbyt(lun) = mbyt(lun) + nbyt
373 nsub(lun) = nsub(lun) + 1
374 IF(irec.GT.0) tab(irec,iret) = nmsg(lun)
375 IF(isub.GT.0) tab(isub,iret) = nsub(lun)
387 115
IF(iret+msub(lun).GT.i2) goto 99
392 IF(irec.GT.0.OR.isub.GT.0)
THEN
394 IF(irec.GT.0) tab(irec,iret+nsb) = nmsg(lun)
395 IF(isub.GT.0) tab(isub,iret+nsb) = nsb
412 120
DO n=n+1,nval(lun)
422 nods(i) = abs(nods(i))
426 IF(nods(i).GT.0) goto 125
434 125
IF(ityp.EQ.1.OR.ityp.EQ.2)
THEN
435 CALL
upb(lref,nbit,mbay(1,lun),ibit)
436 CALL
upb(linc, 6,mbay(1,lun),ibit)
437 nibit = ibit + linc*msub(lun)
438 ELSEIF(ityp.EQ.3)
THEN
440 CALL
upc(cref,nbit/8,mbay(1,lun),ibit,.true.)
441 CALL
upb(linc, 6,mbay(1,lun),ibit)
442 nibit = ibit + 8*linc*msub(lun)
452 CALL
upb(ninc,linc,mbay(1,lun),jbit)
466 IF(node.NE.nods(i)) goto 130
473 IF(ityp.EQ.1.OR.ityp.EQ.2)
THEN
475 jbit = ibit + linc*(nsb-1)
476 CALL
upb(ninc,linc,mbay(1,lun),jbit)
479 IF(ninc.LT.lps(linc)) tab(i,lret) =
ups(ival,node)
481 ELSEIF(ityp.EQ.3)
THEN
486 jbit = ibit + linc*(nsb-1)*8
488 CALL
upc(cval,linc,mbay(1,lun),jbit,.true.)
494 CALL
bort(
'UFBTAB - INVALID ELEMENT TYPE SPECIFIED')
508 135 iret = iret+msub(lun)
525 DO WHILE(
ireadmg(-lunit,subset,jdate).GE.0)
526 nrep = nrep+
nmsub(lunit)
529 CALL
errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
530 WRITE ( unit=errstr, fmt=
'(A,A,I8,A,A)' )
531 .
'BUFRLIB: UFBTAB - THE NO. OF DATA SUBSETS IN THE BUFR FILE ',
532 . .GT.
'IS LIMIT OF ', i2,
' IN THE 4TH ARG. (INPUT) - ',
535 WRITE ( unit=errstr, fmt=
'(A,I8,A,I8,A)' )
536 .
'>>>UFBTAB STORED ', iret,
' REPORTS OUT OF ', nrep,
'<<<'
538 CALL
errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
563 900
WRITE(bort_str,
'("BUFRLIB: UFBTAB - INVALID COMPRESSION '//
564 .
'INDICATOR (ICMP=",I3," RETURNED FROM BUFR ARCHIVE LIBRARY '//
565 .
'ROUTINE MESGBC")') icmp
subroutine upbb(NVAL, NBITS, IBIT, IBAY)
THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER CONTAINED WITHIN NBITS BITS OF IBAY...
function ireadmg(LUNIT, SUBSET, IDATE)
This function calls BUFRLIB subroutine readmg() and passes back its return code as the function value...
subroutine upb(NVAL, NBITS, IBAY, IBIT)
THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER CONTAINED WITHIN NBITS BITS OF IBAY...
function ireadsb(LUNIT)
This function calls BUFRLIB subroutine readsb() and passes back its return code as the function value...
subroutine parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
THIS SUBROUTINE PARSES A STRING CONTAINING ONE OR MORE SUBSTRINGS INTO AN ARRAY OF SUBSTRINGS...
subroutine usrtpl(LUN, INVN, NBMP)
THIS SUBROUTINE STORES THE SUBSET TEMPLATE INTO INTERNAL SUBSET ARRAYS IN MODULE USRINT FOR CASES OF ...
subroutine closbf(LUNIT)
This subroutine closes the connection between logical unit LUNIT and the BUFRLIB software.
subroutine openbf(LUNIT, IO, LUNDX)
This subroutine connects a new file to the BUFRLIB software for input or output operations.
This module declares and initializes the BMISS variable.
subroutine upc(CHR, NCHR, IBAY, IBIT, CNVNULL)
THIS SUBROUTINE UNPACKS AND RETURNS A CHARACTER STRING OF LENGTH NCHR CONTAINED WITHIN NCHR BYTES OF ...
subroutine mesgbc(LUNIN, MESGTYP, ICOMP)
THIS SUBROUTINE EXAMINES A BUFR MESSAGE AND RETURNS BOTH THE MESSAGE TYPE FROM SECTION 1 AND A MESSAG...
subroutine string(STR, LUN, I1, IO)
THIS SUBROUTINE CHECKS TO SEE IF A USER-SPECIFIED CHARACTER STRING IS IN THE STRING CACHE (ARRAYS IN ...
This module contains array and variable declarations used to store the internal jump/link table...
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
function nmsub(LUNIT)
This function returns the total number of data subsets available within the BUFR message that was mos...
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
This module contains array and variable declarations used to store BUFR messages internally for multi...
subroutine ufbtab(LUNIN, TAB, I1, I2, IRET, STR)
THIS SUBROUTINE EITHER OPENS A BUFR FILE CONNECTED TO ABS(LUNIN) FOR INPUT OPERATIONS (IF IT IS NOT A...
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 rewnbf(LUNIT, ISR)
THIS SUBROUTINE, DEPENDING ON THE VALUE OF ISR, WILL EITHER: 1) STORE THE CURRENT PARAMETERS ASSOCIAT...