      program csv2dat
      implicit none

c -----
c number of observer
      integer NOBS
      parameter (NOBS=29)

c location data IO
      integer IS
      parameter (IS=11)

c -----
c station postion
      real    x(NOBS), y(NOBS)

c data
      real    tmin, tmax
      real    wdmin, wdmax
      real    wsmin, wsmax
      real    dT

c loop control
      integer i

c -----
c read station postion
      open(IS,FILE='location.txt')
      do 100 i = 1, NOBS
        read(IS,*) x(i), y(i)
 100  continue
      close(IS)

c read data and write data
      do 120 i = 1, NOBS
c        read(*,*) tmin, tmax, wsmin, wsmax, wdmin, wdmax
        read(*,*) tmin, tmax, wsmin, wsmax
        dT = tmax - tmin
        write(*,*) x(i), y(i), dT
 120  continue

      stop
      end
