Skip to content

Commit 6f7648f

Browse files
committed
fix up docs
1 parent c7613ac commit 6f7648f

File tree

6 files changed

+100
-46
lines changed

6 files changed

+100
-46
lines changed

docs/make.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,25 @@ include("list_diagnostics.jl")
5252
pages = Any[
5353
"Home" => "index.md",
5454
"Running your first simulation" => "getting_started.md",
55-
"ClimaLand structure" => [
55+
"Tutorials" => tutorials,
56+
"Additional resources" => [
5657
"Model structure" => "model_structure.md",
5758
"Repository structure" => "repo_structure.md",
59+
"Analyzing model output" => [
60+
"Diagnostics" => diagnostics,
61+
"Leaderboard" => "leaderboard/leaderboard.md",
62+
],
63+
"Running on GPU or with MPI" => "architectures.md",
64+
"Calibration" => "calibration.md",
65+
"Restarting a simulation" => "restarts.md",
66+
"Software utilities" => [
67+
"ITime type" => "itime.md",
68+
"Shared utilities" => "shared_utilities.md",
69+
],
70+
"Physical units" => "physical_units.md",
71+
"Model Equations" => standalone_models,
72+
"Julia background" => "julia.md",
5873
],
59-
"Tutorials" => tutorials,
60-
"Standalone models" => standalone_models,
61-
"Analyzing model output" => [
62-
"Diagnostics" => diagnostics,
63-
"Leaderboard" => "leaderboard/leaderboard.md",
64-
],
65-
"Running on GPU or with MPI" => "architectures.md",
66-
"Calibration" => "calibration.md",
67-
"Restarting a simulation" => "restarts.md",
68-
"Software utilities" => [
69-
"ITime type" => "itime.md",
70-
"Shared utilities" => "shared_utilities.md",
71-
],
72-
"Physical units" => "physical_units.md",
73-
"Julia background" => "julia.md",
7474
"APIs" => apis,
7575
"Contributor guide" => "contributing.md",
7676
]

docs/src/tutorials/global/bucket.jl

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ diagnostics_outdir = joinpath(root_path, "global_diagnostics")
3535
outdir =
3636
ClimaUtilities.OutputPathGenerator.generate_output_path(diagnostics_outdir);
3737

38-
# Set timestep, start_date, stop_date
38+
# Set timestep, start_date, stop_date:
3939
Δt = 900.0
4040
start_date = DateTime(2008)
4141
stop_date = DateTime(2009);
4242

4343
# Create the domain - intentionally low resolution since
44-
# we are running on CPU
45-
nelements = (30, 7)
44+
# we are running on CPU:
45+
nelements = (20, 7)
4646
depth = FT(3.5)
4747
dz_tuple = FT.((1.0, 0.05))
4848
domain =
4949
ClimaLand.Domains.global_domain(FT; context, nelements, depth, dz_tuple);
5050

51-
# Parameters
51+
# Parameters:
5252
earth_param_set = LP.LandParameters(FT)
5353
α_snow = FT(0.8)
5454
albedo = PrescribedBaregroundAlbedo{FT}(α_snow, domain.space.surface)
@@ -63,7 +63,9 @@ bucket_parameters = BucketModelParameters(
6363
ρc_soil = FT(2e6),
6464
τc = FT(float(Δt)),
6565
);
66-
# Forcing data
66+
67+
# Low-resolution forcing data from ERA5 is used here,
68+
# but high-resolution should be used for production runs.
6769
era5_ncdata_path = ClimaLand.Artifacts.era5_land_forcing_data2008_path(;
6870
context,
6971
lowres = true,
@@ -78,15 +80,17 @@ atmos, radiation = ClimaLand.prescribed_forcing_era5(
7880
time_interpolation_method = LinearInterpolation(PeriodicCalendar()),
7981
regridder_type = :InterpolationsRegridder,
8082
);
81-
# Make the model
83+
# Make the model:
8284
bucket = BucketModel(
8385
parameters = bucket_parameters,
8486
domain = domain,
8587
atmosphere = atmos,
8688
radiation = radiation,
8789
);
8890

89-
# IC function
91+
# Create a function which sets the initial conditions.
92+
# This should have the argument structure (Y,p,t, model)
93+
# in order to be used by the `LandSimulation` struct, below:
9094
function set_ic!(Y, p, t, bucket)
9195
temp_anomaly_amip(coord) = 40 * cosd(coord.lat)^4
9296
T_sfc_0 = 271.0
@@ -101,7 +105,7 @@ end
101105
timestepper = CTS.RK4()
102106
timestepper = CTS.ExplicitAlgorithm(timestepper);
103107

104-
# Create the simulation
108+
# Create the simulation and solve it:
105109
simulation = LandSimulation(
106110
FT,
107111
start_date,
@@ -115,13 +119,22 @@ simulation = LandSimulation(
115119

116120
solve!(simulation);
117121

122+
# Make some plots:
118123
short_names = ["tsfc", "lhf", "shf", "wsoil"]
119-
LandSimVis.make_annual_timeseries(simulation; savedir = root_path, short_names)
120-
# ![](bucket_longrun_cpu/annual_timeseries.png)
124+
125+
LandSimVis.make_annual_timeseries(
126+
simulation;
127+
savedir = ".",
128+
short_names,
129+
plot_name = "bucket_annual_timeseries.pdf",
130+
)
131+
# ![](bucket_annual_timeseries.pdf)
132+
121133
LandSimVis.make_heatmaps(
122134
simulation;
123-
savedir = root_path,
135+
savedir = ".",
124136
short_names,
125137
date = stop_date,
138+
plot_name = "bucket_figures.pdf",
126139
)
127-
# ![](bucket_longrun_cpu/figure.pdf)
140+
# ![](bucket_figures.pdf)

docs/src/tutorials/global/snowy_land.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
# The code sets up the ClimaLand land model on a spherical domain,
44
# forcing with ERA5 data, but does not actually run the simulation.
5-
# To run the simulation, we strongly recommend using a GPU: ClimaLand
6-
# global runs have not been optimized for CPU and may be very slow.
5+
# To run the simulation, we strongly recommend using a GPU.
76

87
# First we import a lot of packages:
98
import ClimaComms
@@ -34,7 +33,7 @@ outdir =
3433
ClimaUtilities.OutputPathGenerator.generate_output_path(diagnostics_outdir);
3534
earth_param_set = LP.LandParameters(FT);
3635

37-
# Set timestep, start_date, stop_date
36+
# Set timestep, start_date, stop_date:
3837
Δt = 450.0
3938
start_date = DateTime(2008)
4039
stop_date = DateTime(2009);
@@ -47,7 +46,8 @@ domain = ClimaLand.Domains.global_domain(
4746
nelements,
4847
);
4948

50-
# Forcing data
49+
# Low-resolution forcing data from ERA5 is used here,
50+
# but high-resolution should be used for production runs.
5151
era5_ncdata_path = ClimaLand.Artifacts.era5_land_forcing_data2008_path(;
5252
context,
5353
lowres = true,
@@ -62,6 +62,8 @@ forcing = ClimaLand.prescribed_forcing_era5(
6262
time_interpolation_method = LinearInterpolation(PeriodicCalendar()),
6363
regridder_type = :InterpolationsRegridder,
6464
);
65+
66+
# MODIS LAI is prescribed for the canopy model:
6567
modis_lai_ncdata_path = ClimaLand.Artifacts.modis_lai_multiyear_paths(;
6668
context,
6769
start_date,
@@ -73,7 +75,7 @@ LAI = ClimaLand.prescribed_lai_modis(
7375
start_date;
7476
time_interpolation_method = LinearInterpolation(),
7577
);
76-
# Make the model
78+
# Make the model:
7779
model = ClimaLand.LandModel{FT}(forcing, LAI, earth_param_set, domain, Δt);
7880
simulation = ClimaLand.Simulations.LandSimulation(
7981
FT,
@@ -83,6 +85,7 @@ simulation = ClimaLand.Simulations.LandSimulation(
8385
model;
8486
outdir,
8587
);
88+
# Run the simulation and make plots:
8689
#
8790
# ``` julia
8891
# ClimaLand.Simulations.solve!(simulation)

docs/src/tutorials/integrated/fluxnet_data.jl

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,42 @@ maxLAI =
137137
# data (e.g. soil moisture and temperature and depth). ClimaLand
138138
# provides a function to get the comparison data for a select number of
139139
# variables:
140-
# | Variable | Unit | ClimaLand short_name | Fluxnet Column name
141-
# |---------| --------| ------------| -----------|
142-
# |Gross primary prod. | mol/m^2/s |"gpp"|"GPP_DT_VUT_REF"|
143-
# |Latent heat flux | W/m^2/s |"lhf"|"LE_CORR"|
144-
# |Sensible heat flux | W/m^2/s |"shf"|"H_CORR"|
145-
# |Upwelling SW | W/m^2/s |"swu"|"SW_OUT"|
146-
# |Upwelling LW | W/m^2/s |"lwu"|"LW_OUT"|
147-
# |Soil water content | |"swc"|"SWC_F_MDS_1"|
148-
# |Soil temperature | K|"tsoil"|"TS_F_MDS_1"|
149-
# |Total precipitation | m/s|"precip"|"P_F"|
140+
141+
# | Variable | Unit | ClimaLand short name | Fluxnet Column name
142+
# |:---------| :--------:| :------------:| -----------:|
143+
# |Gross primary prod. | mol/m^2/s |"gpp"|"GPP\_DT\_VUT\_REF"|
144+
# |Latent heat flux | W/m^2/s |"lhf"|"LE\_CORR"|
145+
# |Sensible heat flux | W/m^2/s |"shf"|"H\_CORR"|
146+
# |Upwelling SW | W/m^2/s |"swu"|"SW\_OUT"|
147+
# |Upwelling LW | W/m^2/s |"lwu"|"LW\_OUT"|
148+
# |Soil water content | |"swc"|"SWC\_F\_MDS\_1"|
149+
# |Soil temperature | K|"tsoil"|"TS\_F\_MDS\_1"|
150+
# |Total precipitation | m/s|"precip"|"P\_F"|
151+
150152
comparison_data = FluxnetSimulations.get_comparison_data(site_ID, time_offset);
151153
@show propertynames(comparison_data)
152154
# If a column is missing, the column is not returned. Missing values
153155
# are replaced with the mean of the not missing values.
156+
157+
# The data we use to force the simulations and to compare the results against
158+
# were obtained from Ameriflux:
159+
160+
# US-Moz: https://doi.org/10.17190/AMF/1854370
161+
# Citation: Jeffrey Wood, Lianhong Gu (2025), AmeriFlux FLUXNET-1F US-MOz Missouri Ozark
162+
# Site, Ver. 5-7, AmeriFlux AMP, (Dataset). https://doi.org/10.17190/AMF/1854370
163+
164+
# US-NR1: https://doi.org/10.17190/AMF/1871141
165+
# Citation: Peter D. Blanken, Russel K. Monson, Sean P. Burns,
166+
# David R. Bowling, Andrew A. Turnipseed (2022),
167+
# AmeriFlux FLUXNET-1F US-NR1 Niwot Ridge Forest (LTER NWT1),
168+
# Ver. 3-5, AmeriFlux AMP, (Dataset). https://doi.org/10.17190/AMF/1871141
169+
170+
# US-Var: https://doi.org/10.17190/AMF/1993904
171+
# Citation: Siyan Ma, Liukang Xu, Joseph Verfaillie, Dennis Baldocchi (2023),
172+
# AmeriFlux FLUXNET-1F US-Var Vaira Ranch- Ione, Ver. 3-5, AmeriFlux AMP, (Dataset).
173+
# https://doi.org/10.17190/AMF/1993904
174+
175+
# US-Ha1: https://doi.org/10.17190/AMF/1871137
176+
# Citation: J. William Munger (2022), AmeriFlux FLUXNET-1F US-Ha1
177+
# Harvard Forest EMS Tower (HFR1), Ver. 3-5, AmeriFlux AMP, (Dataset).
178+
# https://doi.org/10.17190/AMF/1871137

docs/src/tutorials/integrated/snowy_land_fluxnet_tutorial.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
# we demonstrated how to run the an integrated model with a soil and
66
# canopy component at the US-MOz fluxnet site.
77
# Here we add in a snow component, and run the site at the Niwot Ridge site instead.
8+
# The forcing data was obtained from
9+
# AmeriFlux FLUXNET: https://doi.org/10.17190/AMF/1871141
10+
# Citation: Peter D. Blanken, Russel K. Monson, Sean P. Burns,
11+
# David R. Bowling, Andrew A. Turnipseed (2022),
12+
# AmeriFlux FLUXNET-1F US-NR1 Niwot Ridge Forest (LTER NWT1),
13+
# Ver. 3-5, AmeriFlux AMP, (Dataset). https://doi.org/10.17190/AMF/1871141
814

915
# The focus of this tutorial is to learn the steps towards setting up and
1016
# running an integrated simulation, and less on the parameterization
@@ -117,11 +123,13 @@ LandSimVis.make_diurnal_timeseries(
117123
simulation;
118124
short_names = ["shf", "lhf", "swu", "lwu"],
119125
spinup_date = start_date + Day(20),
126+
plot_name = "US_NR1_diurnal_timeseries.pdf",
120127
);
121-
# ![](diurnal_timeseries.png)
128+
# ![](US_NR1_diurnal_timeseries.pdf)
122129
LandSimVis.make_timeseries(
123130
simulation;
124131
short_names = ["swc", "si", "swe"],
125132
spinup_date = start_date + Day(20),
133+
plot_name = "US_NR1_variable_timeseries.pdf",
126134
);
127-
# ![](variable_timeseries.png)
135+
# ![](US_NR1_variable_timeseries.pdf)

docs/src/tutorials/integrated/soil_canopy_fluxnet_tutorial.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# We use initial conditions, atmospheric and radiative flux conditions,
1313
# and leaf area index observed at the US-MOz flux tower, a flux tower
1414
# located within an oak-hickory forest in Ozark, Missouri, USA.
15+
# The forcing data was obtained from
16+
# AmeriFlux FLUXNET: https://doi.org/10.17190/AMF/1854370
17+
# Citation: Jeffrey Wood, Lianhong Gu (2025), AmeriFlux FLUXNET-1F US-MOz Missouri Ozark
18+
# Site, Ver. 5-7, AmeriFlux AMP, (Dataset). https://doi.org/10.17190/AMF/1854370
1519

1620
# The focus of this tutorial is to learn the steps towards setting up and
1721
# running an integrated simulation, and less on the parameterization
@@ -123,5 +127,6 @@ LandSimVis.make_diurnal_timeseries(
123127
simulation;
124128
short_names = ["gpp", "shf", "lhf", "swu", "lwu"],
125129
spinup_date = start_date + Day(20),
130+
plot_name = "US_MOz_diurnal_timeseries.pdf",
126131
);
127-
# ![](diurnal_timeseries.png)
132+
# ![](US_MOz_diurnal_timeseries.pdf)

0 commit comments

Comments
 (0)