NCEPLIBS-bufr  12.1.0
readmp.F90
Go to the documentation of this file.
1 
6 
13  program readmp
14 
15  implicit none
16 
17  character(255) :: file
18  character(8) :: subset
19  character(1) :: go
20  integer, parameter :: lunit = 20
21  integer :: idate,ireadmg,ireadsb,i4dy
22  logical :: exist
23 
24 ! get the filename to open and read
25 
26  call get_command_argument(1,file); file=trim(adjustl(file))
27  if (file == '') then
28  print *, 'Usage: readmp <bufrfile> will print reports one at a time'
29  call exit(2)
30  endif
31  inquire(file=file,exist=exist)
32  if (.not.exist) then
33  print *,trim(file)//' does not exist'
34  call exit(3)
35  endif
36  call get_command_argument(2,go); go=trim(adjustl(go)) ! this for testing
37  open(lunit,file=file,form='unformatted')
38 
39 ! open the file to bufr and dump the subsets to standard outout one at a time
40 
41  call openbf(lunit,'IN',lunit)
42  do while(ireadmg(lunit,subset,idate)==0)
43  do while(ireadsb(lunit)==0)
44  print*,'message date=',i4dy(idate)
45  call ufdump(lunit,6)
46  if(go/='q') read(5,'(a)') go
47  if(go=='q') stop
48  enddo
49  enddo
50 
51  end program readmp
recursive subroutine ufdump(lunit, luprt)
Print a verbose listing of the contents of a data subset, including all data values and replicated se...
Definition: dumpdata.F90:228
recursive subroutine openbf(lunit, io, lundx)
Connect a new file to the NCEPLIBS-bufr software for input or output operations, or initialize the li...
program readmp
Read BUFR file containing embedded DX BUFR tables, and print each report one at a time.
Definition: readmp.F90:13
recursive integer function ireadmg(lunit, subset, idate)
Call subroutine readmg() and pass back its return code as the function value.
recursive integer function ireadsb(lunit)
Call subroutine readsb() and pass back its return code as the function value.
recursive integer function i4dy(idate)
Convert a date-time with a 2-digit year (YYMMDDHH) to a date-time with a 4-digit year (YYYYMMDDHH) us...
Definition: s013vals.F90:1070