Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MODIS LAI driver & use in experiments #973

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ git-tree-sha1 = "df5ec5af1ea0793c0e7d49e60db5a938098e174f"
sha256 = "a83bf28a7a864db285e41289031a9761c2a426373a6efecd04b866a0b5374cef"
url = "https://caltech.box.com/shared/static/m82r23e67x04a3hb6p79dfltlumvg9z0.gz"

[modis_lai]
git-tree-sha1 = "20ee5dc96fde9a15bd3c40e80ac5036a9a39e0cf"

[[modis_lai.download]]
sha256 = "e97bf4a8eeac7c32c00a7d27bf5ec957e9c800117d56e66c27a123171a1f1c04"
url = "https://caltech.box.com/shared/static/99ktg026kciezykyegsawd1gjwj1du74.gz"

[land_albedo]
git-tree-sha1 = "3f07b70ab43a05123e93753a45e094dcf7a66b5b"

Expand Down
12 changes: 6 additions & 6 deletions experiments/integrated/global/global_soil_canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ conductance_args = (; parameters = Canopy.MedlynConductanceParameters(FT; g1))
photosynthesis_args =
(; parameters = Canopy.FarquharParameters(FT, is_c3; Vcmax25 = Vcmax25))
# Set up plant hydraulics
era5_lai_artifact_path =
ClimaLand.Artifacts.era5_lai_forcing_data2008_folder_path(; context)
era5_lai_ncdata_path =
joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc")
LAIfunction = ClimaLand.prescribed_lai_era5(
era5_lai_ncdata_path,
modis_lai_artifact_path =
ClimaLand.Artifacts.modis_lai_forcing_data2008_path(; context)
modis_lai_ncdata_path =
joinpath(modis_lai_artifact_path, "Yuan_et_al_2011_1x1.nc")
LAIfunction = ClimaLand.prescribed_lai_modis(
modis_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = time_interpolation_method,
Expand Down
12 changes: 6 additions & 6 deletions experiments/long_runs/snowy_land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
photosynthesis_args =
(; parameters = Canopy.FarquharParameters(FT, is_c3; Vcmax25 = Vcmax25))
# Set up plant hydraulics
era5_lai_artifact_path =
ClimaLand.Artifacts.era5_lai_forcing_data2008_folder_path(; context)
era5_lai_ncdata_path =
joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc")
LAIfunction = ClimaLand.prescribed_lai_era5(
era5_lai_ncdata_path,
modis_lai_artifact_path =
ClimaLand.Artifacts.modis_lai_forcing_data2008_path(; context)
modis_lai_ncdata_path =
joinpath(modis_lai_artifact_path, "Yuan_et_al_2011_1x1.nc")
LAIfunction = ClimaLand.prescribed_lai_modis(
modis_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = time_interpolation_method,
Expand Down
10 changes: 10 additions & 0 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ function era5_lai_forcing_data2008_folder_path(; context = nothing)
return @clima_artifact("era5_land_forcing_data2008_lai", context)
end

"""
modis_lai_forcing_data2008_path(; context)

Return the path to the directory that contains the MODIS LAI forcing data for
the year 2008.
"""
function modis_lai_forcing_data2008_path(; context = nothing)
return @clima_artifact("modis_lai", context)
end

"""
clm_data__folder_path(; context)

Expand Down
29 changes: 29 additions & 0 deletions src/shared_utilities/drivers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,35 @@ function prescribed_lai_era5(
)
end

"""
prescribed_lai_modis(modis_lai_ncdata_path,
surface_space,
start_date,
earth_param_set;
time_interpolation_method =
LinearInterpolation(PeriodicCalendar()))
regridder_type = :InterpolationsRegridder)

A helper function which constructure the TimeVaryingInput object for Lead Area
Index from a file path pointint to the MODIS LAI data in a netcdf file, the
surface_space, the start date, and the earth_param_set.
"""
function prescribed_lai_modis(
modis_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = LinearInterpolation(PeriodicCalendar()),
regridder_type = :InterpolationsRegridder,
)
return TimeVaryingInput(
modis_lai_ncdata_path,
["lai"],
surface_space;
start_date,
regridder_type,
method = time_interpolation_method,
)
end

"""
prescribed_analytic_forcing(FT = Float32;
Expand Down
Loading