!=======================================
! 2D cumulus model - kaminari
!  - subroutine 
! 
! Author    : TAKAHASHI Koko
! Date      : 2003/11/04
! Note      : $B?eJ?B.EY(B u
! 
!=======================================
subroutine velu(i,k,im,km,cp,alp,dts,g13z,divx,divz,dx,dz,  &
     &          vtemp_bs,omg,pi,u)

  implicit none

  integer, intent(in) :: im
  integer, intent(in) :: km
  integer, intent(in) :: i, k

  real(8), intent(in) :: vtemp_bs(0:im+1,0:km+1)
  real(8), intent(in) :: omg(0:im+1,0:km+1)
  real(8), intent(in) :: pi(0:im+1,0:km+1)
  real(8), intent(in) :: g13z(0:im+1,0:km+1)
  real(8), intent(in) :: divx(0:im+1,0:km+1)
  real(8), intent(in) :: divz(0:im+1,0:km+1)

  real(8), intent(inout) :: u(0:im+1,0:km+1)

  real(8)             :: difu(0:im+1,0:km+1)
  real(8)             :: advu(0:im+1,0:km+1)
  real(8)             :: coriu(0:im+1,0:km+1)
  real(8)             :: trbu(0:im+1,0:km+1)

  real(8), intent(in) :: cp, alp, dts

  real(8), intent(in) :: dx, dz

  difu(i,k) = 0.0D0

  advu(i,k) = u(i,k)*(u(i+1,k) - u(i-1,k))/(4*dx)  &
       &      + (                                  &
       &         omg(i+1,k+1) + omg(i+1,k-1)       &
       &         + omg(i-1,k+1) + omg(i-1,k-1)     &
       &        )/4                                &
       &        *(u(i,k+1) - u(i,k-1))/(4*dz)      &
       &      + difu(i,k)

  coriu(i,k) = 0.0028D0

  trbu(i,k) = 0.0D0

  u(i,k) = u(i,k)                                  &
       & + dts*(                                   &
       &        - cp*vtemp_bs(i,k)                 &
       &          *(pi(i+1,k)- pi(i,k))/(2*dx)     &
       &        - alp*cp*vtemp_bs(i,k)*divx(i,k)   &
       &        - g13z(i,k)*(                      &
       &                     pi(i+1,k+1)           &
       &                     + pi(i-1,k+1)         &
       &                     - pi(i+1,k-1)         &
       &                     - pi(i-1,k-1)         &
       &                    )/(8*dz)               &
       &        - alp*g13z(i,k)*divz(i,k)          &
       &       )                                   &
       & - advu(i,k) + coriu(i,k)                  &
       & + trbu(i,k)

end subroutine velu

