!=======================================
! 2D cumulus model - kaminari
!  - subroutine vel_u_tb
! 
! Author    : TAKAHASHI Koko
! Date      : 2003/11/11
! Note      : x $BJ}8~1?F0J}Dx<0$ND9$$;~4V(B
!             $B4V3V$G7W;;$9$kItJ,(B
! 
!=======================================
subroutine vel_u_tb(i,k,im,km,nuh,nuv,dx,dz,u,omg,    &
     &              u_adv,u_cori,u_trb)

  implicit none

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

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

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

  real(8), intent(out) :: u_adv(0:im+1,0:km+1)
  real(8), intent(out) :: u_cori(0:im+1,0:km+1)
  real(8), intent(out) :: u_trb(0:im+1,0:km+1)

  real(8)              :: u_dif(0:im+1,0:km+1)

  !--- $B2;GH8:?j9`(B
  u_dif(i,k) = nuh*(u(i+1,k) - 2*u(i,k) + u(i-1,k))         &
       &       /dx**2.0D0                                   &
       &       + nuv*(u(i,k+1) - 2*u(i,k) + u(i,k-1))       &
       &         /dz**2.0D0

  !--- $B0\N.9`(B
  u_adv(i,k) = u(i,k)*(u(i+1,k) - u(i-1,k))/(4.0D0*dx)      &
       &      + (                                           &
       &         omg(i+1,k+1) + omg(i+1,k-1)                &
       &         + omg(i-1,k+1) + omg(i-1,k-1)              &
       &        )/4.0D0                                     &
       &        *(u(i,k+1) - u(i,k-1))/(2.0D0*dz)           &
       &      - u_dif(i,k)

  !--- $B%3%j%*%j9`(B
  u_cori(i,k) = 0.0D0

  !--- $B3H;69`(B
  u_trb(i,k) = 0.0D0
!  u_trb(i,k) = 2.0D0*km_sub(i,k)                            &
!       &       *(                                           &
!       &         (u(i+1,k) - u(i,k))/dx                     &
!       &          + g13(i,k)*(                              &
!       &                      u(i+1,k+1) + u(i-1,k+1)       &
!       &                      - u(i+1,k-1) - u(i-1,k-1)     &
!       &                     )/(4.0D0*dz)                   &
!       &     

end subroutine vel_u_tb
