      program getminmax
      implicit none

c -----
c number of data
      integer NDAT
      parameter (NDAT=121)

c missing value
      real    MISS
      parameter (MISS=-999.)

c IO
      integer IFILE
      parameter (IFILE=21)

c -----
c data
      character*8  HHMMSS
      real    t, wd, ws
      real    tmin,  tmax
      real    wsmin, wsmax

c loop control
      integer i

c -----
      open(IFILE,file='datafile')
 220  continue
c reset data
      tmin  = MISS
      tmax  = MISS
      wsmin = MISS
      wsmax = MISS
c read data
      read(IFILE,*,end=240)
      read(IFILE,*)
      read(IFILE,*)
      read(IFILE,*)
      read(IFILE,*)
      read(IFILE,*)
      do 230 i = 1, NDAT
        read(IFILE,*) HHMMSS, t, wd, ws
        if (t.ne.MISS) then
            if (tmin.eq.MISS) then
                tmin = t
            end if
            if (t.lt.tmin) then
                tmin = t
            end if
            if (tmax.eq.MISS) then
                tmax = t
            end if
            if (t.gt.tmax) then
                tmax = t
            end if
        end if
        if (ws.ne.MISS) then
            if (wsmin.eq.MISS) then
                wsmin = ws
            end if
            if (ws.lt.wsmin) then
                wsmin = ws
            end if
            if (wsmax.eq.MISS) then
                wsmax = ws
            end if
            if (ws.gt.wsmax) then
                wsmax = ws
            end if
        end if
 230  continue
c outpout
      write(*,*) tmin, ',', tmax, ',', wsmin, ',', wsmax
      go to 220
 240  continue
      close(IFILE)


      stop
      end
