8 integer,
parameter :: mxmn=35, mxlv=250
9 character(80):: hdstr=
'SID XOB YOB DHR TYP ELV SAID T29'
10 character(80):: obstr=
'POB QOB TOB ZOB UOB VOB PWO CAT PRSS'
11 character(80):: qcstr=
'PQM QQM TQM ZQM WQM NUL PWQ '
12 character(80):: oestr=
'POE QOE TOE NUL WOE NUL PWE '
13 real(8) :: hdr(mxmn),obs(mxmn,mxlv),qcf(mxmn,mxlv),oer(mxmn,mxlv)
15 INTEGER :: ireadmg,ireadsb
17 character(8) :: subset
18 integer :: unit_in=10,idate,nmsg,ntb
21 real(8) :: rstation_id
22 equivalence(rstation_id,c_sid)
26 character (len=80) :: pb_table_fname, pb_data_fname
33 argc = command_argument_count()
35 print*,
"ERROR: must supply exactly two arguments"
37 print*,
"USAGE: pb_decode <input_bufr_file> <output_bufr_table_file>"
40 call get_command_argument(1,pb_data_fname)
41 call get_command_argument(2,pb_table_fname)
43 open(24,file=pb_table_fname)
44 open(unit_in,file=pb_data_fname,form=
'unformatted',status=
'old')
45 call openbf(unit_in,
'IN',unit_in)
46 call dxdump(unit_in,24)
49 msg_report:
do while (ireadmg(unit_in,subset,idate) == 0)
53 write(*,
'(3a,i10)')
'subset=',subset,
' cycle time =',idate
54 sb_report:
do while (ireadsb(unit_in) == 0)
60 call ufbint(unit_in,obs,mxmn,mxlv,iret,
'TOB')
63 write(*,
'(2I10,a14,8f15.1)') ntb,iret,c_sid,(hdr(i),i=2,8)
68 write(*,
'(i3,a10,9f15.1)') k,
'obs=', obs(1,k)