Skip to content

Commit a366651

Browse files
authored
Merge pull request #1282 from CliMA/js/global-lai
Use global MODIS LAI for all simulations; remove `modis_lai_fluxnet_sites` artifact
2 parents 9ce082c + 8212bd3 commit a366651

File tree

20 files changed

+274
-160
lines changed

20 files changed

+274
-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: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,20 @@ FluxnetSimulationsExt =
6262
const FT = Float32;
6363
earth_param_set = LP.LandParameters(FT);
6464

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

78+
# Setup the domain for the model:
6779
nelements = 10
6880
zmin = FT(-2)
6981
zmax = FT(0)
@@ -75,28 +87,21 @@ h_stem = FT(9)
7587
h_leaf = FT(9.5)
7688
compartment_midpoints = [h_stem / 2, h_stem + h_leaf / 2]
7789
compartment_surfaces = [zmax, h_stem, h_stem + h_leaf]
78-
land_domain = Column(; zlim = (zmin, zmax), nelements = nelements);
90+
land_domain =
91+
Column(; zlim = (zmin, zmax), nelements = nelements, longlat = (long, lat));
92+
93+
# Specify the time range and dt value over which to perform the simulation.
94+
t0 = Float64(150 * 3600 * 24)# start mid year
95+
N_days = 100
96+
tf = t0 + Float64(3600 * 24 * N_days)
97+
dt = Float64(30)
7998

8099
# - We will be using prescribed atmospheric and radiative drivers from the
81100
# US-MOz tower, which we read in here. We are using prescribed
82101
# atmospheric and radiative flux conditions, but it is also possible to couple
83102
# the simulation with atmospheric and radiative flux models. We also
84103
# read in the observed LAI and let that vary in time in a prescribed manner.
85104

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-
100105
# Forcing data
101106
(; atmos, radiation) = FluxnetSimulationsExt.prescribed_forcing_fluxnet(
102107
site_ID,
@@ -223,12 +228,27 @@ photosynthesis_args =
223228
(; parameters = FarquharParameters(FT, is_c3; Vcmax25 = FT(5e-5)));
224229

225230
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
231+
232+
# Read in LAI from MODIS data
233+
surface_space = land_domain.space.surface;
234+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
235+
start_date = start_date + Second(t0),
236+
end_date = start_date + Second(t0) + Second(tf),
237+
)
238+
LAI = ClimaLand.prescribed_lai_modis(
239+
modis_lai_ncdata_path,
240+
surface_space,
241+
start_date,
242+
);
243+
# Get the maximum LAI at this site over the first year of the simulation
244+
maxLAI = FluxnetSimulationsExt.get_maxLAI_at_site(
245+
modis_lai_ncdata_path[1],
246+
lat,
247+
long,
248+
)
249+
229250
SAI = FT(0.00242)
230251
RAI = (SAI + maxLAI) * f_root_to_shoot;
231-
# Note: LAIfunction was determined from data in the script we included above.
232252
ai_parameterization = PrescribedSiteAreaIndex{FT}(LAI, SAI, RAI)
233253

234254
ψ63 = FT(-4 / 0.0098)
@@ -346,15 +366,7 @@ for i in 1:2
346366
augmented_liquid_fraction.(plant_ν, S_l_ini[i])
347367
end;
348368

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)
369+
# Select the timestepper and solvers needed for the specific problem.
358370

359371
timestepper = CTS.ARS343()
360372
ode_algo = CTS.IMEXAlgorithm(
@@ -374,6 +386,8 @@ set_initial_cache!(p, Y, t0);
374386
# how often we save output, and how often we update
375387
# the forcing data ("drivers")
376388

389+
n = 120
390+
saveat = Array(t0:(n * dt):tf)
377391
sv = (;
378392
t = Array{Float64}(undef, length(saveat)),
379393
saveval = Array{NamedTuple}(undef, length(saveat)),

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

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,21 @@ earth_param_set = LP.LandParameters(FT);
7373
# stomatal conductance model, and atmospheric and radiative flux conditions
7474
# which may be either prescribed or simulated.
7575

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

96119
# - We will be using prescribed atmospheric and radiative drivers from the
97120
# US-MOz tower, which we read in here. We are using prescribed
98121
# atmospheric and radiative flux conditions, but it is also possible to couple
99122
# the simulation with atmospheric and radiative flux models. We also
100123
# read in the observed LAI and let that vary in time in a prescribed manner.
101124

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-
116125
# Forcing data
117126
(; atmos, radiation) = FluxnetSimulationsExt.prescribed_forcing_fluxnet(
118127
site_ID,
@@ -185,8 +194,24 @@ AR_model = AutotrophicRespirationModel{FT}(AR_params);
185194
# Begin by providing general plant parameters. For the area
186195
# indices of the canopy, we choose a `PrescribedSiteAreaIndex`,
187196
# 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)
197+
# Read in LAI from MODIS data
198+
surface_space = land_domain.space.surface;
199+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(
200+
start_date = start_date + Second(t0),
201+
end_date = start_date + Second(t0) + Second(tf),
202+
)
203+
LAI = ClimaLand.prescribed_lai_modis(
204+
modis_lai_ncdata_path,
205+
surface_space,
206+
start_date,
207+
);
208+
# Get the maximum LAI at this site over the first year of the simulation
209+
maxLAI = FluxnetSimulationsExt.get_maxLAI_at_site(
210+
modis_lai_ncdata_path[1],
211+
lat,
212+
long,
213+
);
214+
190215
SAI = FT(0.00242)
191216
f_root_to_shoot = FT(3.5)
192217
RAI = FT((SAI + maxLAI) * f_root_to_shoot)
@@ -281,16 +306,6 @@ for i in 1:2
281306
Y.canopy.hydraulics.ϑ_l.:($i) .= augmented_liquid_fraction.(ν, S_l_ini[i])
282307
end;
283308

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-
294309
# Initialize the cache variables for the canopy using the initial
295310
# conditions and initial time.
296311

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

experiments/integrated/fluxnet/run_fluxnet.jl

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ include(
6060
),
6161
)
6262

63+
land_domain = Column(;
64+
zlim = (zmin, zmax),
65+
nelements = nelements,
66+
dz_tuple = dz_tuple,
67+
longlat = (long, lat),
68+
)
69+
canopy_domain = ClimaLand.Domains.obtain_surface_domain(land_domain)
70+
6371
# This reads in the data from the flux tower site and creates
6472
# the atmospheric and radiative driver structs for the model
6573
include(
@@ -80,8 +88,25 @@ include(
8088
earth_param_set,
8189
FT,
8290
)
83-
(; LAI, maxLAI) =
84-
FluxnetSimulationsExt.prescribed_LAI_fluxnet(site_ID, start_date)
91+
92+
# Read in LAI from MODIS data
93+
surface_space = land_domain.space.surface
94+
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
95+
context = ClimaComms.context(surface_space),
96+
start_date = start_date + Second(t0),
97+
end_date = start_date + Second(t0) + Second(tf),
98+
)
99+
LAI = ClimaLand.prescribed_lai_modis(
100+
modis_lai_ncdata_path,
101+
surface_space,
102+
start_date,
103+
)
104+
# Get the maximum LAI at this site over the first year of the simulation
105+
maxLAI = FluxnetSimulationsExt.get_maxLAI_at_site(
106+
modis_lai_ncdata_path[1],
107+
lat,
108+
long,
109+
);
85110
RAI = maxLAI * f_root_to_shoot
86111
capacity = plant_ν * maxLAI * h_leaf * FT(1000)
87112

0 commit comments

Comments
 (0)