Skip to content

Commit c02adda

Browse files
committed
use global MODIS LAI for all simulations
1 parent 9ce082c commit c02adda

File tree

20 files changed

+280
-160
lines changed

20 files changed

+280
-160
lines changed

Artifacts.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,3 @@ git-tree-sha1 = "c35ba0e899040cb8153226ab751f69100f475d39"
185185
[[mizoguchi_soil_freezing_data.download]]
186186
sha256 = "0027cc080ba45ba33dc790b176ec2854353ce7dce4eae4bef72963b0dd944e0b"
187187
url = "https://caltech.box.com/shared/static/tn1bnqjmegyetw5kzd2ixq5pbnb05s3u.gz"
188-
189-
[modis_lai_fluxnet_sites]
190-
git-tree-sha1 = "cdcc1708832654d2209d267e01a3893c4b25c085"
191-
192-
[[modis_lai_fluxnet_sites.download]]
193-
sha256 = "c74780775d98b56eed74222377604272658f59686d4d7881c7b815b6c230080b"
194-
url = "https://caltech.box.com/shared/static/g6vubma6vcxulb9fl0pvzq6v0oto4iu3.gz"

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ClimaLand.jl Release Notes
33

44
main
55
-------
6+
- Use global MODIS LAI for all simulations; remove `modis_lai_fluxnet_sites` artifact PR[#1282](https://github.com/CliMA/ClimaLand.jl/pull/1282)
67
- Use ClimaUtilities v0.1.25 to read in spatial data to a point using lat/lon PR[#1279](https://github.com/CliMA/ClimaLand.jl/pull/1279)
78
- Add data handling tools to FluxnetSimulationsExt and use throughout docs and experiments PR[#1238](https://github.com/CliMA/ClimaLand.jl/pull/1238)
89
- Add convenience constructors for CanopyModel and integrated models PR[#1255](https://github.com/CliMA/ClimaLand.jl/pull/1255)

docs/src/tutorials/integrated/soil_canopy_tutorial.jl

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ using Insolation
4242
# Load CliMA Packages and ClimaLand Modules:
4343

4444
using ClimaCore
45+
import ClimaComms
46+
ClimaComms.@import_required_backends
4547
import ClimaParams as CP
4648
import ClimaTimeSteppers as CTS
4749
using ClimaLand
@@ -62,8 +64,20 @@ FluxnetSimulationsExt =
6264
const FT = Float32;
6365
earth_param_set = LP.LandParameters(FT);
6466

65-
# Setup the domain for the model:
67+
# First provide some information about the site
68+
site_ID = "US-MOz"
69+
# Timezone (offset from UTC in hrs)
70+
time_offset = 7
71+
start_date = DateTime(2010) + Hour(time_offset)
72+
73+
# Site latitude and longitude
74+
lat = FT(38.7441) # degree
75+
long = FT(-92.2000) # degree
76+
77+
# Height of the sensor at the site
78+
atmos_h = FT(32) # m
6679

80+
# Setup the domain for the model:
6781
nelements = 10
6882
zmin = FT(-2)
6983
zmax = FT(0)
@@ -75,28 +89,21 @@ h_stem = FT(9)
7589
h_leaf = FT(9.5)
7690
compartment_midpoints = [h_stem / 2, h_stem + h_leaf / 2]
7791
compartment_surfaces = [zmax, h_stem, h_stem + h_leaf]
78-
land_domain = Column(; zlim = (zmin, zmax), nelements = nelements);
92+
land_domain =
93+
Column(; zlim = (zmin, zmax), nelements = nelements, longlat = (long, lat));
94+
95+
# Specify the time range and dt value over which to perform the simulation.
96+
t0 = Float64(150 * 3600 * 24)# start mid year
97+
N_days = 100
98+
tf = t0 + Float64(3600 * 24 * N_days)
99+
dt = Float64(30)
79100

80101
# - We will be using prescribed atmospheric and radiative drivers from the
81102
# US-MOz tower, which we read in here. We are using prescribed
82103
# atmospheric and radiative flux conditions, but it is also possible to couple
83104
# the simulation with atmospheric and radiative flux models. We also
84105
# read in the observed LAI and let that vary in time in a prescribed manner.
85106

86-
87-
# First provide some information about the site
88-
site_ID = "US-MOz"
89-
# Timezone (offset from UTC in hrs)
90-
time_offset = 7
91-
start_date = DateTime(2010) + Hour(time_offset)
92-
93-
# Site latitude and longitude
94-
lat = FT(38.7441) # degree
95-
long = FT(-92.2000) # degree
96-
97-
# Height of the sensor at the site
98-
atmos_h = FT(32) # m
99-
100107
# Forcing data
101108
(; atmos, radiation) = FluxnetSimulationsExt.prescribed_forcing_fluxnet(
102109
site_ID,
@@ -223,12 +230,28 @@ photosynthesis_args =
223230
(; parameters = FarquharParameters(FT, is_c3; Vcmax25 = FT(5e-5)));
224231

225232
K_sat_plant = FT(1.8e-8)
226-
(; LAI, maxLAI) =
227-
FluxnetSimulationsExt.prescribed_LAI_fluxnet(site_ID, start_date)
228-
maxLAI = FT(maxLAI) # convert to the float type of our simulation
233+
234+
# Read in LAI from MODIS data
235+
surface_space = land_domain.space.surface
236+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
237+
context = ClimaComms.context(surface_space),
238+
start_date = start_date + Second(t0),
239+
end_date = start_date + Second(t0) + Second(tf),
240+
)
241+
LAI = ClimaLand.prescribed_lai_modis(
242+
modis_lai_ncdata_path,
243+
surface_space,
244+
start_date,
245+
)
246+
# Get the maximum LAI at this site over the first year of the simulation
247+
maxLAI = FluxnetSimulationsExt.get_maxLAI_at_site(
248+
modis_lai_ncdata_path[1],
249+
lat,
250+
long,
251+
);
252+
229253
SAI = FT(0.00242)
230254
RAI = (SAI + maxLAI) * f_root_to_shoot;
231-
# Note: LAIfunction was determined from data in the script we included above.
232255
ai_parameterization = PrescribedSiteAreaIndex{FT}(LAI, SAI, RAI)
233256

234257
ψ63 = FT(-4 / 0.0098)
@@ -346,15 +369,7 @@ for i in 1:2
346369
augmented_liquid_fraction.(plant_ν, S_l_ini[i])
347370
end;
348371

349-
# Select the timestepper and solvers needed for the specific problem. Specify the time range and dt
350-
# value over which to perform the simulation.
351-
352-
t0 = Float64(150 * 3600 * 24)# start mid year
353-
N_days = 100
354-
tf = t0 + Float64(3600 * 24 * N_days)
355-
dt = Float64(30)
356-
n = 120
357-
saveat = Array(t0:(n * dt):tf)
372+
# Select the timestepper and solvers needed for the specific problem.
358373

359374
timestepper = CTS.ARS343()
360375
ode_algo = CTS.IMEXAlgorithm(
@@ -374,6 +389,8 @@ set_initial_cache!(p, Y, t0);
374389
# how often we save output, and how often we update
375390
# the forcing data ("drivers")
376391

392+
n = 120
393+
saveat = Array(t0:(n * dt):tf)
377394
sv = (;
378395
t = Array{Float64}(undef, length(saveat)),
379396
saveval = Array{NamedTuple}(undef, length(saveat)),

docs/src/tutorials/standalone/Canopy/canopy_tutorial.jl

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ using Insolation
4343
# Load CliMA Packages and ClimaLand Modules:
4444

4545
using ClimaCore
46+
import ClimaComms
47+
ClimaComms.@import_required_backends
4648
import ClimaParams as CP
4749
import ClimaTimeSteppers as CTS
4850
using StaticArrays
@@ -73,7 +75,21 @@ earth_param_set = LP.LandParameters(FT);
7375
# stomatal conductance model, and atmospheric and radiative flux conditions
7476
# which may be either prescribed or simulated.
7577

76-
# First, define the parameters of the model domain. These values are needed
78+
# First provide some information about the site
79+
# Timezone (offset from UTC in hrs)
80+
time_offset = 7
81+
start_date = DateTime(2010) + Hour(time_offset)
82+
83+
# Site latitude and longitude
84+
lat = FT(38.7441) # degree
85+
long = FT(-92.2000) # degree
86+
87+
# Height of the sensor at the site
88+
atmos_h = FT(32)
89+
# Site ID
90+
site_ID = "US-MOz";
91+
92+
# Now we define the parameters of the model domain. These values are needed
7793
# by some of the component models. Here we are performing a 1-dimensional
7894
# simulation in a `Point` domain and will use
7995
# single stem and leaf compartments, but for 2D simulations, the parameters of
@@ -91,28 +107,23 @@ h_stem = FT(9)
91107
h_leaf = FT(9.5)
92108
compartment_midpoints = [h_stem / 2, h_stem + h_leaf / 2]
93109
compartment_surfaces = [zmax, h_stem, h_stem + h_leaf]
94-
land_domain = Point(; z_sfc = FT(0.0))
110+
land_domain = Point(; z_sfc = FT(0.0), longlat = (long, lat));
111+
112+
# Select a time range to perform time stepping over, and a dt. As usual,
113+
# the timestep depends on the problem you are solving, the accuracy of the
114+
# solution required, and the timestepping algorithm you are using.
115+
116+
t0 = 0.0
117+
N_days = 364
118+
tf = t0 + 3600 * 24 * N_days
119+
dt = 225.0;
95120

96121
# - We will be using prescribed atmospheric and radiative drivers from the
97122
# US-MOz tower, which we read in here. We are using prescribed
98123
# atmospheric and radiative flux conditions, but it is also possible to couple
99124
# the simulation with atmospheric and radiative flux models. We also
100125
# read in the observed LAI and let that vary in time in a prescribed manner.
101126

102-
# First provide some information about the site
103-
# Timezone (offset from UTC in hrs)
104-
time_offset = 7
105-
start_date = DateTime(2010) + Hour(time_offset)
106-
107-
# Site latitude and longitude
108-
lat = FT(38.7441) # degree
109-
long = FT(-92.2000) # degree
110-
111-
# Height of the sensor at the site
112-
atmos_h = FT(32)
113-
# Site ID
114-
site_ID = "US-MOz";
115-
116127
# Forcing data
117128
(; atmos, radiation) = FluxnetSimulationsExt.prescribed_forcing_fluxnet(
118129
site_ID,
@@ -185,8 +196,25 @@ AR_model = AutotrophicRespirationModel{FT}(AR_params);
185196
# Begin by providing general plant parameters. For the area
186197
# indices of the canopy, we choose a `PrescribedSiteAreaIndex`,
187198
# which supports LAI as a function of time, with RAI and SAI as constant.
188-
(; LAI, maxLAI) =
189-
FluxnetSimulationsExt.prescribed_LAI_fluxnet(site_ID, start_date)
199+
# Read in LAI from MODIS data
200+
surface_space = land_domain.space.surface
201+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(
202+
start_date = start_date + Second(t0),
203+
end_date = start_date + Second(t0) + Second(tf);
204+
context = ClimaComms.context(surface_space),
205+
)
206+
LAI = ClimaLand.prescribed_lai_modis(
207+
modis_lai_ncdata_path,
208+
surface_space,
209+
start_date,
210+
)
211+
# Get the maximum LAI at this site over the first year of the simulation
212+
maxLAI = FluxnetSimulationsExt.get_maxLAI_at_site(
213+
modis_lai_ncdata_path[1],
214+
lat,
215+
long,
216+
);
217+
190218
SAI = FT(0.00242)
191219
f_root_to_shoot = FT(3.5)
192220
RAI = FT((SAI + maxLAI) * f_root_to_shoot)
@@ -281,16 +309,6 @@ for i in 1:2
281309
Y.canopy.hydraulics.ϑ_l.:($i) .= augmented_liquid_fraction.(ν, S_l_ini[i])
282310
end;
283311

284-
# Select a time range to perform time stepping over, and a dt. Also create the
285-
# saveat Array to contain the data from the model at each time step. As usual,
286-
# the timestep depends on the problem you are solving, the accuracy of the
287-
# solution required, and the timestepping algorithm you are using.
288-
289-
t0 = 0.0
290-
N_days = 364
291-
tf = t0 + 3600 * 24 * N_days
292-
dt = 225.0;
293-
294312
# Initialize the cache variables for the canopy using the initial
295313
# conditions and initial time.
296314

experiments/benchmarks/snowy_land.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
203203
photosynthesis_args =
204204
(; parameters = Canopy.FarquharParameters(FT, is_c3; Vcmax25 = Vcmax25))
205205
# Set up plant hydraulics
206-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_single_year_path(;
206+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
207207
context = nothing,
208-
year = Dates.year(Second(t0) + start_date),
208+
start_date = start_date + Second(t0),
209+
end_date = start_date + Second(t0) + Second(tf),
209210
)
210211
LAIfunction = ClimaLand.prescribed_lai_modis(
211212
modis_lai_ncdata_path,

experiments/calibration/forward_model_land.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,11 @@ function setup_prob(
216216
#sc = sc,
217217
))
218218
# Set up plant hydraulics
219-
modis_lai_ncdata_path =
220-
ClimaLand.Artifacts.find_modis_year_paths(date(t0), date(tf); context)
219+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(
220+
date(t0),
221+
date(tf);
222+
context,
223+
)
221224
LAIfunction = ClimaLand.prescribed_lai_modis(
222225
modis_lai_ncdata_path,
223226
surface_space,

experiments/integrated/fluxnet/US-Var/US-Var_parameters.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fluxtower site."""
55
## Ma, S., Baldocchi, D. D., Xu, L., Hehn, T. (2007)
66
## Inter-Annual Variability In Carbon Dioxide Exchange Of An
77
## Oak/Grass Savanna And Open Grassland In California, Agricultural
8-
## And Forest Meteorology, 147(3-4), 157-171. https://doi.org/10.1016/j.agrformet.2007.07.008
8+
## And Forest Meteorology, 147(3-4), 157-171. https://doi.org/10.1016/j.agrformet.2007.07.008
99
## CLM 5.0 Tech Note: https://www2.cesm.ucar.edu/models/cesm2/land/CLM50_Tech_Note.pdf
1010
# Bonan, G. Climate change and terrestrial ecosystem modeling. Cambridge University Press, 2019.
1111

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""This file sets up the domain to run Clima Land on a fluxtower site, using both
2-
the generic parameters set in this file as well as the site-specific parameters
2+
the generic parameters set in this file as well as the site-specific parameters
33
given in the {site-ID}_simulation.jl file in each site directory."""
44

55
# Domain setup
@@ -8,7 +8,3 @@ h_canopy = h_stem + h_leaf
88
compartment_midpoints =
99
n_stem > 0 ? [h_stem / 2, h_stem + h_leaf / 2] : [h_leaf / 2]
1010
compartment_surfaces = n_stem > 0 ? [zmax, h_stem, h_canopy] : [zmax, h_leaf]
11-
12-
land_domain =
13-
Column(; zlim = (zmin, zmax), nelements = nelements, dz_tuple = dz_tuple)
14-
canopy_domain = ClimaLand.Domains.obtain_surface_domain(land_domain)

experiments/integrated/fluxnet/ozark_pft.jl

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import ClimaLand
88
import SciMLBase
99
import ClimaTimeSteppers as CTS
1010
using ClimaCore
11+
import ClimaComms
1112
import ClimaParams as CP
1213
using Dates
1314
using Insolation
@@ -57,6 +58,14 @@ include(
5758
),
5859
)
5960

61+
land_domain = Column(;
62+
zlim = (zmin, zmax),
63+
nelements = nelements,
64+
dz_tuple = dz_tuple,
65+
longlat = (long, lat),
66+
)
67+
canopy_domain = ClimaLand.Domains.obtain_surface_domain(land_domain)
68+
6069
# Define the PFT land cover percentages for the Ozark site. Currently we only
6170
# use the dominant PFT, which for Ozark is deciduous broadleaf temperate trees.
6271
pft_pcts = [
@@ -117,8 +126,25 @@ start_date = DateTime(2010) + Hour(time_offset)
117126
earth_param_set,
118127
FT,
119128
)
120-
(; LAI, maxLAI) =
121-
FluxnetSimulationsExt.prescribed_LAI_fluxnet(site_ID, start_date)
129+
130+
# Read in LAI from MODIS data
131+
surface_space = land_domain.space.surface
132+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(
133+
start_date = start_date + Second(t0),
134+
end_date = start_date + Second(t0) + Second(tf);
135+
context = ClimaComms.context(surface_space),
136+
)
137+
LAI = ClimaLand.prescribed_lai_modis(
138+
modis_lai_ncdata_path,
139+
surface_space,
140+
start_date,
141+
)
142+
# Get the maximum LAI at this site over the first year of the simulation
143+
maxLAI = FluxnetSimulationsExt.get_maxLAI_at_site(
144+
modis_lai_ncdata_path[1],
145+
lat,
146+
long,
147+
);
122148
RAI = maxLAI * f_root_to_shoot
123149
capacity = plant_ν * maxLAI * h_leaf * FT(1000)
124150

0 commit comments

Comments
 (0)