17 CHARACTER*8 sub(maxsub)
18 integer*8 ninv(3,maxsub)
25 nmbyt(lunit)=
iupvs01(lunit,
'LENM')
32 print *,
'Usage: binv <bufrfile> will print bufrfile inventory by message type'
37 file = trim(file)//char(0)
38 inquire(file=file,exist=exist)
40 print *,trim(file)//
' does not exist'
43 open(lunbf,file=file,form=
'unformatted')
52 CALL openbf(lunbf,
'IN',lunbf)
53 DO WHILE(
ireadmg(lunbf,subset,idate).EQ.0)
56 IF(subset.EQ.sub(i)) isub = i
59 IF(nsub+1.GT.maxsub)
CALL bort(
'NSUB TOO BIG')
64 ninv(1,isub) = ninv(1,isub)+1
65 ninv(2,isub) = ninv(2,isub)+
nmsub(lunbf)
66 ninv(3,isub) = ninv(3,isub)+nmbyt(lunbf)
73 print
'(a4,6x,2(a10,4x),a11)',
'type',
'messages',
'subsets',
'bytes'
78 print
'(a8,2x,2(i10,4x),i11,4x,f8.2)',sub(j),(ninv(i,j),i=1,3),xsub/xmsg
80 ninv(1,1) = ninv(1,1)+ninv(1,j)
81 ninv(2,1) = ninv(2,1)+ninv(2,j)
82 ninv(3,1) = ninv(3,1)+ninv(3,j)
86 print
'(a8,2x,2(i10,4x),i11,4x)',
'TOTAL ',(ninv(i,1),i=1,3)
program binv
Usage: binv <bufrfile> will print bufrfile inventory by message type.
subroutine bort(STR)
Log one error message and abort application program.
recursive function ireadmg(LUNIT, SUBSET, IDATE)
Calls NCEPLIBS-bufr subroutine readmg() and passes back its return code as the function value.
recursive function iupvs01(LUNIT, S01MNEM)
Read a specified value from within Section 0 or 1 of a BUFR message.
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 ...