11 CHARACTER*50 HEADR,OBSTR,QMSTR,FCSTR,ERSTR,QMSFC
13 CHARACTER*8 SUBSET,DATE
14 dimension knt(300,7,0:17),hdr(5),obs(8,255),qms(8,255)
18 DATA headr /
'SID XOB YOB DHR TYP '/
19 DATA obstr /
'POB QOB TOB ZOB UOB PWO RHO VOB '/
20 DATA qmstr /
'PQM QQM TQM ZQM WQM PWQ RHQ '/
22 DATA vars /
'PRESSURE ',&
42 call getarg(1,file); file=trim(adjustl(file))
43 if (file ==
'')
call bort(
'Usage: "cmpbqm prepbufrfile" will print prep inventory by variable, report type, and qc mark'
44 inquire(file=file,exist=exist)
45 if (.not.exist)
call bort(trim(file)//
' does not exist')
47 open(lubfr,file=file,form=
'unformatted')
48 CALL openbf(lubfr,
'IN',lubfr)
49 CALL readmg(lubfr,subset,idate,iret)
50 IF(iret.NE.0)
GOTO 900
51 WRITE(date,
'(I8)') idate
53 IF(date(i:i).EQ.
' ') date(i:i) =
'0'
55 print
'(''DATA VALID AT '',A8)',date
62 CALL readmg(lubfr,subset,idate,iret)
63 IF(iret.NE.0)
GOTO 100
64 CALL ufbcnt(lubfr,irec,isub)
68 CALL ufbint(lubfr,hdr,5,1,iret,headr)
69 CALL ufbint(lubfr,obs,8,255,nlev,obstr)
70 CALL ufbint(lubfr,qms,8,255,nlev,qmstr)
77 IF(k.EQ.5) obs(5,l) = max(obs(5,l),obs(8,l))
78 IF(obs(k,l).LT.vmax .AND. qms(k,l).LT.vmax)
THEN
80 ELSEIF(obs(k,l).LT.vmax .AND. qms(k,l).GE.vmax)
THEN
82 ELSEIF(obs(k,l).GE.vmax .AND. qms(k,l).LT.vmax)
THEN
85 IF(iq.GE.0) knt(kx,k,iq) = knt(kx,k,iq)+1
98 itot = 0; igood=0; ifail=0
100 itot = itot+knt(kx,k,iq)
102 igood=igood+knt(kx,k,iq)
104 ifail=ifail+knt(kx,k,iq)
107 IF(itot.GT.0) print 101,kx,itot,igood,ifail,(knt(kx,k,iq),iq=8,17)
108101
FORMAT(i3,i6,2(
'|', i6),&
116 print*,
'******CMPBQM PROCESSED ',irec,
' BUFR RECORDS******'
118900
CALL bort(
'CMPBQM - ERROR READING BUFR FILE ')
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
subroutine openbf(LUNIT, IO, LUNDX)
This subroutine connects a new file to the BUFRLIB software for input or output operations.
subroutine readmg(LUNXX, SUBSET, JDATE, IRET)
This subroutine reads the next BUFR message from logical unit ABS(LUNXX) into internal arrays.
subroutine readsb(LUNIT, IRET)
This subroutine reads the next data subset from a BUFR message into internal arrays.
subroutine ufbcnt(LUNIT, KMSG, KSUB)
This subroutine returns the current location of the file pointer within a BUFR file,...
subroutine ufbint(LUNIN, USR, I1, I2, IRET, STR)
This subroutine reads or writes one or more data values from or to the BUFR data subset that is curre...