17 CHARACTER*8 sub(maxsub)
18 integer*8 ninv(3,maxsub)
25 nmbyt(lunit)=
iupvs01(lunit,
'LENM')
30 narg=command_argument_count()
32 print *,
'Usage: binv <bufrfile> will print bufrfile inventory by message type'
36 call get_command_argument(1,file)
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)==0)
56 IF(subset==sub(i)) isub = i
59 IF(nsub+1>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 an error message, then abort the application program.
recursive subroutine openbf(lunit, io, lundx)
Connect a new file to the NCEPLIBS-bufr software for input or output operations, or initialize the li...
recursive integer function nmsub(lunit)
Get the total number of data subsets available within the BUFR message that was most recently opened ...
recursive integer function ireadmg(lunit, subset, idate)
Call subroutine readmg() and pass back its return code as the function value.
recursive integer function iupvs01(lunit, s01mnem)
Read a specified value from within Section 0 or 1 of a BUFR message.