C    <@(#)	 press.F	4.8 3/28/94>
      subroutine PRESS( len, km, nwater, nland,
     &                  H , B, Pt, Zt,
     &                  ieast, iwest, inorth, isouth,
     &                  Dx_h , Dy_h,
     &                  U_tend, V_tend )      
      implicit none


      integer len
      integer km
      integer nwater
      integer nland
      real H(len, km)
      real B(len, km)
      real Pt(len)
      real Zt(len)
      integer ieast(len)
      integer iwest(len)
      integer inorth(len)
      integer isouth(len)
      real Dx_h(len)
      real Dy_h(len)
      real U_tend(LEN,KM)
      real V_tend(LEN,KM)
      
c==> Local Variables

      integer i
      integer k
      real P(len)
      real Z(len)
      real Wk1(len)       
c---------------------------------------------------------------------
 
      
      
      do i=1,nwater+nland
         Z(i) = Zt(i)
         P(i) = Pt(i)
         Wk1(i) = 0.
      end do
      
         
      DO k=1,KM

        do i=1,nwater
          Z(i) = Z(i) - H(i,k)*.5
          P(i) = P(i) - H(i,k)*.5*B(i,k)
        end do
 
        do i=1,nwater
         Wk1(i) = ((P(i)-P(ieast(i)))
     &       - (B(i,k)+B(ieast(i),k))*.5
     &                *(Z(i)-Z(ieast(i))))
     &       *(H(i,k)+H(ieast(i),k)) * Dy_h(i)
        end do

        do i=1,nwater
         U_tend(i,k) = U_tend(i,k)  + (Wk1(i) + Wk1(inorth(i)))*.25
        end do


        do  i=1,nwater
         Wk1(i) = ((P(i)-P(inorth(i)))
     &        - (B(i,k)+B(inorth(i),k))*.5
     &                *(Z(i)-Z(inorth(i))))
     &        *(H(i,k)+H(inorth(i),k))*Dx_h(i)
        end do

        do i=1,nwater
          V_tend(i,k) = V_tend(i,k) + ( Wk1(i) + Wk1(ieast(i)))*.25
        end do

        if (k.lt.km) then

          do i=1,nwater
            Z(i) = Z(i) - H(i,k)*.5
            P(i) = P(i) - H(i,k)*.5*B(i,k)
          end do
        endif
      
      END DO ! k
       
      
      END

