!---------------------------------------------------------------------
!     Copyright (C) GFD Dennou Club, 2004. All rights reserved.
!---------------------------------------------------------------------
                                                                 !=begin
!= Subroutine LatentHeat
!
!   * Developer: KITAMORI Taichi 
!   * Version: $ 
!   * Tag Name: $Name:  $
!   * Change History: 
!
!== Overview 
!
!凝結量から凝結熱を計算する. 
!
!== Error Handling
!
!== Known Bugs
!
!== Note
!
!
!
!== Future Plans
!
                                                                 !=end
subroutine LatentHeat(ss_MassCond, ss_LatHeatPerMass, ss_QCond)

                                                                 !=begin
  !==Dependency
  use dc_trace, only: BeginSub, EndSub  
  use gridset,  only: DimXMin, DimXMax, DimZMin, DimZMax
  use physset,  only: GasR
  use cloudset, only: SatPressB
  use basicset, only: ss_DensBasicZ, ss_ExnerBasicZ, ss_CpBasicZ
                                                                 !=end
  !==暗黙の型宣言を禁止
  implicit none
  
  !==Input
  real(8)                :: ss_LatHeatPerMass(DimXMin:DimXMax, DimZMin:DimZMax) 
  real(8)                :: ss_MassCond(DimXMin:DimXMax, DimZMin:DimZMax) 

  !==Output
  real(8), intent(out)   :: ss_QCond(DimXMin:DimXMax, DimZMin:DimZMax) 
  
  !==Work

  call BeginSub("LatentHeat", &
&           fmt="%c",        &
&           c1="Calculate potential temperature tendency bylatent heating.")

  ss_QCond = ss_LatHeatPerMass * ss_MassCond &
    & / (ss_CpBasicZ * ss_DensBasicZ * ss_ExnerBasicZ)   ! 定数値を与える

  write(*,*) ss_QCond(30,30)
  write(*,*) ss_MassCond(30,30)

  call EndSub("LatentHeat")

end subroutine LatentHeat
