Skip to content

Commit 631c69b

Browse files
Merge pull request #1292 from CliMA/tn/4_sites_sim_ext
created extension module functions + tests for 4 ameriflux sites
2 parents b638fcd + 8fd5d9c commit 631c69b

File tree

8 files changed

+1136
-1
lines changed

8 files changed

+1136
-1
lines changed

ext/FluxnetSimulationsExt.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ using DocStringExtensions
1010
using Insolation
1111
import ClimaLand.Parameters as LP
1212
using ClimaLand
13+
using ClimaLand.Canopy
14+
using ClimaLand.PlantHydraulics
1315
export prescribed_forcing_fluxnet,
1416
set_fluxnet_ic!, get_comparison_data, get_data_dates, get_data_dt
1517

@@ -19,7 +21,7 @@ include("fluxnet_simulations/US-MOz.jl")
1921
include("fluxnet_simulations/US-Ha1.jl")
2022
include("fluxnet_simulations/US-NR1.jl")
2123
include("fluxnet_simulations/US-Var.jl")
22-
# export get_parameters, get_domain_info - TODO uncomment once we implement these
24+
export get_parameters, get_domain_info
2325

2426
include("fluxnet_simulations/data_processing.jl")
2527
include("fluxnet_simulations/forcing.jl")

ext/fluxnet_simulations/US-Ha1.jl

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,181 @@
1+
#=
2+
This file contains domain specifications, parameters, and other site-level information for running
3+
ClimaLand at the US-Ha1 fluxtower site.
4+
Citation: J. William Munger (2022), AmeriFlux FLUXNET-1F US-Ha1 Harvard Forest EMS Tower (HFR1), Ver. 3-5, AmeriFlux AMP, (Dataset). https://doi.org/10.17190/AMF/1871137
5+
=#
16

7+
"""
8+
get_domain_info(FT, ::Val{:US_Ha1}; dz_bottom = FT(1.5), dz_top = FT(0.025),
9+
nelements = 20, zmin = FT(-10), zmax = FT(0))
10+
11+
Gets and returns primary domain information for the US-Ha1 (Massachusetts
12+
Harvard Forest) Fluxnet site. The values are provided as defaults, and can be
13+
overwritten by passing the corresponding keyword arguments to this function.
14+
"""
15+
function get_domain_info(
16+
FT,
17+
::Val{:US_Ha1};
18+
dz_bottom = FT(1.5),
19+
dz_top = FT(0.025),
20+
nelements = 20,
21+
zmin = FT(-10),
22+
zmax = FT(0),
23+
)
24+
25+
dz_tuple = (dz_bottom, dz_top)
26+
return (; dz_tuple, nelements, zmin, zmax)
27+
end
28+
29+
"""
30+
get_location(FT, ::Val{:US_Ha1}; kwargs...)
31+
32+
Returns geographical information for US-Ha1 (Massachusetts Harvard Forest) Fluxnet site.
33+
The values are provided as defaults, and can be overwritten by passing the corresponding
34+
keyword arguments to this function.
35+
"""
36+
function get_location(
37+
FT,
38+
::Val{:US_Ha1};
39+
time_offset = 5,
40+
lat = FT(42.5378),
41+
long = FT(-72.1715),
42+
)
43+
return (; time_offset, lat, long)
44+
end
45+
46+
"""
47+
get_fluxtower_height(FT, ::Val{:US_Ha1}; kwargs...)
48+
49+
Returns atmosphere height for US-Ha1 (Massachusetts Harvard Forest) Fluxnet site.
50+
The values are provided as defaults, and can be overwritten by passing the
51+
corresponding keyword arguments to this function.
52+
53+
Data sources:
54+
55+
Atmosphere height:
56+
- https://atmos.seas.harvard.edu/research-harvard_forest-instrumentation
57+
"""
58+
function get_fluxtower_height(FT, ::Val{:US_Ha1}; atmos_h = FT(30))
59+
return (; atmos_h,)
60+
end
61+
62+
"""
63+
get_parameters(FT, ::Val{:US_Ha1}; kwargs...)
64+
65+
Gets parameters for the Fluxnet site US-Ha1 (Massachusetts Harvard Forest),
66+
which is a Deciduous Broadleaf Forest, and returns them as a Named Tuple.
67+
Default parameters are provided and can be overriden using keyword arguments.
68+
69+
Soil parameters:
70+
- Wang et al. 2021, https://doi.org/10.5194/gmd-14-6741-2021
71+
Conductance parameters:
72+
- Wang et al. 2021, https://doi.org/10.5194/gmd-14-6741-2021
73+
Photosynthesis parameters:
74+
- Holtzman, Nataniel, et al. 2023, https://doi.org/10.1029/2023WR035481
75+
Hydraulics parameters:
76+
- Holtzman, Nataniel, et al. 2023, https://doi.org/10.1029/2023WR035481
77+
"""
78+
function get_parameters(
79+
FT,
80+
::Val{:US_Ha1};
81+
soil_ν = FT(0.5),
82+
soil_K_sat = FT(4e-7),
83+
soil_S_s = FT(1e-3),
84+
soil_vg_n = FT(2.05),
85+
soil_vg_α = FT(0.04),
86+
θ_r = FT(0.067),
87+
ν_ss_quartz = FT(0.1),
88+
ν_ss_om = FT(0.1),
89+
ν_ss_gravel = FT(0.0),
90+
z_0m_soil = FT(0.01),
91+
z_0b_soil = FT(0.001),
92+
soil_ϵ = FT(0.98),
93+
soil_α_PAR = FT(0.2),
94+
soil_α_NIR = FT(0.2),
95+
Ω = FT(0.69),
96+
χl = FT(0.5),
97+
G_Function = ConstantGFunction(χl),
98+
α_PAR_leaf = FT(0.1),
99+
λ_γ_PAR = FT(5e-7),
100+
τ_PAR_leaf = FT(0.05),
101+
α_NIR_leaf = FT(0.45),
102+
τ_NIR_leaf = FT(0.25),
103+
ϵ_canopy = FT(0.97),
104+
ac_canopy = FT(2.5e3),
105+
g1 = FT(141),
106+
Drel = FT(1.6),
107+
g0 = FT(1e-4),
108+
Vcmax25 = FT(9e-5),
109+
SAI = FT(1.0),
110+
f_root_to_shoot = FT(3.5),
111+
K_sat_plant = 5e-9,
112+
ψ63 = FT(-4 / 0.0098),
113+
Weibull_param = FT(4),
114+
a = FT(0.05 * 0.0098),
115+
conductivity_model = PlantHydraulics.Weibull{FT}(
116+
K_sat_plant,
117+
ψ63,
118+
Weibull_param,
119+
),
120+
retention_model = PlantHydraulics.LinearRetentionCurve{FT}(a),
121+
plant_ν = FT(2.46e-4),
122+
plant_S_s = FT(1e-2 * 0.0098),
123+
rooting_depth = FT(0.5),
124+
n_stem = Int64(1),
125+
n_leaf = Int64(1),
126+
h_leaf = FT(12),
127+
h_stem = FT(14),
128+
h_canopy = h_leaf + h_stem,
129+
z0_m = FT(0.13) * h_canopy,
130+
z0_b = FT(0.1) * z0_m,
131+
)
132+
return (;
133+
soil_ν,
134+
soil_K_sat,
135+
soil_S_s,
136+
soil_vg_n,
137+
soil_vg_α,
138+
θ_r,
139+
ν_ss_quartz,
140+
ν_ss_om,
141+
ν_ss_gravel,
142+
z_0m_soil,
143+
z_0b_soil,
144+
soil_ϵ,
145+
soil_α_PAR,
146+
soil_α_NIR,
147+
Ω,
148+
χl,
149+
G_Function,
150+
α_PAR_leaf,
151+
λ_γ_PAR,
152+
τ_PAR_leaf,
153+
α_NIR_leaf,
154+
τ_NIR_leaf,
155+
ϵ_canopy,
156+
ac_canopy,
157+
g1,
158+
Drel,
159+
g0,
160+
Vcmax25,
161+
SAI,
162+
f_root_to_shoot,
163+
K_sat_plant,
164+
ψ63,
165+
Weibull_param,
166+
a,
167+
conductivity_model,
168+
retention_model,
169+
plant_ν,
170+
plant_S_s,
171+
rooting_depth,
172+
n_stem,
173+
n_leaf,
174+
h_leaf,
175+
h_stem,
176+
h_canopy,
177+
z0_m,
178+
z0_b,
179+
)
180+
181+
end

ext/fluxnet_simulations/US-MOz.jl

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,175 @@
1+
#=
2+
This file contains domain specifications, parameters, and other site-level information for running
3+
ClimaLand at the US-MOz fluxtower site.
4+
Citation: Jeffrey Wood, Lianhong Gu (2025), AmeriFlux FLUXNET-1F US-MOz Missouri Ozark Site, Ver. 5-7, AmeriFlux AMP, (Dataset). https://doi.org/10.17190/AMF/1854370
5+
=#
16

7+
"""
8+
get_domain_info(FT, ::Val{:US_MOz}; dz_bottom = FT(1.5), dz_top = FT(0.1),
9+
nelements = 20, zmin = FT(-10), zmax = FT(0))
10+
11+
Gets and returns primary domain information for the US-MOz (Missouri Ozark)
12+
Fluxnet site. Default parameters are provided and can be overriden using keyword arguments.
13+
"""
14+
function get_domain_info(
15+
FT,
16+
::Val{:US_MOz};
17+
dz_bottom = FT(1.5),
18+
dz_top = FT(0.1),
19+
nelements = 20,
20+
zmin = FT(-10),
21+
zmax = FT(0),
22+
)
23+
24+
dz_tuple = (dz_bottom, dz_top)
25+
26+
return (; dz_tuple, nelements, zmin, zmax)
27+
end
28+
29+
"""
30+
get_location(FT, ::Val{:US_MOz}; kwargs)
31+
32+
Returns geographical information for US-MOz (Missouri Ozark) Fluxnet site.
33+
The values are provided as defaults, and can be overwritten by passing the
34+
corresponding keyword arguments to this function.
35+
"""
36+
function get_location(
37+
FT,
38+
::Val{:US_MOz};
39+
time_offset = 7,
40+
lat = FT(38.7441),
41+
long = FT(-92.2000),
42+
)
43+
return (; time_offset, lat, long)
44+
end
45+
46+
"""
47+
get_fluxtower_height(FT, ::Val{:US_MOz}; kwargs...)
48+
49+
Returns atmosphere height for US-Ha1 (Missouri Ozark) Fluxnet site.
50+
The values are provided as defaults, and can be overwritten by passing the
51+
corresponding keyword arguments to this function.
52+
"""
53+
function get_fluxtower_height(FT, ::Val{:US_MOz}; atmos_h = FT(32))
54+
return (; atmos_h,)
55+
end
56+
57+
"""
58+
get_parameters(FT, ::Val{:US_MOz}; kwargs...)
59+
60+
Gets parameters for the Fluxnet site US-MOz (Missouri Ozark), which is a Deciduous Broadleaf Forest,
61+
and returns them as a Named Tuple. The values are provided as defaults, and
62+
can be overwritten by passing the corresponding keyword arguments to this function.
63+
64+
Data sources:
65+
66+
Conductance parameters:
67+
- Wang et al. 2021 https://doi.org/10.5194/gmd-14-6741-2021
68+
Hydraulics parameters:
69+
- Holtzman, Nataniel, et al. 2023, https://doi.org/10.1029/2023WR035481
70+
"""
71+
function get_parameters(
72+
FT,
73+
::Val{:US_MOz};
74+
soil_ν = FT(0.55),
75+
soil_K_sat = FT(4e-7),
76+
soil_S_s = FT(1e-2),
77+
soil_vg_n = FT(2.0),
78+
soil_vg_α = FT(0.05),
79+
θ_r = FT(0.04),
80+
ν_ss_quartz = FT(0.1),
81+
ν_ss_om = FT(0.1),
82+
ν_ss_gravel = FT(0.0),
83+
z_0m_soil = FT(0.01),
84+
z_0b_soil = FT(0.01),
85+
soil_ϵ = FT(0.98),
86+
soil_α_PAR = FT(0.2),
87+
soil_α_NIR = FT(0.2),
88+
Ω = FT(0.69),
89+
χl = FT(0.1),
90+
G_Function = CLMGFunction(χl),
91+
α_PAR_leaf = FT(0.1),
92+
λ_γ_PAR = FT(5e-7),
93+
τ_PAR_leaf = FT(0.05),
94+
α_NIR_leaf = FT(0.45),
95+
τ_NIR_leaf = FT(0.25),
96+
ϵ_canopy = FT(0.97),
97+
ac_canopy = FT(5e2),
98+
g1 = FT(141),
99+
Drel = FT(1.6),
100+
g0 = FT(1e-4),
101+
Vcmax25 = FT(6e-5),
102+
pc = FT(-2.0e6),
103+
sc = FT(5e-6),
104+
SAI = FT(1.0),
105+
f_root_to_shoot = FT(3.5),
106+
K_sat_plant = 7e-8,
107+
ψ63 = FT(-4 / 0.0098),
108+
Weibull_param = FT(4),
109+
a = FT(0.1 * 0.0098),
110+
conductivity_model = PlantHydraulics.Weibull{FT}(
111+
K_sat_plant,
112+
ψ63,
113+
Weibull_param,
114+
),
115+
retention_model = PlantHydraulics.LinearRetentionCurve{FT}(a),
116+
plant_ν = FT(1.44e-4),
117+
plant_S_s = FT(1e-2 * 0.0098),
118+
rooting_depth = FT(0.5),
119+
n_stem = Int64(1),
120+
n_leaf = Int64(1),
121+
h_stem = FT(9),
122+
h_leaf = FT(9.5),
123+
h_canopy = h_stem + h_leaf,
124+
z0_m = FT(0.13) * h_canopy,
125+
z0_b = FT(0.1) * z0_m,
126+
)
127+
return (;
128+
soil_ν,
129+
soil_K_sat,
130+
soil_S_s,
131+
soil_vg_n,
132+
soil_vg_α,
133+
θ_r,
134+
ν_ss_quartz,
135+
ν_ss_om,
136+
ν_ss_gravel,
137+
z_0m_soil,
138+
z_0b_soil,
139+
soil_ϵ,
140+
soil_α_PAR,
141+
soil_α_NIR,
142+
Ω,
143+
χl,
144+
G_Function,
145+
α_PAR_leaf,
146+
λ_γ_PAR,
147+
τ_PAR_leaf,
148+
α_NIR_leaf,
149+
τ_NIR_leaf,
150+
ϵ_canopy,
151+
ac_canopy,
152+
g1,
153+
Drel,
154+
g0,
155+
Vcmax25,
156+
SAI,
157+
f_root_to_shoot,
158+
K_sat_plant,
159+
ψ63,
160+
Weibull_param,
161+
a,
162+
conductivity_model,
163+
retention_model,
164+
plant_ν,
165+
plant_S_s,
166+
rooting_depth,
167+
n_stem,
168+
n_leaf,
169+
h_leaf,
170+
h_stem,
171+
h_canopy,
172+
z0_m,
173+
z0_b,
174+
)
175+
end

0 commit comments

Comments
 (0)