INTERFACE:
subroutine PhaseChange (fact, brr, hs, dhsdT, &
tssbef, xmf, c)
DESCRIPTION:
Calculation of the phase change within snow and soil layers:
(1) Check the conditions for which the phase change may take place,
i.e., the layer temperature is great than the freezing point
and the ice mass is not equal to zero (i.e. melting),
or the layer temperature is less than the freezing point
and the liquid water mass is not equal to zero (i.e. freezing).
(2) Assess the rate of phase change from the energy excess (or deficit)
after setting the layer temperature to freezing point.
(3) Re-adjust the ice and liquid mass, and the layer temperature
USES:
use shr_kind_mod, only: r8 => shr_kind_r8
use clmtype
use globals, only: dtime
use clm_varcon, only : tfrz, hfus
use clm_varpar, only : nlevsoi
ARGUMENTS:
implicit none
type (column_type),target,intent(inout):: c !column derived type
real(r8), intent(in) :: tssbef(c%cps%snl+1:nlevsoi) !temperature at previous time step [K]
real(r8), intent(in) :: brr (c%cps%snl+1:nlevsoi) !
real(r8), intent(in) :: fact (c%cps%snl+1:nlevsoi) !temporary variables
real(r8), intent(in) :: hs !net ground heat flux into the surface
real(r8), intent(in) :: dhsdT !temperature derivative of "hs"
real(r8), intent(out):: xmf !total latent heat of phase change
CALLED FROM:
subroutine SoilTemperature in this moduleREVISION HISTORY:
15 September 1999: Yongjiu Dai; Initial code 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision 2/14/02, Peter Thornton: Migrated to new data structures.LOCAL VARIABLES:
local pointers to original implicit in scalars
integer , pointer :: snl !number of snow layers
real(r8), pointer :: h2osno !snow water (mm H2O)
local pointers to original implicit inout scalars
real(r8), pointer :: snowdp !snow height (m)
local pointers tooriginal implicit out scalars
real(r8), pointer :: qflx_snomelt !snow melt (mm H2O /s)
real(r8), pointer :: eflx_snomelt !snow melt heat flux (W/m**2)
local pointers to original implicit in arrays
real(r8), dimension(:), pointer :: h2osoi_liq !liquid water (kg/m2) (new)
real(r8), dimension(:), pointer :: h2osoi_ice !ice lens (kg/m2) (new)
local pointers to original implicit inout arrays
real(r8), dimension(:), pointer :: t_soisno !soil temperature (Kelvin)
local pointers to original implicit out arrays
integer, dimension(:), pointer :: imelt !flag for melting (=1), freezing (=2), Not=0 (new)