!=======================================
! 2D cumulus model - kaminari
!  - subroutine boundary
! 
! Author    : TAKAHASHI Koko
! Date      : 2003/11/11
! Note      : $B6-3&>r7o@_Dj(B
! 
!=======================================
subroutine boundary(i,k,im,km,in,kn,u_bnd,w_bnd,prss_bnd,   &
     &              ptemp_bnd,qv_bnd,qc_bnd,qr_bnd,         &
     &              e_sub_bnd,u,w,omg,prss,ptemp,qv,qc,qr,  &
     &              e_sub)

  implicit none

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

  real(8), intent(in) :: u_bnd(0:im+1,0:km+1)
  real(8), intent(in) :: w_bnd(0:im+1,0:km+1)
  real(8), intent(in) :: prss_bnd(0:im+1,0:km+1)
  real(8), intent(in) :: ptemp_bnd(0:im+1,0:km+1)
  real(8), intent(in) :: qv_bnd(0:im+1,0:km+1)
  real(8), intent(in) :: qc_bnd(0:im+1,0:km+1)
  real(8), intent(in) :: qr_bnd(0:im+1,0:km+1)
  real(8), intent(in) :: e_sub_bnd(0:im+1,0:km+1)

  real(8), intent(out) :: u(0:im+1,0:km+1)
  real(8), intent(out) :: w(0:im+1,0:km+1)
  real(8), intent(out) :: omg(0:im+1,0:km+1)
  real(8), intent(out) :: prss(0:im+1,0:km+1)
  real(8), intent(out) :: ptemp(0:im+1,0:km+1)
  real(8), intent(out) :: qv(0:im+1,0:km+1)
  real(8), intent(out) :: qc(0:im+1,0:km+1)
  real(8), intent(out) :: qr(0:im+1,0:km+1)
  real(8), intent(out) :: e_sub(0:im+1,0:km+1)

  u(i,k) = u_bnd(in,kn)
  w(i,k) = w_bnd(in,kn)
  omg(i,k) = w_bnd(in,kn)
  prss(i,k) = prss_bnd(in,kn)
  ptemp(i,k) = ptemp_bnd(in,kn)
  qv(i,k) = qv_bnd(in,kn)
  qc(i,k) = qc_bnd(in,kn)
  qr(i,k) = qr_bnd(in,kn)
  e_sub(i,k) = e_sub_bnd(in,kn)

end subroutine boundary

