From 1ad94a77706ae65c042d01cc8354a811976ab9c6 Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Mon, 6 Jan 2025 13:44:05 -0800 Subject: [PATCH 1/4] Add MODIS LAI driver & use in snowy land benchmark --- Artifacts.toml | 7 +++++++ experiments/benchmarks/snowy_land.jl | 22 +++++++++++++++------ src/Artifacts.jl | 10 ++++++++++ src/shared_utilities/drivers.jl | 29 ++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 6 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 153a017eac..6c679e90d2 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -36,6 +36,13 @@ git-tree-sha1 = "df5ec5af1ea0793c0e7d49e60db5a938098e174f" sha256 = "a83bf28a7a864db285e41289031a9761c2a426373a6efecd04b866a0b5374cef" url = "https://caltech.box.com/shared/static/m82r23e67x04a3hb6p79dfltlumvg9z0.gz" +[modis_lai] +git-tree-sha1 = "58e77e06787beb0f4000a5b42882460737612cee" + + [[modis_lai.download]] + sha256 = "6bb3a88ae022578c8aa77d8c946c269cdeb72208a84d4c2b4bf2ba98b2620c0f" + url = "https://caltech.box.com/shared/static/99ktg026kciezykyegsawd1gjwj1du74.gz" + [land_albedo] git-tree-sha1 = "3f07b70ab43a05123e93753a45e094dcf7a66b5b" diff --git a/experiments/benchmarks/snowy_land.jl b/experiments/benchmarks/snowy_land.jl index c7cac4dc1b..6e4dcb3cda 100644 --- a/experiments/benchmarks/snowy_land.jl +++ b/experiments/benchmarks/snowy_land.jl @@ -225,12 +225,22 @@ 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, + # era5_lai_artifact_path = + # ClimaLand.Artifacts.era5_lai_forcing_data2008_folder_path(; context) + modis_lai_artifact_path = + ClimaLand.Artifacts.modis_lai_forcing_data2008_path(; context) + # era5_lai_ncdata_path = + # joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc") + modis_lai_ncdata_path = + joinpath(modis_lai_artifact_path, "Yuan_et_al_2011_1x1.nc") + # LAIfunction = ClimaLand.prescribed_lai_era5( + # era5_lai_ncdata_path, + # surface_space, + # start_date; + # time_interpolation_method = time_interpolation_method, + # ) + LAIfunction = ClimaLand.prescribed_lai_modis( + modis_lai_ncdata_path, surface_space, start_date; time_interpolation_method = time_interpolation_method, diff --git a/src/Artifacts.jl b/src/Artifacts.jl index f342bc140d..07bfa8f483 100644 --- a/src/Artifacts.jl +++ b/src/Artifacts.jl @@ -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) diff --git a/src/shared_utilities/drivers.jl b/src/shared_utilities/drivers.jl index feed5fce62..bc73582b38 100644 --- a/src/shared_utilities/drivers.jl +++ b/src/shared_utilities/drivers.jl @@ -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; From 722ab2d7054a5724d2a35b225dd2cf49f679bba5 Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Tue, 7 Jan 2025 10:06:54 -0800 Subject: [PATCH 2/4] Update artifact to use even time spacing --- Artifacts.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 6c679e90d2..eedda79707 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -37,10 +37,10 @@ git-tree-sha1 = "df5ec5af1ea0793c0e7d49e60db5a938098e174f" url = "https://caltech.box.com/shared/static/m82r23e67x04a3hb6p79dfltlumvg9z0.gz" [modis_lai] -git-tree-sha1 = "58e77e06787beb0f4000a5b42882460737612cee" +git-tree-sha1 = "20ee5dc96fde9a15bd3c40e80ac5036a9a39e0cf" [[modis_lai.download]] - sha256 = "6bb3a88ae022578c8aa77d8c946c269cdeb72208a84d4c2b4bf2ba98b2620c0f" + sha256 = "e97bf4a8eeac7c32c00a7d27bf5ec957e9c800117d56e66c27a123171a1f1c04" url = "https://caltech.box.com/shared/static/99ktg026kciezykyegsawd1gjwj1du74.gz" [land_albedo] From 82e277c2d41f4965dea4e0b63ada3b4dcdf08721 Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Tue, 7 Jan 2025 10:51:09 -0800 Subject: [PATCH 3/4] Use MODIS LAI in global run --- .../integrated/global/global_soil_canopy.jl | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/experiments/integrated/global/global_soil_canopy.jl b/experiments/integrated/global/global_soil_canopy.jl index 79999cd43e..d4ab76603d 100644 --- a/experiments/integrated/global/global_soil_canopy.jl +++ b/experiments/integrated/global/global_soil_canopy.jl @@ -124,12 +124,22 @@ 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, +# era5_lai_artifact_path = +# ClimaLand.Artifacts.era5_lai_forcing_data2008_folder_path(; context) +modis_lai_artifact_path = + ClimaLand.Artifacts.modis_lai_forcing_data2008_path(; context) +# era5_lai_ncdata_path = +# joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc") +modis_lai_ncdata_path = + joinpath(modis_lai_artifact_path, "Yuan_et_al_2011_1x1.nc") +# LAIfunction = ClimaLand.prescribed_lai_era5( +# era5_lai_ncdata_path, +# surface_space, +# start_date; +# time_interpolation_method = time_interpolation_method, +# ) +LAIfunction = ClimaLand.prescribed_lai_modis( + modis_lai_ncdata_path, surface_space, start_date; time_interpolation_method = time_interpolation_method, From adbd70d7259705cc0f7d437d102b4e709150b908 Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Wed, 8 Jan 2025 15:08:30 -0800 Subject: [PATCH 4/4] Use MODIS LAI in long run --- experiments/benchmarks/snowy_land.jl | 22 +++++-------------- .../integrated/global/global_soil_canopy.jl | 10 --------- experiments/long_runs/snowy_land.jl | 12 +++++----- 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/experiments/benchmarks/snowy_land.jl b/experiments/benchmarks/snowy_land.jl index 6e4dcb3cda..c7cac4dc1b 100644 --- a/experiments/benchmarks/snowy_land.jl +++ b/experiments/benchmarks/snowy_land.jl @@ -225,22 +225,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) - modis_lai_artifact_path = - ClimaLand.Artifacts.modis_lai_forcing_data2008_path(; context) - # era5_lai_ncdata_path = - # joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc") - modis_lai_ncdata_path = - joinpath(modis_lai_artifact_path, "Yuan_et_al_2011_1x1.nc") - # LAIfunction = ClimaLand.prescribed_lai_era5( - # era5_lai_ncdata_path, - # surface_space, - # start_date; - # time_interpolation_method = time_interpolation_method, - # ) - LAIfunction = ClimaLand.prescribed_lai_modis( - modis_lai_ncdata_path, + 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, surface_space, start_date; time_interpolation_method = time_interpolation_method, diff --git a/experiments/integrated/global/global_soil_canopy.jl b/experiments/integrated/global/global_soil_canopy.jl index d4ab76603d..4a3dfb4e83 100644 --- a/experiments/integrated/global/global_soil_canopy.jl +++ b/experiments/integrated/global/global_soil_canopy.jl @@ -124,20 +124,10 @@ 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) modis_lai_artifact_path = ClimaLand.Artifacts.modis_lai_forcing_data2008_path(; context) -# era5_lai_ncdata_path = -# joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc") modis_lai_ncdata_path = joinpath(modis_lai_artifact_path, "Yuan_et_al_2011_1x1.nc") -# LAIfunction = ClimaLand.prescribed_lai_era5( -# era5_lai_ncdata_path, -# surface_space, -# start_date; -# time_interpolation_method = time_interpolation_method, -# ) LAIfunction = ClimaLand.prescribed_lai_modis( modis_lai_ncdata_path, surface_space, diff --git a/experiments/long_runs/snowy_land.jl b/experiments/long_runs/snowy_land.jl index 43e526b8d5..d62ff20543 100644 --- a/experiments/long_runs/snowy_land.jl +++ b/experiments/long_runs/snowy_land.jl @@ -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,