@@ -78,7 +78,7 @@ module SoilTemperatureMod
7878 ! !PRIVATE MEMBER FUNCTIONS:
7979 private :: SoilThermProp ! Set therm conduct. and heat cap of snow/soil layers
8080 private :: PhaseChangeH2osfc ! When surface water freezes move ice to bottom snow layer
81- private :: PhaseChange_beta ! Calculation of the phase change within snow and soil layers
81+ private :: PhaseChange ! Calculation of the phase change within snow and soil layers
8282 private :: BuildingHAC ! Building Heating and Cooling for simpler method (introduced in CLM4.5)
8383
8484 real (r8 ), private , parameter :: thin_sfclayer = 1.0e-6_r8 ! Threshold for thin surface layer
@@ -517,7 +517,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_urbanc, filter
517517 dhsdT(bounds% begc:bounds% endc), &
518518 waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, temperature_inst,energyflux_inst)
519519
520- call Phasechange_beta (bounds, num_nolakec, filter_nolakec, &
520+ call Phasechange (bounds, num_nolakec, filter_nolakec, &
521521 dhsdT(bounds% begc:bounds% endc), &
522522 soilstate_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, energyflux_inst, temperature_inst)
523523
@@ -1130,7 +1130,7 @@ subroutine PhaseChangeH2osfc (bounds, num_nolakec, filter_nolakec, &
11301130 end subroutine PhaseChangeH2osfc
11311131
11321132 !- ----------------------------------------------------------------------
1133- subroutine Phasechange_beta (bounds , num_nolakec , filter_nolakec , dhsdT , &
1133+ subroutine Phasechange (bounds , num_nolakec , filter_nolakec , dhsdT , &
11341134 soilstate_inst , waterstatebulk_inst , waterdiagnosticbulk_inst , waterfluxbulk_inst , energyflux_inst , temperature_inst )
11351135 !
11361136 ! !DESCRIPTION:
@@ -1186,7 +1186,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
11861186
11871187 !- ----------------------------------------------------------------------
11881188
1189- call t_startf( ' PhaseChangebeta ' )
1189+ call t_startf( ' PhaseChange ' )
11901190
11911191 ! Enforce expected array sizes
11921192 SHR_ASSERT_ALL_FL((ubound (dhsdT) == (/ bounds% endc/ )), sourcefile, __LINE__)
@@ -1279,7 +1279,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
12791279 ! If ice exists above melt point, melt some to liquid.
12801280 if (h2osoi_ice(c,j) > 0._r8 .and. t_soisno(c,j) > tfrz) then
12811281 imelt(c,j) = 1
1282- ! tinc(c,j) = t_soisno(c,j) - tfrz
12831282 tinc(c,j) = tfrz - t_soisno(c,j)
12841283 t_soisno(c,j) = tfrz
12851284 endif
@@ -1288,7 +1287,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
12881287 ! If liquid exists below melt point, freeze some to ice.
12891288 if (h2osoi_liq(c,j) > 0._r8 .AND. t_soisno(c,j) < tfrz) then
12901289 imelt(c,j) = 2
1291- ! tinc(c,j) = t_soisno(c,j) - tfrz
12921290 tinc(c,j) = tfrz - t_soisno(c,j)
12931291 t_soisno(c,j) = tfrz
12941292 endif
@@ -1310,7 +1308,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
13101308
13111309 if (h2osoi_ice(c,j) > 0 . .AND. t_soisno(c,j) > tfrz) then
13121310 imelt(c,j) = 1
1313- ! tinc(c,j) = t_soisno(c,j) - tfrz
13141311 tinc(c,j) = tfrz - t_soisno(c,j)
13151312 t_soisno(c,j) = tfrz
13161313 endif
@@ -1334,7 +1331,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
13341331
13351332 if (h2osoi_liq(c,j) > supercool(c,j) .AND. t_soisno(c,j) < tfrz) then
13361333 imelt(c,j) = 2
1337- ! tinc(c,j) = t_soisno(c,j) - tfrz
13381334 tinc(c,j) = tfrz - t_soisno(c,j)
13391335 t_soisno(c,j) = tfrz
13401336 endif
@@ -1343,7 +1339,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
13431339 if (h2osno_no_layers(c) > 0._r8 .AND. j == 1 ) then
13441340 if (t_soisno(c,j) > tfrz) then
13451341 imelt(c,j) = 1
1346- ! tincc,j) = t_soisno(c,j) - tfrz
13471342 tinc(c,j) = tfrz - t_soisno(c,j)
13481343 t_soisno(c,j) = tfrz
13491344 endif
@@ -1438,14 +1433,18 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
14381433 heatr = 0._r8
14391434 if (xm(c,j) > 0._r8 ) then ! if there is excess heat to melt the ice
14401435 h2osoi_ice(c,j) = max (0._r8 , wice0(c,j)- xm(c,j))
1441- heatr = hm(c,j) - hfus * ( wice0(c,j) - h2osoi_ice(c,j)) / dtime
1442- xm2(c,j) = xm(c,j) - h2osoi_ice(c,j) ! excess ice melting
1443- if (h2osoi_ice( c,j) == 0._r8 ) then ! this might be redundant
1444- if (excess_ice(c,j) > = 0._r8 .and. xm2(c,j)> 0._r8 .and. j >= 2 ) then ! if there is excess ice to melt
1445- excess_ice(c,j) = max ( 0._r8 ,wexice0(c,j) - xm2(c,j))
1446- heatr = hm (c,j) - hfus * ( wexice0(c,j)- excess_ice (c,j)+ wice0(c,j) - h2osoi_ice(c,j)) / dtime
1436+ ! If xm > wice0, then all soil ice melts,
1437+ ! and the remaining heat (xm2) is used to melt excess ice
1438+ xm2( c,j) = xm(c,j) - wice0(c,j)
1439+ if (j >= 1 ) then ! soil
1440+ if ( excess_ice(c,j) > = 0._r8 .and. xm2(c,j)> 0._r8 ) then ! if there is excess ice to melt
1441+ excess_ice (c,j) = max ( 0._r8 , wexice0(c,j) - xm2 (c,j))
14471442 endif
1448- endif ! end of excess ice block
1443+ heatr = hm(c,j) - hfus * (wexice0(c,j)- excess_ice(c,j)+ &
1444+ wice0(c,j)- h2osoi_ice(c,j)) / dtime
1445+ else ! snow
1446+ heatr = hm(c,j) - hfus * (wice0(c,j)- h2osoi_ice(c,j)) / dtime
1447+ endif
14491448 else if (xm(c,j) < 0._r8 ) then
14501449 if (j <= 0 ) then
14511450 h2osoi_ice(c,j) = min (wmass0(c,j), wice0(c,j)- xm(c,j)) ! snow
@@ -1535,10 +1534,10 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
15351534 end if
15361535 end do
15371536
1538- call t_stopf( ' PhaseChangebeta ' )
1537+ call t_stopf( ' PhaseChange ' )
15391538 end associate
15401539
1541- end subroutine Phasechange_beta
1540+ end subroutine Phasechange
15421541
15431542 !- ----------------------------------------------------------------------
15441543 subroutine ComputeGroundHeatFluxAndDeriv (bounds , &
0 commit comments