!=======================================
! 2D cumulus model - kaminari
!  - subroutine cal_value
! 
! Author    : TAKAHASHI Koko
! Date      : 2003/12/11 $B?75,:n@.(B
! Note      : $B7W;;NN0h$N$_=PNO$9$k$?$a$N(B
!             $BG[Ns$NF~$l49$((B
! 
!=======================================
subroutine cal_value(im,km,u,omg,prss,pi,temp,ptemp,dens,   &
     &               u_cal,omg_cal,prss_cal,pi_cal,         &
     &               temp_cal,ptemp_cal,dens_cal)

  implicit none

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

  real(8), intent(in) :: u(-2:im+2,-2:km+2)
  real(8), intent(in) :: omg(-2:im+2,-2:km+3)

  real(8), intent(in) :: prss(-2:im+2,-2:km+2)
  real(8), intent(in) :: pi(-2:im+2,-2:km+2)
  real(8), intent(in) :: temp(-2:im+2,-2:km+2)
  real(8), intent(in) :: ptemp(-2:im+2,-2:km+2)
  real(8), intent(in) :: dens(-2:im+2,-2:km+2)

  real(8), intent(out) :: u_cal(0:im,0:km)
  real(8), intent(out) :: omg_cal(0:im,0:km+1)
  real(8), intent(out) :: prss_cal(0:im,0:km)
  real(8), intent(out) :: pi_cal(0:im,0:km)
  real(8), intent(out) :: temp_cal(0:im,0:km)
  real(8), intent(out) :: ptemp_cal(0:im,0:km)
  real(8), intent(out) :: dens_cal(0:im,0:km)


  u_cal(0:im+1,0:km) = u(0:im+1,0:km)
  omg_cal(0:im,0:km+1) = omg(0:im,0:km+1)
  pi_cal(0:im+1,0:km) = pi(0:im+1,0:km)
  prss_cal(0:im+1,0:km) = prss(0:im+1,0:km)
  temp_cal(0:im+1,0:km) = temp(0:im+1,0:km)
  ptemp_cal(0:im+1,0:km) = ptemp(0:im+1,0:km)
  dens_cal(0:im+1,0:km) = dens(0:im+1,0:km)

end subroutine cal_value
