Skip to content

Commit

Permalink
change artifact to 2008 and less freq LAI
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Nov 21, 2024
1 parent 8e915fc commit bdaf246
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 59 deletions.
17 changes: 15 additions & 2 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@ git-tree-sha1 = "3f6873a3e67722bda1fd23f7d5a05f5e2df1fe8c"
sha256 = "830136abec15551a343b7884d657fb6a79b16a37237681a2becf65bd845aa692"
url = "https://caltech.box.com/shared/static/6pu2f6c99g29qawvjjh3j56drkonpd3z.gz"

[era5_land_forcing_data2021]
git-tree-sha1 = "ec424296df6b60cfe273ac8f981701fbbed0bd8a"
[era5_land_forcing_data2008]
git-tree-sha1 = "93d2e93f491e77cb8fba2a1b8b3946f38bde469e"
[era5_land_forcing_data2008_lowres]
git-tree-sha1 = "67b6daae491c1fa55406dd6a65f6b197b9bd4728"

[[era5_land_forcing_data2008_lowres.download]]
sha256 = "f1ec64818faad37cf681caa86832b77c68f93784bf105dc85dd57079e8673b10"
url = "https://caltech.box.com/shared/static/6zk5fa3ka5ib62jsrs6tx35sqwe8xv2k.gz"

[era5_land_forcing_data2008_lai]
git-tree-sha1 = "f998a8db24647caf5f1693ad4a1e46bdf356a752"

[[era5_land_forcing_data2008_lai.download]]
sha256 = "81b357e97daf18d998c003dc00db14a7ffdd431520f2c5c4e41a1f0254864a8d"
url = "https://caltech.box.com/shared/static/m82r23e67x04a3hb6p79dfltlumvg9z0.gz"

[land_albedo]
git-tree-sha1 = "3f07b70ab43a05123e93753a45e094dcf7a66b5b"
Expand Down
12 changes: 8 additions & 4 deletions experiments/benchmarks/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
start_date = DateTime(2008)

# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc")
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
atmos, radiation = ClimaLand.prescribed_forcing_era5(
era5_ncdata_path,
surface_space,
Expand Down Expand Up @@ -230,8 +230,12 @@ function setup_prob(t0, tf, Δt; 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_ncdata_path,
era5_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = time_interpolation_method,
Expand Down
12 changes: 5 additions & 7 deletions experiments/benchmarks/richards.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
start_date = DateTime(2008)
spatially_varying_soil_params =
ClimaLand.default_spatially_varying_soil_parameters(
subsurface_space,
Expand All @@ -92,20 +92,18 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
)

era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)

# Below, the preprocess_func argument is used to
# 1. Convert precipitation to be negative (as it is downwards)
# 2. Convert accumulations over an hour to a rate per second
start_date = DateTime(2021)
# Precipitation:
precip = TimeVaryingInput(
joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc"),
"tp",
joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc"),
"mtpr",
surface_space;
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
12 changes: 8 additions & 4 deletions experiments/integrated/global/global_soil_canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ domain = ClimaLand.Domains.SphericalShell(;
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021);
start_date = DateTime(2008);

# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc")
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
atmos, radiation = ClimaLand.prescribed_forcing_era5(
era5_ncdata_path,
surface_space,
Expand Down Expand Up @@ -124,8 +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_ncdata_path,
era5_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = time_interpolation_method,
Expand Down
7 changes: 4 additions & 3 deletions experiments/long_runs/bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 7))
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
start_date = DateTime(2008)
# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
atmos, radiation = ClimaLand.prescribed_forcing_era5(
joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc"),
era5_ncdata_path,
surface_space,
start_date,
earth_param_set,
Expand Down
13 changes: 8 additions & 5 deletions experiments/long_runs/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
start_date = DateTime(2008)
# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc")
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
atmos, radiation = ClimaLand.prescribed_forcing_era5(
era5_ncdata_path,
surface_space,
Expand Down Expand Up @@ -231,9 +231,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_ncdata_path,
era5_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = time_interpolation_method,
Expand Down
12 changes: 8 additions & 4 deletions experiments/long_runs/land_region.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (10, 10, 15))
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
start_date = DateTime(2008)
# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc")
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
atmos, radiation = ClimaLand.prescribed_forcing_era5(
era5_ncdata_path,
surface_space,
Expand Down Expand Up @@ -232,8 +232,12 @@ 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_lai_artifact_path, "era5_2008_1.0x1.0_lai.nc")
LAIfunction = ClimaLand.prescribed_lai_era5(
era5_ncdata_path,
era5_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = time_interpolation_method,
Expand Down
13 changes: 8 additions & 5 deletions experiments/long_runs/snowy_land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
start_date = DateTime(2008)
# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc")
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
atmos, radiation = ClimaLand.prescribed_forcing_era5(
era5_ncdata_path,
surface_space,
Expand Down Expand Up @@ -232,9 +232,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_ncdata_path,
era5_lai_ncdata_path,
surface_space,
start_date;
time_interpolation_method = time_interpolation_method,
Expand Down
7 changes: 4 additions & 3 deletions experiments/long_runs/soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
start_date = DateTime(2008)
# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
atmos, radiation = ClimaLand.prescribed_forcing_era5(
joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc"),
era5_ncdata_path,
surface_space,
start_date,
earth_param_set,
Expand Down
6 changes: 3 additions & 3 deletions experiments/standalone/Bucket/bucket_era5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ else
dz_tuple = FT.((1.0, 0.05)),
)
end
start_date = DateTime(2021);
start_date = DateTime(2008);

# Set up parameters
σS_c = FT(0.2);
Expand All @@ -134,8 +134,8 @@ bucket_parameters = BucketModelParameters(FT; albedo, z_0m, z_0b, τc);

# Forcing data
era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc")
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)
era5_ncdata_path = joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc")
bucket_atmos, bucket_rad = ClimaLand.prescribed_forcing_era5(
era5_ncdata_path,
surface_space,
Expand Down
10 changes: 5 additions & 5 deletions experiments/standalone/Soil/richards_runoff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ soil_params = ClimaLand.Soil.RichardsParameters(;
)

era5_artifact_path =
ClimaLand.Artifacts.era5_land_forcing_data2021_folder_path(; context)
ClimaLand.Artifacts.era5_land_forcing_data2008_folder_path(; context)

# Below, the preprocess_func argument is used to
# 1. Convert precipitation to be negative (as it is downwards)
# 2. Convert accumulations over an hour to a rate per second
start_date = DateTime(2021);
start_date = DateTime(2008);
# Precipitation:
precip = TimeVaryingInput(
joinpath(era5_artifact_path, "era5_2021_0.9x1.25.nc"),
"tp",
joinpath(era5_artifact_path, "era5_2008_1.0x1.0.nc"),
"mtpr",
surface_space;
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
26 changes: 22 additions & 4 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_data2021_path(; context)
era5_land_forcing_data2008_path(; context, lowres=false)
Return the path to the folder that contains the ERA5 data.
Return the path to the directory that contains the ERA5 forcing data for 2008.
Optionally, you can 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_data2021_folder_path(; context = nothing)
return @clima_artifact("era5_land_forcing_data2021", context)
function era5_lai_forcing_data2008_folder_path(; context = nothing)
return @clima_artifact("era5_land_forcing_data2008_lai", context)
end

"""
Expand Down
18 changes: 8 additions & 10 deletions src/shared_utilities/drivers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1031,28 +1031,28 @@ function prescribed_forcing_era5(

precip = TimeVaryingInput(
era5_ncdata_path,
["tp", "sf"],
["mtpr", "msr"],
surface_space;
start_date,
regridder_type,
file_reader_kwargs = (; preprocess_func = (data) -> -data / 3600,),
file_reader_kwargs = (; preprocess_func = (data) -> -data,),
method = time_interpolation_method,
compose_function = (tp, sf) -> tp - sf,
compose_function = (mtpr, msr) -> mtpr - msr,
)

snow_precip = TimeVaryingInput(
era5_ncdata_path,
"sf",
"msr",
surface_space;
start_date,
regridder_type,
file_reader_kwargs = (; preprocess_func = (data) -> -data / 3600,),
file_reader_kwargs = (; preprocess_func = (data) -> -data,),
method = time_interpolation_method,
)

u_atmos = TimeVaryingInput(
era5_ncdata_path,
["u10n", "v10n"],
["u10", "v10"],
surface_space;
start_date,
regridder_type,
Expand Down Expand Up @@ -1105,20 +1105,18 @@ function prescribed_forcing_era5(

SW_d = TimeVaryingInput(
era5_ncdata_path,
"ssrd",
"msdwswrf",
surface_space;
start_date,
regridder_type,
file_reader_kwargs = (; preprocess_func = (data) -> data / 3600,),
method = time_interpolation_method,
)
LW_d = TimeVaryingInput(
era5_ncdata_path,
"strd",
"msdwlwrf",
surface_space;
start_date,
regridder_type,
file_reader_kwargs = (; preprocess_func = (data) -> data / 3600,),
method = time_interpolation_method,
)

Expand Down

0 comments on commit bdaf246

Please sign in to comment.