@@ -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
@@ -1131,7 +1131,7 @@ subroutine PhaseChangeH2osfc (bounds, num_nolakec, filter_nolakec, &
11311131 end subroutine PhaseChangeH2osfc
11321132
11331133 !- ----------------------------------------------------------------------
1134- subroutine Phasechange_beta (bounds , num_nolakec , filter_nolakec , dhsdT , &
1134+ subroutine Phasechange (bounds , num_nolakec , filter_nolakec , dhsdT , &
11351135 soilstate_inst , waterstatebulk_inst , waterdiagnosticbulk_inst , waterfluxbulk_inst , energyflux_inst , temperature_inst )
11361136 !
11371137 ! !DESCRIPTION:
@@ -1187,7 +1187,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
11871187
11881188 !- ----------------------------------------------------------------------
11891189
1190- call t_startf( ' PhaseChangebeta ' )
1190+ call t_startf( ' PhaseChange ' )
11911191
11921192 ! Enforce expected array sizes
11931193 SHR_ASSERT_ALL_FL((ubound (dhsdT) == (/ bounds% endc/ )), sourcefile, __LINE__)
@@ -1280,7 +1280,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
12801280 ! If ice exists above melt point, melt some to liquid.
12811281 if (h2osoi_ice(c,j) > 0._r8 .and. t_soisno(c,j) > tfrz) then
12821282 imelt(c,j) = 1
1283- ! tinc(c,j) = t_soisno(c,j) - tfrz
12841283 tinc(c,j) = tfrz - t_soisno(c,j)
12851284 t_soisno(c,j) = tfrz
12861285 endif
@@ -1289,7 +1288,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
12891288 ! If liquid exists below melt point, freeze some to ice.
12901289 if (h2osoi_liq(c,j) > 0._r8 .AND. t_soisno(c,j) < tfrz) then
12911290 imelt(c,j) = 2
1292- ! tinc(c,j) = t_soisno(c,j) - tfrz
12931291 tinc(c,j) = tfrz - t_soisno(c,j)
12941292 t_soisno(c,j) = tfrz
12951293 endif
@@ -1311,7 +1309,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
13111309
13121310 if (h2osoi_ice(c,j) > 0 . .AND. t_soisno(c,j) > tfrz) then
13131311 imelt(c,j) = 1
1314- ! tinc(c,j) = t_soisno(c,j) - tfrz
13151312 tinc(c,j) = tfrz - t_soisno(c,j)
13161313 t_soisno(c,j) = tfrz
13171314 endif
@@ -1335,7 +1332,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
13351332
13361333 if (h2osoi_liq(c,j) > supercool(c,j) .AND. t_soisno(c,j) < tfrz) then
13371334 imelt(c,j) = 2
1338- ! tinc(c,j) = t_soisno(c,j) - tfrz
13391335 tinc(c,j) = tfrz - t_soisno(c,j)
13401336 t_soisno(c,j) = tfrz
13411337 endif
@@ -1344,7 +1340,6 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
13441340 if (h2osno_no_layers(c) > 0._r8 .AND. j == 1 ) then
13451341 if (t_soisno(c,j) > tfrz) then
13461342 imelt(c,j) = 1
1347- ! tincc,j) = t_soisno(c,j) - tfrz
13481343 tinc(c,j) = tfrz - t_soisno(c,j)
13491344 t_soisno(c,j) = tfrz
13501345 endif
@@ -1439,14 +1434,16 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
14391434 heatr = 0._r8
14401435 if (xm(c,j) > 0._r8 ) then ! if there is excess heat to melt the ice
14411436 h2osoi_ice(c,j) = max (0._r8 , wice0(c,j)- xm(c,j))
1442- heatr = hm(c,j) - hfus* (wice0(c,j)- h2osoi_ice(c,j))/ dtime
1443- xm2(c,j) = xm(c,j) - h2osoi_ice(c,j) ! excess ice melting
1444- if (h2osoi_ice(c,j) == 0._r8 ) then ! this might be redundant
1445- if (excess_ice(c,j) >= 0._r8 .and. xm2(c,j)>0._r8 .and. j>= 2 ) then ! if there is excess ice to melt
1446- excess_ice(c,j) = max (0._r8 ,wexice0(c,j) - xm2(c,j))
1447- heatr = hm(c,j) - hfus * (wexice0(c,j)- excess_ice(c,j)+ wice0(c,j)- h2osoi_ice(c,j)) / dtime
1437+ xm2(c,j) = xm(c,j) - wice0(c,j) ! Leftover melt
1438+ if (j>= 1 ) then ! soil
1439+ if (excess_ice(c,j) >= 0._r8 .and. xm2(c,j)>0._r8 ) then ! if there is excess ice to melt
1440+ excess_ice(c,j) = max (0._r8 ,wexice0(c,j) - xm2(c,j))
14481441 endif
1449- endif ! end of excess ice block
1442+ heatr = hm(c,j) - hfus * (wexice0(c,j)- excess_ice(c,j)+ &
1443+ wice0(c,j)- h2osoi_ice(c,j)) / dtime
1444+ else ! snow
1445+ heatr = hm(c,j) - hfus * (wice0(c,j)- h2osoi_ice(c,j)) / dtime
1446+ endif
14501447 else if (xm(c,j) < 0._r8 ) then
14511448 if (j <= 0 ) then
14521449 h2osoi_ice(c,j) = min (wmass0(c,j), wice0(c,j)- xm(c,j)) ! snow
@@ -1536,10 +1533,10 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, &
15361533 end if
15371534 end do
15381535
1539- call t_stopf( ' PhaseChangebeta ' )
1536+ call t_stopf( ' PhaseChange ' )
15401537 end associate
15411538
1542- end subroutine Phasechange_beta
1539+ end subroutine Phasechange
15431540
15441541 !- ----------------------------------------------------------------------
15451542 subroutine ComputeGroundHeatFluxAndDeriv (bounds , &
0 commit comments