       parameter (ngx=501, ngy=191)
       character*12 cdate
       dimension cd(ngx,ngy),sig_wht(ngx,ngy),
     + pper(ngx,ngy),z0(ngx,ngy),beta(ngx,ngy)
       dimension sig_wht0(ngx,ngy),rms(ngx,ngy),
     +  diff(ngx,ngy),pper0(ngx,ngy),beta0(ngx,ngy)


        rms = 0.
c SPECIAL VALUE IS 9999.

c cdate = yyyymmddhhmm

       open(60,file='WAVES.INPUT_1',form='unformatted')
       open(61,file='WAVES.INPUT_0',form='unformatted')

c --- athos
       alon = 24.7226
       alat = 39.9635
c --- skyros
c      alon = 24.4653
c      alat = 39.1113
c --- santorini
c      alon = 25.4956
c      alat = 36.2546
c --- pylos
c      alon = 21.6113
c      alat = 36.8359
c --- mykonos
c      alon = 25.4590
c      alat = 37.5113
c --- lesvos
c      alon = 25.8081
c      alat = 39.1553
c -----

c ---- alboran
c      alon = -3.5
c      alat = 36.
c ---- SW Crete
c      alon = 22.8
c      alat = 34.7

       ik = (alon+8.) *10 + 1
       jk = (alat-29.) *10 + 1

c      print *,(ik-1)*0.1 - 8
c      print *,(jk-1)*0.1 +29

       do ii = 1,2
       read(60) cdate
       read(60) ((cd(i,j),i=1,ngx),j=1,ngy)
       read(60) ((sig_wht(i,j),i=1,ngx),j=1,ngy)
       read(60) ((pper(i,j),i=1,ngx),j=1,ngy)
       read(60) ((z0(i,j),i=1,ngx),j=1,ngy)
       read(60) ((beta(i,j),i=1,ngx),j=1,ngy)
       read(61) cdate
       read(61) ((cd(i,j),i=1,ngx),j=1,ngy)
       read(61) ((sig_wht0(i,j),i=1,ngx),j=1,ngy)
       read(61) ((pper0(i,j),i=1,ngx),j=1,ngy)
       read(61) ((z0(i,j),i=1,ngx),j=1,ngy)
       read(61) ((beta(i,j),i=1,ngx),j=1,ngy)
       end do

       ii = 0
       do itimes = 1,163
       read(60) cdate
       read(60) ((cd(i,j),i=1,ngx),j=1,ngy)
       read(60) ((sig_wht(i,j),i=1,ngx),j=1,ngy)
       read(60) ((pper(i,j),i=1,ngx),j=1,ngy)
       read(60) ((z0(i,j),i=1,ngx),j=1,ngy)
       read(60) ((beta(i,j),i=1,ngx),j=1,ngy)

       read(61) cdate
       read(61) ((cd(i,j),i=1,ngx),j=1,ngy)
       read(61) ((sig_wht0(i,j),i=1,ngx),j=1,ngy)
       read(61) ((pper0(i,j),i=1,ngx),j=1,ngy)
       read(61) ((z0(i,j),i=1,ngx),j=1,ngy)
       read(61) ((beta0(i,j),i=1,ngx),j=1,ngy)

c      if (itimes.eq.1) then
c       print *,itimes,cdate,sig_wht(ik,jk),sig_wht0(ik,jk)
c      end if

       if (mod(ii,3).eq.0) then
        sw1 = sig_wht(ik,jk) 
        sw2 = sig_wht0(ik,jk) 
        print *,cdate,sig_wht(ik,jk),sig_wht0(ik,jk)
        be0 = beta0(ik,jk)
       end if

       ii = ii + 1


       end do

 300  FORMAT(8e10.3)



       stop
       end

