NCEPLIBS-bufr  12.0.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 getarg(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 getarg(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).eq.0)
43  do while(ireadsb(lunit).eq.0)
44  print*,'message date=',i4dy(idate)
45  call ufdump(lunit,6)
46  if(go.ne.'q') read(5,'(a)') go
47  if(go.eq.'q') stop
48  enddo
49  enddo
50 
51  end program readmp
recursive function i4dy(IDATE)
This function converts a date-time with a 2-digit year (YYMMDDHH) to a date-time with a 4-digit year ...
Definition: i4dy.f:24
recursive function ireadmg(LUNIT, SUBSET, IDATE)
Calls NCEPLIBS-bufr subroutine readmg() and passes back its return code as the function value.
Definition: ireadmg.f:27
recursive function ireadsb(LUNIT)
Calls NCEPLIBS-bufr subroutine readsb() and passes back its return code as the function value.
Definition: ireadsb.f:20
recursive subroutine openbf(LUNIT, IO, LUNDX)
Connects a new file to the NCEPLIBS-bufr software for input or output operations, or initializes the ...
Definition: openbf.f:124
program readmp
Read BUFR file containing embedded DX BUFR tables, and print each report one at a time.
Definition: readmp.F90:13
recursive subroutine ufdump(LUNIT, LUPRT)
This subroutine prints a verbose listing of the contents of a data subset, including all data values ...
Definition: ufdump.f:44