Skip to content

Commit

Permalink
fixing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Nov 15, 2024
1 parent c081243 commit 793f27b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 9 deletions.
5 changes: 4 additions & 1 deletion experiments/integrated/global/global_soil_canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion experiments/long_runs/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion experiments/long_runs/land_region.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion experiments/long_runs/snowy_land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions experiments/standalone/Soil/richards_runoff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 21 additions & 3 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down

0 comments on commit 793f27b

Please sign in to comment.