9 CHARACTER*8 SUB(MAXSUB)
10 dimension ninv(3,maxsub)
23 print *,
'Usage: binv <bufrfile> will print bufrfile inventory by message type'
28 file = trim(file)//char(0)
29 inquire(file=file,exist=exist)
30 if (.not.exist)
call bort(trim(file)//
' does not exist')
31 open(lunbf,file=file,form=
'unformatted')
40 CALL openbf(lunbf,
'IN',lunbf)
41 DO WHILE(
ireadmg(lunbf,subset,idate).EQ.0)
44 IF(subset.EQ.sub(i)) isub = i
47 IF(nsub+1.GT.maxsub)
CALL bort(
'NSUB TOO BIG')
52 ninv(1,isub) = ninv(1,isub)+1
53 ninv(2,isub) = ninv(2,isub)+
nmsub(lunbf)
54 ninv(3,isub) = ninv(3,isub)+nmbyt(lunbf)
61 print
'(a4,6x,3(a10,4x))',
'type',
'messages',
'subsets',
'bytes'
66 print
'(A8,2X,3(I10,4X),f8.2)',sub(j),(ninv(i,j),i=1,3),xsub/xmsg
68 ninv(1,1) = ninv(1,1)+ninv(1,j)
69 ninv(2,1) = ninv(2,1)+ninv(2,j)
70 ninv(3,1) = ninv(3,1)+ninv(3,j)
74 print
'(A8,2X,3(I10,4X))',
'TOTAL ',(ninv(i,1),i=1,3)
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
function ireadmg(LUNIT, SUBSET, IDATE)
This function calls BUFRLIB subroutine readmg() and passes back its return code as the function value...
function iupvs01(LUNIT, S01MNEM)
This function returns a specified value from within Section 0 or Section 1 of a BUFR message.
function nmsub(LUNIT)
This function returns the total number of data subsets available within the BUFR message that was mos...
subroutine openbf(LUNIT, IO, LUNDX)
This subroutine connects a new file to the BUFRLIB software for input or output operations.