subroutine bound(Hsfc1, Hbnd)
  ! $BDlLL9bEY$r7h$a$k4X?t$OE,Ev$J$N$G8e$G=$@5$9$k;v(B.
  use prm, only : IMAX, JMAX, dt
  use prmphys, only : tau, rho, rhoM  ! $B;~Dj?t(B
  use com_var, only : Hequ


  implicit none

  real(8),INTENT(INOUT) :: Hsfc1(1:IMAX, 1:JMAX)            ! $BI9>29bEY(B($B;~9o(B: t)
  real(8),INTENT(INOUT) :: Hbnd(1:IMAX, 1:JMAX)             ! $B4pHW9bEY(B($B;~9o(B: t)
  real(8)               :: Height(1:IMAX, 1:JMAX)

  integer               :: i,j

  do i = 1,IMAX
     do j =1, JMAX
        if(Hsfc1(i, j) >= 0.0D0)then
           Height(i, j) = Hsfc1(i, j)-Hbnd(i, j)
        elseif((Hsfc1(i, j) < 0.0D0).and.(Hbnd(i, j) < 0.0D0))then
           Height(i, j) = -(Hsfc1(i, j) - Hbnd(i, j))
        else
           write(6, *)'Hsfc < 0 Hbnd >0 , error !! bound'
           stop 
        end if
        if(Height(i, j) < 0.0D0)then
           write(6, *)'Height is -minus value. error !!  bound'
           stop
        end if
     end do
  end do

  Hbnd = Hbnd  - dt/tau*(Hbnd -Hequ+rho/rhoM*(Height))
  
  Hsfc1=Height+Hbnd

end subroutine bound
