NCEPLIBS-bufr 11.7.1
readmp.f90
Go to the documentation of this file.
1
4
5 program readmp
6
7 implicit none
8
9 character(255) :: file
10 character(8) :: subset
11 character(1) :: go
12 integer, parameter :: lunit = 20
13 integer :: idate,ireadmg,ireadsb,i4dy
14 logical :: exist
15
16! get the filename to open and read
17
18 call getarg(1,file); file=trim(adjustl(file))
19 if (file == '') call bort('Usage: "gettab bufrfile" will print the internal BUFR table')
20 inquire(file=file,exist=exist)
21 if (.not.exist) call bort(trim(file)//' does not exist')
22 call getarg(2,go); go=trim(adjustl(go)) ! this for testing !
23 open(lunit,file=file,form='unformatted')
24
25! open the file to bufr and dump the subsets to standard outout one at a time
26
27 call openbf(lunit,'IN',lunit)
28 do while(ireadmg(lunit,subset,idate).eq.0)
29 do while(ireadsb(lunit).eq.0)
30 print*,'message date=',i4dy(idate)
31 call ufdump(lunit,6)
32 if(go.ne.'q') read(5,'(a)') go
33 if(go.eq.'q') stop
34 enddo
35 enddo
36
37 end program readmp
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine openbf(LUNIT, IO, LUNDX)
This subroutine connects a new file to the BUFRLIB software for input or output operations.
Definition: openbf.f:139
subroutine ufdump(LUNIT, LUPRT)
This subroutine prints a verbose listing of the contents of a data subset, including all data values ...
Definition: ufdump.f:64