From 793f27b407628b3fcf246abc373d2fc3805b4726 Mon Sep 17 00:00:00 2001 From: kmdeck Date: Thu, 14 Nov 2024 16:38:55 -0800 Subject: [PATCH] fixing bugs --- .../integrated/global/global_soil_canopy.jl | 5 +++- experiments/long_runs/land.jl | 4 +++- experiments/long_runs/land_region.jl | 4 +++- experiments/long_runs/snowy_land.jl | 4 +++- .../standalone/Soil/richards_runoff.jl | 4 ++-- src/Artifacts.jl | 24 ++++++++++++++++--- 6 files changed, 36 insertions(+), 9 deletions(-) diff --git a/experiments/integrated/global/global_soil_canopy.jl b/experiments/integrated/global/global_soil_canopy.jl index 03219ced5e..99851a2cbf 100644 --- a/experiments/integrated/global/global_soil_canopy.jl +++ b/experiments/integrated/global/global_soil_canopy.jl @@ -124,7 +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_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0_lai.nc") +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, diff --git a/experiments/long_runs/land.jl b/experiments/long_runs/land.jl index b25ef2d953..505c97dbf0 100644 --- a/experiments/long_runs/land.jl +++ b/experiments/long_runs/land.jl @@ -231,8 +231,10 @@ 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_artifact_path, "era5_2008_1.0x1.0_lai.nc") + joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc") LAIfunction = ClimaLand.prescribed_lai_era5( era5_lai_ncdata_path, surface_space, diff --git a/experiments/long_runs/land_region.jl b/experiments/long_runs/land_region.jl index 06d3c1c6ca..9656b58264 100644 --- a/experiments/long_runs/land_region.jl +++ b/experiments/long_runs/land_region.jl @@ -232,8 +232,10 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (10, 10, 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_artifact_path, "era5_2008_1.0x1.0_lai.nc") + joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc") LAIfunction = ClimaLand.prescribed_lai_era5( era5_lai_ncdata_path, surface_space, diff --git a/experiments/long_runs/snowy_land.jl b/experiments/long_runs/snowy_land.jl index 689bc0e9be..481ec0df8c 100644 --- a/experiments/long_runs/snowy_land.jl +++ b/experiments/long_runs/snowy_land.jl @@ -232,8 +232,10 @@ 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_artifact_path, "era5_2008_1.0x1.0_lai.nc") + joinpath(era5_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc") LAIfunction = ClimaLand.prescribed_lai_era5( era5_lai_ncdata_path, surface_space, diff --git a/experiments/standalone/Soil/richards_runoff.jl b/experiments/standalone/Soil/richards_runoff.jl index d9c2a08c5e..6368fc5585 100644 --- a/experiments/standalone/Soil/richards_runoff.jl +++ b/experiments/standalone/Soil/richards_runoff.jl @@ -76,11 +76,11 @@ start_date = DateTime(2008); # Precipitation: precip = TimeVaryingInput( joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc"), - "tp", + "mtpr", surface_space; reference_date = start_date, regridder_type, - file_reader_kwargs = (; preprocess_func = (data) -> -data / 3600,), + file_reader_kwargs = (; preprocess_func = (data) -> -data,), ) atmos = ClimaLand.PrescribedPrecipitation{FT, typeof(precip)}(precip) bottom_bc = ClimaLand.Soil.WaterFluxBC((p, t) -> 0.0) diff --git a/src/Artifacts.jl b/src/Artifacts.jl index 6018f4f510..0725d702a7 100644 --- a/src/Artifacts.jl +++ b/src/Artifacts.jl @@ -6,12 +6,30 @@ import LazyArtifacts using ArtifactWrappers """ - era5_land_forcing_data2008_path(; context) + era5_land_forcing_data2008_path(; context, lowres=false) Return the path to the directory that contains the ERA5 forcing data for 2008. + +Optionally pass the lowres=true keyword to download a lower spatial resolution version of the data. +""" +function era5_land_forcing_data2008_folder_path(; + context = nothing, + lowres = false, +) + if lowres + return @clima_artifact("era5_land_forcing_data2008_lowres", context) + else + return @clima_artifact("era5_land_forcing_data2008", context) + end +end + +""" + era5_lai_forcing_data2008_path(; context) + +Return the path to the directory that contains the ERA5 LAI forcing data for 2008. """ -function era5_land_forcing_data2008_folder_path(; context = nothing) - return @clima_artifact("era5_land_forcing_data2008", context) +function era5_lai_forcing_data2008_folder_path(; context = nothing) + return @clima_artifact("era5_land_forcing_data2008_lai", context) end """