!=======================================
! 2D cumulus model - kaminari
!  - subroutine boundary_bs
! 
! Author    : TAKAHASHI Koko
! Date      : 2003/12/04 $B?75,:n@.(B
! Note      : $B4pK\>l$N6-3&$h$j30$NG[Ns$NCM(B
! 
!=======================================
subroutine boundary_bs(im,km,                               &
     &                 qv_bs,prss_bs,pi_bs,temp_bs,ptemp_bs,&
     &                 vptemp_bs,dens_bs)

  implicit none

  integer(8), intent(in) :: im, km

  real(8), intent(inout) :: qv_bs(-2:im+2,-2:km+2)
  real(8), intent(inout) :: prss_bs(-2:im+2,-2:km+2)
  real(8), intent(inout) :: pi_bs(-2:im+2,-2:km+2)
  real(8), intent(inout) :: temp_bs(-2:im+2,-2:km+2)
  real(8), intent(inout) :: ptemp_bs(-2:im+2,-2:km+2)
  real(8), intent(inout) :: vptemp_bs(-2:im+2,-2:km+2)
  real(8), intent(inout) :: dens_bs(-2:im+2,-2:km+2)


  !---  k = -1 : $B2<It6-3&(B
  qv_bs(0:im,-1) = qv_bs(0:im,0)
  prss_bs(0:im,-1) = prss_bs(0:im,0)
  pi_bs(0:im,-1) = pi_bs(0:im,0)
  temp_bs(0:im,-1) = temp_bs(0:im,0)
  ptemp_bs(0:im,-1) = ptemp_bs(0:im,0)
  vptemp_bs(0:im,-1) = vptemp_bs(0:im,0)
  dens_bs(0:im,-1) = dens_bs(0:im,0)

  !---  k = -2 : $B2<It6-3&(B
  qv_bs(0:im,-2) = qv_bs(0:im,0)
  prss_bs(0:im,-2) = prss_bs(0:im,0)
  pi_bs(0:im,-2) = pi_bs(0:im,0)
  temp_bs(0:im,-2) = temp_bs(0:im,0)
  ptemp_bs(0:im,-2) = ptemp_bs(0:im,0)
  vptemp_bs(0:im,-2) = vptemp_bs(0:im,0)
  dens_bs(0:im,-2) = dens_bs(0:im,0)

  !---  k = km+1 : $B>eIt6-3&(B
  qv_bs(0:im,km+1) = qv_bs(0:im,km)
  prss_bs(0:im,km+1) = prss_bs(0:im,km)
  pi_bs(0:im,km+1) = pi_bs(0:im,km)
  temp_bs(0:im,km+1) = temp_bs(0:im,km)
  ptemp_bs(0:im,km+1) = ptemp_bs(0:im,km)
  vptemp_bs(0:im,km+1) = vptemp_bs(0:im,km)
  dens_bs(0:im,km+1) = dens_bs(0:im,km)

  !---  k = km+2 : $B>eIt6-3&(B
  qv_bs(0:im,km+2) = qv_bs(0:im,km)
  prss_bs(0:im,km+2) = prss_bs(0:im,km)
  pi_bs(0:im,km+2) = pi_bs(0:im,km)
  temp_bs(0:im,km+2) = temp_bs(0:im,km)
  ptemp_bs(0:im,km+2) = ptemp_bs(0:im,km)
  vptemp_bs(0:im,km+2) = vptemp_bs(0:im,km)
  dens_bs(0:im,km+2) = dens_bs(0:im,km)

  !---  i = im+1 : $BB&LL6-3&(B
  qv_bs(im+1,-2:km+2) = qv_bs(0,-2:km+2)
  prss_bs(im+1,-2:km+2) = prss_bs(0,-2:km+2)
  pi_bs(im+1,-2:km+2) = pi_bs(0,-2:km+2)
  temp_bs(im+1,-2:km+2) = temp_bs(0,-2:km+2)
  ptemp_bs(im+1,-2:km+2) = ptemp_bs(0,-2:km+2)
  vptemp_bs(im+1,-2:km+2) = vptemp_bs(0,-2:km+2)
  dens_bs(im+1,-2:km+2) = dens_bs(0,-2:km+2)

  !---  i = im+2 : $BB&LL6-3&(B
  qv_bs(im+2,-2:km+2) = qv_bs(1,-2:km+2)
  prss_bs(im+2,-2:km+2) = prss_bs(1,-2:km+2)
  pi_bs(im+2,-2:km+2) = pi_bs(1,-2:km+2)
  temp_bs(im+2,-2:km+2) = temp_bs(1,-2:km+2)
  ptemp_bs(im+2,-2:km+2) = ptemp_bs(1,-2:km+2)
  vptemp_bs(im+2,-2:km+2) = vptemp_bs(1,-2:km+2)
  dens_bs(im+2,-2:km+2) = dens_bs(1,-2:km+2)

  !---  i = -1 : $BB&LL6-3&(B
  qv_bs(-1,-2:km+2) = qv_bs(im-1,-2:km+2)
  prss_bs(-1,-2:km+2) = prss_bs(im-1,-2:km+2)
  pi_bs(-1,-2:km+2) = pi_bs(im-1,-2:km+2)
  temp_bs(-1,-2:km+2) = temp_bs(im-1,-2:km+2)
  ptemp_bs(-1,-2:km+2) = ptemp_bs(im-1,-2:km+2)
  vptemp_bs(-1,-2:km+2) = vptemp_bs(km-1,-2:km+2)
  dens_bs(-1,-2:km+2) = dens_bs(im-1,-2:km+2)

  !---  i = -2 : $BB&LL6-3&(B
  qv_bs(-2,-2:km+2) = qv_bs(im-2,-2:km+2)
  prss_bs(-2,-2:km+2) = prss_bs(im-2,-2:km+2)
  pi_bs(-2,-2:km+2) = pi_bs(im-2,-2:km+2)
  temp_bs(-2,-2:km+2) = temp_bs(im-2,-2:km+2)
  ptemp_bs(-2,-2:km+2) = ptemp_bs(im-2,-2:km+2)
  vptemp_bs(-2,-2:km+2) = vptemp_bs(im-2,-2:km+2)
  dens_bs(-2,-2:km+2) = dens_bs(im-2,-2:km+2)

end subroutine boundary_bs
