!=======================================
! 2D cumulus model - kaminari
!  - subroutine density
! 
! Author    : TAKAHASHI Koko
! Date      : 2003/11/10
! Note      : $B>qMp>l$G$NL)EY(B
! 
!=======================================
subroutine density(i,k,im,km,prss_sfc,rd,cp,cv,pi,vptemp,dens)

  implicit none

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

  real(8), intent(in) :: prss_sfc,rd,cp,cv
  real(8), intent(in) :: pi(0:im+1,0:km+1)
  real(8), intent(in) :: vptemp(0:im+1,0:km+1)

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

  dens(i,k) = prss_sfc/rd*pi(i,k)**(cv/cp)/vptemp(i,k)

end subroutine density

