Skip to content

Commit 1356084

Browse files
authored
make albedo parameterization modular and make it match CLM (#1184)
1 parent 21bbffb commit 1356084

34 files changed

+432
-259
lines changed

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ ClimaLand.jl Release Notes
33

44
main
55
-------
6-
- Use new pun up initial conditions from 19 year run PR[#1196](https://github.com/CliMA/ClimaLand.jl/pull/1196)
6+
- ![breaking change][badge-💥breaking] Make soil albedo parameterization modular
7+
PR[#1184](https://github.com/CliMA/ClimaLand.jl/pull/1184)
8+
- Use new spun up initial conditions from 19 year run PR[#1196](https://github.com/CliMA/ClimaLand.jl/pull/1196)
79

810
v0.16.3
911
-------

docs/list_of_apis.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ apis = [
1010
"Soil" => [
1111
"Soil Energy and Hydrology" => "APIs/Soil.md",
1212
"Soil Biogeochemistry" => "APIs/SoilBiogeochemistry.md",
13+
"Soil Albedo" => "APIs/SoilAlbedo.md",
1314
],
1415
"Canopy" => [
1516
"Canopy Models" => "APIs/canopy/Canopy.md",

docs/src/APIs/Soil.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ ClimaLand.Soil.subsurface_runoff_source
6464
ClimaLand.Soil.update_runoff!
6565
```
6666

67+
## Soil Albedo Types and Methods
68+
69+
```@docs
70+
ClimaLand.Soil.CLMTwoBandSoilAlbedo
71+
ClimaLand.Soil.ConstantTwoBandSoilAlbedo
72+
ClimaLand.Soil.update_albedo!
73+
```
74+
6775
## Soil BC Methods and Types
6876

6977
```@docs

docs/src/APIs/SoilAlbedo.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
## Parameterizing Soil Albedo
2+
3+
# We currently support two parameterizations for the soil albedo. These
4+
# options are defined using Julia types, using simplified code, as follows.
5+
# We first introduce the abstract type `AbstractSoilAlbedoParameterization`,
6+
# and then the two albedo parameterizations are concrete examples of that
7+
# abstract type:
8+
9+
```julia
10+
ConstantTwoBandSoilAlbedo <: AbstractSoilAlbedoParameterization
11+
CLMTwoBandSoilAlbedo <: AbstractSoilAlbedoParameterization
12+
```
13+
14+
# Each of these types define a method for `update_albedo!`, which is
15+
# called in the soils tendency functions, and each stores the
16+
# parameters required to compute the albedo for that parameterizations.
17+
# For example, the parameterization based off of CLM's approach requires
18+
# the wet and dry soil albedos in the PAR and NIR wavelength bands. For
19+
# each band, the actual albedo is a linear combination of the wet and dry
20+
# values, with a weight depending on the soil moisture. The method
21+
# of update_albedo! for this parameterization computes this linear
22+
# combination using a helper function `albedo_from_moisture` and ultimately
23+
# sets
24+
25+
```julia
26+
@. p.soil.PAR_albedo =
27+
albedo_from_moisture(S_sfc, PAR_albedo_dry, PAR_albedo_wet)
28+
@. p.soil.NIR_albedo =
29+
albedo_from_moisture(S_sfc, NIR_albedo_dry, NIR_albedo_wet)
30+
````
31+
where `S_sfc` is the effective saturation at the surface.
32+
33+
### Creating a new albedo parameterization
34+
35+
# Suppose you want to define a new parameterization which models albedo
36+
# as a linear combination of the albedos of quartz, organic matter, minerals
37+
# and water, treating NIR and PAR albedos the same.
38+
39+
# First, create the type:
40+
41+
```julia
42+
struct SoilAlbedoFromComposition{FT <: AbstractFloat} <: AbstractSoilAlbedoParameterization
43+
α_quartz::FT
44+
α_minerals::FT
45+
α_om::FT
46+
α_water::FT
47+
end
48+
```
49+
50+
# And then create the method. For now, don't worry about the other arguments
51+
# and their types:
52+
53+
```julia
54+
function update_albedo!(
55+
bc::AtmosDrivenFluxBC,
56+
albedo::SoilAlbedoFromComposition,
57+
p,
58+
soil_domain,
59+
model_parameters,
60+
)
61+
# unpack parameters of the albedo model
62+
(; α_quartz, α_minerals, α_om, α_water) = albedo
63+
# unpack composition parameters from the soil parameters
64+
(; ν_ss_om, ν_ss_quartz) = model_parameters
65+
# Extract the values at the top level
66+
ν_ss_om_sfc = ClimaLand.Domains.top_center_to_surface(ν_ss_om)
67+
ν_ss_quartz_sfc = ClimaLand.Domains.top_center_to_surface(ν_ss_quartz)
68+
# Extract the top layer's volumetric water content
69+
θ_l_sfc = ClimaLand.Domains.top_center_to_surface(p.soil.θ_l)
70+
71+
# Compute the linear combination
72+
@. p.soil.PAR_albedo = α_water * θ_l_sfc + (1-θ_l_sfc)* (α_quartz * ν_ss_quartz_sfc + α_om * ν_ss_om_sfc + α_minerals * (1-ν_ss_om - ν_ss_quartz))
73+
p.soil.NIR_albedo .= p.soil.PAR_albedo
74+
end
75+
```

docs/tutorials/integrated/soil_canopy_tutorial.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ soil_α_PAR = FT(0.2)
147147
soil_α_NIR = FT(0.4)
148148

149149
soil_domain = land_domain
150+
soil_albedo = ClimaLand.Soil.ConstantTwoBandSoilAlbedo{FT}(;
151+
PAR_albedo = soil_α_PAR,
152+
NIR_albedo = soil_α_NIR,
153+
)
150154
soil_ps = Soil.EnergyHydrologyParameters(
151155
FT;
152156
ν = soil_ν,
@@ -161,8 +165,7 @@ soil_ps = Soil.EnergyHydrologyParameters(
161165
z_0m = z_0m_soil,
162166
z_0b = z_0b_soil,
163167
emissivity = soil_ϵ,
164-
PAR_albedo = soil_α_PAR,
165-
NIR_albedo = soil_α_NIR,
168+
albedo = soil_albedo,
166169
);
167170

168171
soil_args = (domain = soil_domain, parameters = soil_ps)

docs/tutorials/standalone/Soil/evaporation.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ S_s = FT(1e-3)
102102
ν_ss_quartz = FT(1.0)
103103
ν_ss_gravel = FT(0.0)
104104
emissivity = FT(1.0)
105-
PAR_albedo = FT(0.2)
106-
NIR_albedo = FT(0.4)
107105
z_0m = FT(1e-2)
108106
z_0b = FT(1e-2)
109107
d_ds = FT(0.01)
@@ -117,8 +115,6 @@ params = ClimaLand.Soil.EnergyHydrologyParameters(
117115
K_sat,
118116
S_s,
119117
θ_r,
120-
PAR_albedo,
121-
NIR_albedo,
122118
emissivity,
123119
z_0m,
124120
z_0b,

docs/tutorials/standalone/Soil/evaporation_gilat_loess.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ S_s = FT(1e-3)
4747
ν_ss_quartz = FT(0.3)
4848
ν_ss_gravel = FT(0.0)
4949
emissivity = FT(1.0)
50-
PAR_albedo = FT(0.2)
51-
NIR_albedo = FT(0.4)
5250
z_0m = FT(1e-3)
5351
z_0b = FT(1e-4)
5452
d_ds = FT(0.01)# 10mm
@@ -62,8 +60,6 @@ params = ClimaLand.Soil.EnergyHydrologyParameters(
6260
K_sat,
6361
S_s,
6462
θ_r,
65-
PAR_albedo,
66-
NIR_albedo,
6763
emissivity,
6864
z_0m,
6965
z_0b,

docs/tutorials/standalone/Soil/sublimation.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ S_s = FT(1e-3)
8888
ν_ss_quartz = FT(1.0)
8989
ν_ss_gravel = FT(0.0)
9090
emissivity = FT(1.0)
91-
PAR_albedo = FT(0.2)
92-
NIR_albedo = FT(0.4)
9391
z_0m = FT(1e-3)
9492
z_0b = FT(1e-4)
9593
d_ds = FT(0.01)
@@ -103,8 +101,6 @@ params = ClimaLand.Soil.EnergyHydrologyParameters(
103101
K_sat,
104102
S_s,
105103
θ_r,
106-
PAR_albedo,
107-
NIR_albedo,
108104
emissivity,
109105
z_0m,
110106
z_0b,

experiments/benchmarks/snowy_land.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
116116
NIR_albedo_wet,
117117
f_max,
118118
) = spatially_varying_soil_params
119+
albedo = Soil.CLMTwoBandSoilAlbedo{FT}(;
120+
PAR_albedo_dry,
121+
NIR_albedo_dry,
122+
PAR_albedo_wet,
123+
NIR_albedo_wet,
124+
)
119125
soil_params = Soil.EnergyHydrologyParameters(
120126
FT;
121127
ν,
@@ -126,10 +132,7 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
126132
K_sat,
127133
S_s,
128134
θ_r,
129-
PAR_albedo_dry = PAR_albedo_dry,
130-
NIR_albedo_dry = NIR_albedo_dry,
131-
PAR_albedo_wet = PAR_albedo_wet,
132-
NIR_albedo_wet = NIR_albedo_wet,
135+
albedo,
133136
)
134137
f_over = FT(3.28) # 1/m
135138
R_sb = FT(1.484e-4 / 1000) # m/s

experiments/calibration/forward_model_land.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ function setup_prob(
120120
# min.(NIR_albedo_dry .* α_soil_dry_scaler .* α_soil_scaler, FT(1))
121121
# PAR_albedo_wet .= min.(PAR_albedo_wet .* α_soil_scaler, FT(1))
122122
# NIR_albedo_wet .= min.(NIR_albedo_wet .* α_soil_scaler, FT(1))
123-
123+
albedo = Soil.CLMTwoBandSoilAlbedo{FT}(;
124+
PAR_albedo_dry,
125+
NIR_albedo_dry,
126+
PAR_albedo_wet,
127+
NIR_albedo_wet,
128+
)
124129
soil_params = Soil.EnergyHydrologyParameters(
125130
FT;
126131
ν,
@@ -131,10 +136,7 @@ function setup_prob(
131136
K_sat,
132137
S_s,
133138
θ_r,
134-
PAR_albedo_dry = PAR_albedo_dry,
135-
NIR_albedo_dry = NIR_albedo_dry,
136-
PAR_albedo_wet = PAR_albedo_wet,
137-
NIR_albedo_wet = NIR_albedo_wet,
139+
albedo,
138140
)
139141
f_over = FT(3.28) # 1/m
140142
R_sb = FT(1.484e-4 / 1000) # m/s

0 commit comments

Comments
 (0)