      program read_buoy
c
c     Sample program to read monthly buoy data files.
c

c
      integer*2 year,mon        ! Year and month of data in file
      integer*4 buoy_id         ! Buoy identifier
c
      real*4 lat1,lon1          ! First latitude/longitude position of buoy
      integer*2 sday,shr,smin   ! Day, hour and minute of first observation
c
      real*4 lat2,lon2          ! Final latitude/longitude position of buoy
      integer*2 eday,ehr,emin   ! Day, hour and minute of last observation
c

      open(8,file='9001.dat',status='old')
c
      read(8,8) year,mon
 8    format(2i3)
 10   continue
      read(8,18,end=50) buoy_id, lat1, lon1, sday, shr, smin, lat2,
     &      lon2, eday, ehr, emin
 18   format(i5,2(2f9.3,3i3))
      write(*,18) buoy_id, lat1, lon1, sday, shr, smin, lat2, lon2,
     &       eday, ehr, emin
      goto 10
c
 50   continue
      close(8)
      stop
      end
