NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
readmp.f90
Go to the documentation of this file.
1 
4 
5  program readmp
6 
7  implicit none
8 
9  character(255) :: file !> name of filename to read
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
function ireadmg(LUNIT, SUBSET, IDATE)
This function calls BUFRLIB subroutine readmg() and passes back its return code as the function value...
Definition: ireadmg.f:39
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:31
function ireadsb(LUNIT)
This function calls BUFRLIB subroutine readsb() and passes back its return code as the function value...
Definition: ireadsb.f:30
subroutine openbf(LUNIT, IO, LUNDX)
This subroutine connects a new file to the BUFRLIB software for input or output operations.
Definition: openbf.f:138
subroutine ufdump(LUNIT, LUPRT)
This subroutine prints a verbose listing of the contents of a data subset, including all data values ...
Definition: ufdump.f:63
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22