Skip to content

Commit 424eb44

Browse files
authored
add snow cover fraction and integrated water to compare in ILAMB (#1087)
1 parent 056713d commit 424eb44

File tree

6 files changed

+44
-16
lines changed

6 files changed

+44
-16
lines changed

experiments/long_runs/land_region.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ setup_and_solve_problem(; greet = true);
443443
# read in diagnostics and make some plots!
444444
#### ClimaAnalysis ####
445445
simdir = ClimaAnalysis.SimDir(outdir)
446-
short_names = ["gpp", "ct", "swc", "si"]
446+
short_names = ["gpp", "swc", "si"]
447447
mktempdir(root_path) do tmpdir
448448
for short_name in short_names
449449
var = get(simdir; short_name)

experiments/long_runs/snowy_land.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ function setup_prob(
168168
SAI = FT(0.0) # m2/m2
169169
f_root_to_shoot = FT(3.5)
170170
RAI = FT(1.0)
171-
K_sat_plant = FT(5e-9) # m/s # seems much too small?
172-
ψ63 = FT(-4 / 0.0098) # / MPa to m, Holtzman's original parameter value is -4 MPa
173-
Weibull_param = FT(4) # unitless, Holtzman's original c param value
174-
a = FT(0.05 * 0.0098) # Holtzman's original parameter for the bulk modulus of elasticity
171+
K_sat_plant = FT(7e-8) # m/s
172+
ψ63 = FT(-4 / 0.0098) # / MPa to m
173+
Weibull_param = FT(4) # unitless
174+
a = FT(0.2 * 0.0098) # 1/m
175175
conductivity_model =
176176
Canopy.PlantHydraulics.Weibull{FT}(K_sat_plant, ψ63, Weibull_param)
177177
retention_model = Canopy.PlantHydraulics.LinearRetentionCurve{FT}(a)
@@ -494,6 +494,7 @@ short_names = [
494494
"iwc",
495495
"trans",
496496
"msf",
497+
"snowc",
497498
]
498499

499500
include(

src/diagnostics/Diagnostics.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import Dates: Month, Period
44

55
import ClimaComms
66

7+
import ..Parameters as LP
8+
79
using ..Bucket: BucketModel
810

911
import ..SoilCanopyModel

src/diagnostics/default_diagnostics.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ function default_diagnostics(
322322
"shf",
323323
"ghf",
324324
"iwc",
325+
"snowc",
325326
]
326327
elseif output_vars == :short
327328
snowyland_diagnostics = [
328329
"gpp",
329-
"ct",
330330
"swc",
331331
"si",
332332
"sie",
@@ -344,6 +344,7 @@ function default_diagnostics(
344344
"iwc",
345345
"swd",
346346
"lwd",
347+
"snowc",
347348
]
348349
end
349350

src/diagnostics/define_diagnostics.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -820,12 +820,12 @@ function define_diagnostics!(land_model)
820820

821821
add_diagnostic_variable!(
822822
short_name = "iwc",
823-
long_name = "Integrated Soil Water Content in first 1m",
824-
standard_name = "soil_1m_water_content",
825-
units = "m",
826-
comments = "The integrated water content to a depth of 1m",
823+
long_name = "Integrated Soil Water Mass in first 10cm",
824+
standard_name = "soil_10cm_water_mass",
825+
units = "kg/m^2",
826+
comments = "The integrated water mass to a depth of 10cm",
827827
compute! = (out, Y, p, t) ->
828-
compute_1m_water_content!(out, Y, p, t, land_model),
828+
compute_10cm_water_mass!(out, Y, p, t, land_model),
829829
)
830830

831831
# Plant water content
@@ -887,4 +887,14 @@ function define_diagnostics!(land_model)
887887
compute_snow_depth!(out, Y, p, t, land_model),
888888
)
889889

890+
# Snow cover fraction
891+
add_diagnostic_variable!(
892+
short_name = "snowc",
893+
long_name = "Snow cover fraction",
894+
standard_name = "snow_cover_fraction",
895+
units = "",
896+
comments = "The snow cover fraction",
897+
compute! = (out, Y, p, t) ->
898+
compute_snow_cover_fraction!(out, Y, p, t, land_model),
899+
)
890900
end

src/diagnostics/land_compute_methods.jl

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ end
202202
@diagnostic_compute "soil_net_radiation" Union{SoilCanopyModel, LandModel} p.soil.R_n
203203
@diagnostic_compute "soil_temperature" Union{SoilCanopyModel, LandModel} p.soil.T
204204

205-
function compute_1m_water_content!(
205+
function compute_10cm_water_mass!(
206206
out,
207207
Y,
208208
p,
@@ -212,13 +212,26 @@ function compute_1m_water_content!(
212212
∫Hθdz = p.soil.sfc_scratch
213213
= p.soil.sub_sfc_scratch
214214
z = land_model.soil.domain.fields.z
215-
depth = FT(-1)
216-
@.= (Y.soil.ϑ_l + Y.soil.θ_i) * heaviside(z, depth)
215+
depth = FT(-0.1)
216+
earth_param_set = land_model.soil.parameters.earth_param_set
217+
_ρ_liq = LP.ρ_cloud_liq(earth_param_set)
218+
_ρ_ice = LP.ρ_cloud_ice(earth_param_set)
219+
# Convert from volumetric water content to water mass per unit volume using density
220+
@.= (Y.soil.ϑ_l * _ρ_liq + Y.soil.θ_i * _ρ_ice) * heaviside(z, depth)
217221
column_integral_definite!(∫Hθdz, Hθ)
222+
223+
# The layering of the soil model may not coincide with 10 cm exactly, and this could lead
224+
# to the integral above not exactly representing 10cm.
225+
# To adjust, divide by the ∫heaviside(z, depth) dz, and then multiply by 10cm
226+
H = p.subsfc_scratch
227+
@. H = heaviside(z, depth)
228+
∫Hdz = p.sfc_scratch
229+
column_integral_definite!(∫Hdz, H)
230+
218231
if isnothing(out)
219-
return ∫Hθdz
232+
return ∫Hθdz ./ ∫Hdz .* FT(0.1)
220233
else
221-
out .= ∫Hθdz
234+
@. out = ∫Hθdz / ∫Hdz * FT(0.1)
222235
end
223236
end
224237
function compute_soil_albedo!(
@@ -464,6 +477,7 @@ end
464477

465478
@diagnostic_compute "snow_water_equivalent" LandModel Y.snow.S
466479
@diagnostic_compute "snow_depth" LandModel p.snow.z_snow
480+
@diagnostic_compute "snow_cover_fraction" LandModel p.snow.snow_cover_fraction
467481

468482
### EnergyHydrology ###
469483

0 commit comments

Comments
 (0)