Skip to content

Commit 7f41020

Browse files
authored
end_date -> stop_date; hide MODIS path (#1344)
1 parent 9a8a963 commit 7f41020

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+175
-351
lines changed

docs/src/getting_started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ surface_space = domain.space.surface;
4949
We choose the initial and final simulation times as `DateTime`s, and a timestep in seconds.
5050
```julia
5151
start_date = DateTime(2008);
52-
end_date = start_date + Second(60 * 60 * 72);
52+
stop_date = start_date + Second(60 * 60 * 72);
5353
dt = 1000.0;
5454
```
5555

@@ -103,7 +103,7 @@ end
103103
Now construct the `LandSimulation` object, which contains the model
104104
and additional timestepping information.
105105
```julia
106-
simulation = LandSimulation(start_date, end_date, dt, model; set_ic!, user_callbacks = ());
106+
simulation = LandSimulation(start_date, stop_date, dt, model; set_ic!, user_callbacks = ());
107107
```
108108

109109
Now we can run the simulation!

docs/src/tutorials/calibration/obs_site_level_calibration.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,8 @@ forcing = FluxnetSimulations.prescribed_forcing_fluxnet(
104104
);
105105

106106
# Get Leaf Area Index (LAI) data from MODIS satellite observations.
107-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
108-
start_date,
109-
end_date = stop_date,
110-
)
111-
LAI = ClimaLand.prescribed_lai_modis(
112-
modis_lai_ncdata_path,
113-
domain.space.surface,
114-
start_date,
115-
);
107+
LAI =
108+
ClimaLand.prescribed_lai_modis(domain.space.surface, start_date, stop_date);
116109

117110
# ## Model Setup
118111
#

docs/src/tutorials/calibration/perfect_model_site_level_calibration.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,8 @@ forcing = FluxnetSimulations.prescribed_forcing_fluxnet(
107107
);
108108

109109
# Get Leaf Area Index (LAI) data from MODIS satellite observations.
110-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
111-
start_date,
112-
end_date = stop_date,
113-
)
114-
LAI = ClimaLand.prescribed_lai_modis(
115-
modis_lai_ncdata_path,
116-
domain.space.surface,
117-
start_date,
118-
);
110+
LAI =
111+
ClimaLand.prescribed_lai_modis(domain.space.surface, start_date, stop_date);
119112

120113
# ## Model Setup
121114
#

docs/src/tutorials/global/snowy_land.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,8 @@ forcing = ClimaLand.prescribed_forcing_era5(
6060
);
6161

6262
# MODIS LAI is prescribed for the canopy model:
63-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
64-
context,
65-
start_date,
66-
end_date = stop_date,
67-
)
68-
LAI = ClimaLand.prescribed_lai_modis(
69-
modis_lai_ncdata_path,
70-
domain.space.surface,
71-
start_date;
72-
time_interpolation_method = LinearInterpolation(),
73-
);
63+
LAI =
64+
ClimaLand.prescribed_lai_modis(domain.space.surface, start_date, stop_date);
7465
# Make the model:
7566
model = ClimaLand.LandModel{FT}(forcing, LAI, earth_param_set, domain, Δt);
7667
simulation = ClimaLand.Simulations.LandSimulation(

docs/src/tutorials/integrated/changing_snowy_land_parameterizations.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,8 @@ forcing = FluxnetSimulations.prescribed_forcing_fluxnet(
8484
FT,
8585
);
8686
# LAI for the site - this uses our interface for working with MODIS data.
87-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
88-
start_date,
89-
end_date = stop_date,
90-
);
91-
LAI = ClimaLand.prescribed_lai_modis(
92-
modis_lai_ncdata_path,
93-
domain.space.surface,
94-
start_date,
95-
);
87+
LAI =
88+
ClimaLand.prescribed_lai_modis(domain.space.surface, start_date, stop_date);
9689

9790
# # Setup the integrated model
9891

docs/src/tutorials/integrated/fluxnet_data.jl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,14 @@ domain =
117117
Column(; zlim = (FT(-3.0), FT(0.0)), nelements = 10, longlat = (long, lat))
118118
surface_space = domain.space.surface;
119119
# Get the paths to each year of MODIS data within the start and stop dates.
120-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
121-
start_date,
122-
end_date = stop_date,
123-
)
124-
LAI = ClimaLand.prescribed_lai_modis(
125-
modis_lai_ncdata_path,
126-
surface_space,
127-
start_date,
128-
);
120+
LAI = ClimaLand.prescribed_lai_modis(surface_space, start_date, stop_date);
129121

130122
# Just like with the air temperature, the LAI is an object that we can use
131123
# to linearly interpolate observed LAI to any simulation time.
132124

133125
# It can also be useful to know the maximum LAI at a site. To do so, we
134-
# can call, for the first year of data (first element of `modis_lai_ncdata_path`):
135-
maxLAI =
136-
FluxnetSimulations.get_maxLAI_at_site(modis_lai_ncdata_path[1], lat, long)
126+
# can call, for the first year of data:
127+
maxLAI = FluxnetSimulations.get_maxLAI_at_site(start_date, lat, long)
137128

138129
# # Fluxnet comparison data
139130

docs/src/tutorials/integrated/snowy_land_fluxnet_tutorial.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,8 @@ forcing = FluxnetSimulations.prescribed_forcing_fluxnet(
7676
FT,
7777
);
7878
# LAI for the site - this uses our interface for working with MODIS data.
79-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
80-
start_date,
81-
end_date = stop_date,
82-
)
83-
LAI = ClimaLand.prescribed_lai_modis(
84-
modis_lai_ncdata_path,
85-
domain.space.surface,
86-
start_date,
87-
);
79+
LAI =
80+
ClimaLand.prescribed_lai_modis(domain.space.surface, start_date, stop_date);
8881

8982
# # Setup the integrated model
9083

docs/src/tutorials/integrated/soil_canopy_fluxnet_tutorial.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,8 @@ forcing = FluxnetSimulations.prescribed_forcing_fluxnet(
8080
FT,
8181
);
8282
# LAI for the site - this uses our interface for working with MODIS data.
83-
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
84-
start_date,
85-
end_date = stop_date,
86-
)
87-
LAI = ClimaLand.prescribed_lai_modis(
88-
modis_lai_ncdata_path,
89-
domain.space.surface,
90-
start_date,
91-
);
83+
LAI =
84+
ClimaLand.prescribed_lai_modis(domain.space.surface, start_date, stop_date);
9285

9386
# # Setup the integrated model
9487

docs/src/tutorials/standalone/Bucket/bucket_tutorial.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ bucket_parameters = BucketModelParameters(FT; albedo, z_0m, z_0b, τc);
214214
start_date = DateTime(2005);
215215
# Simulation start date, end time, and timestep
216216

217-
end_date = start_date + Second(7 * 86400);
217+
stop_date = start_date + Second(7 * 86400);
218218
Δt = 3600.0;
219219

220220
# To drive the system in standalone mode,
@@ -302,7 +302,7 @@ ode_algo = CTS.ExplicitAlgorithm(timestepper)
302302
# We need a callback to get and store the auxiliary fields, as they
303303
# are not stored by default. We also need a callback to update the
304304
# drivers (atmos and radiation)
305-
saveat = collect(start_date:Second(Δt):end_date);
305+
saveat = collect(start_date:Second(Δt):stop_date);
306306
saved_values = (;
307307
t = Array{DateTime}(undef, length(saveat)),
308308
saveval = Array{NamedTuple}(undef, length(saveat)),
@@ -314,7 +314,7 @@ updateat = deepcopy(saveat);
314314
# the cache, the driver callbacks, and set the initial conditions.
315315
simulation = LandSimulation(
316316
start_date,
317-
end_date,
317+
stop_date,
318318
Δt,
319319
model;
320320
set_ic! = set_ic!,

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ start_date = DateTime(2010) + Hour(time_offset)
7474
# the timestep depends on the problem you are solving, the accuracy of the
7575
# solution required, and the timestepping algorithm you are using.
7676
N_days = 364
77-
end_date = start_date + Day(N_days)
77+
stop_date = start_date + Day(N_days)
7878
dt = 225.0
7979

8080
# Site latitude and longitude
@@ -136,16 +136,9 @@ forcing = (; atmos, radiation, ground);
136136

137137
# Now we read in time-varying LAI from a global MODIS dataset.
138138
surface_space = domain.space.surface;
139-
modis_lai_ncdata_path =
140-
ClimaLand.Artifacts.modis_lai_multiyear_paths(; start_date, end_date)
141-
LAI = ClimaLand.prescribed_lai_modis(
142-
modis_lai_ncdata_path,
143-
surface_space,
144-
start_date,
145-
);
139+
LAI = ClimaLand.prescribed_lai_modis(surface_space, start_date, stop_date);
146140
# Get the maximum LAI at this site over the first year of the simulation
147-
maxLAI =
148-
FluxnetSimulations.get_maxLAI_at_site(modis_lai_ncdata_path[1], lat, long);
141+
maxLAI = FluxnetSimulations.get_maxLAI_at_site(start_date, lat, long);
149142

150143
# Construct radiative transfer model, overwriting some default parameters.
151144
radiation_parameters = (;
@@ -244,7 +237,7 @@ diagnostics = ClimaLand.Diagnostics.default_diagnostics(
244237

245238
# Create the callback function which updates the forcing variables,
246239
# or drivers.
247-
updateat = Array(start_date:Second(1800):end_date);
240+
updateat = Array(start_date:Second(1800):stop_date);
248241

249242

250243
# Select a timestepping algorithm and setup the ODE problem.
@@ -261,7 +254,7 @@ ode_algo = CTS.IMEXAlgorithm(
261254
# the cache, the driver callbacks, and set the initial conditions.
262255
simulation = LandSimulation(
263256
start_date,
264-
end_date,
257+
stop_date,
265258
dt,
266259
canopy;
267260
set_ic!,

0 commit comments

Comments
 (0)