      implicit none
      integer,parameter :: iq=300,jq=300,kq=40,nq=4
      real    :: x(iq),y(jq),sz(kq),omg(nq)
      real    :: dep(iq,jq)
      real    :: uamp(iq,jq,kq,nq),uphs(iq,jq,kq,nq), &
                 vamp(iq,jq,kq,nq),vphs(iq,jq,kq,nq)
!-----------------
!     x(i)     :: longitude (degree)
!     y(j)     :: latitude  (degree)
!     sz(k)    :: vertical sigma level 
!     dep(i,j) :: sea floar depth (meter)
!     omg(n)   :: tidal frequency (rad/sec); M2(n=1),S2(n=2),K1(n=3),O1(n=4)
!     uamp(i,j,k,n) :: amplitude of eastward  tidal current velocity (meter/second)
!     uphs(i,j,k,n) :: phase     of eastward  tidal current velocity (radian)
!     vamp(i,j,k,n) :: ampitude  of northward tidal current velocity (meter/second)
!     vphs(i,j,k,n) :: phase     of northward tidal current velocity (radian)
!----------------
!      The eastward tidal current velocity at the point (x,y,z)=(x(i),y(i),sz(k)*dep(i,j)) is given by
!        u= uamp(i,j,k,1)*cos(omg(1)*time-uphs(i,j,k,1))
!          +uamp(i,j,k,2)*cos(omg(2)*time-uphs(i,j,k,2))
!          +uamp(i,j,k,3)*cos(omg(3)*time-uphs(i,j,k,3))
!          +uamp(i,j,k,4)*cos(omg(4)*time-uphs(i,j,k,4)) 
!        time: elapsed time from 2012/1/1 00:00 UTC (second)                     
!-----------------
      open(10,file='uv-amp-phs.data',form='unformatted')
!-----------------
      read(10) x,y,sz,omg
      read(10) dep
      read(10) uamp,uphs,vamp,vphs
!-----------------
      stop
      end 
