      implicit none
      integer,parameter :: iq=5400,jq=2401,ntide=4
      real              :: x(iq),y(jq),omg(ntide)
      real              :: dep(iq,jq)
      real              :: conv(iq,jq,ntide),dissip(iq,jq,ntide)
      integer           :: i,j,n,iq1,jq1,ntide1
!!-----------------------------------------------------
!!               x(i): longitude (unit: degree)
!!               y(j): latitude  (unit: degree)
!!             omg(n): tidal frequency (unit: radian/sec)
!!                     n=1 -> M2, n=2 -> S2, 
!!                     n=3 -> K1, n=4 -> O1
!!           dep(i,j): averaged depth in each grid area (unit: meter)
!!        conv(i,j,n): depth-integreted internal tide conversion rate  (watt/meter**2)
!!      dissip(i,j,n): depth-integrated internal tide dissipation rate (watt/meter**2)
!!-----------------------------------------------------
      open(10,file='./CONV-DISSIP.E2-GLB-AVE2-M2S2K1O1-DMP30-ASM025-08MAY03.DATA',form='unformatted') 
!!-----------------------------------------------------
      read(10) iq1,jq1,ntide1
        if(iq1   .ne.iq   ) pause 
        if(jq1   .ne.jq   ) pause
        if(ntide1.ne.ntide) pause
      read(10) (  x(i),i=1,iq   ), &
               (  y(j),j=1,jq   ), &
               (omg(n),n=1,ntide)
      read(10) ((dep(i,j),i=1,iq),j=1,jq)
      do n=1,ntide
        read(10) ((  conv(i,j,n),i=1,iq),j=1,jq)
        read(10) ((dissip(i,j,n),i=1,iq),j=1,jq)
      end do
      return
      end

