Skip to content

Commit

Permalink
Merge pull request #863 from CliMA/es/MODIS_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Espeer5 authored Oct 19, 2024
2 parents 37e3450 + d56635f commit ae1a589
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 8 deletions.
7 changes: 7 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ git-tree-sha1 = "c10e8f877603bfa2c018eb2dd0c51dd078abe5df"
[[soil_params_Gupta2020_2022.download]]
sha256 = "6205d96ae7724c469eef5cd1cf3b99e186637427b6fb65ecc659fb808fc6cacf"
url = "https://caltech.box.com/shared/static/7c6yx62tzjivxfmhqyy03r6e9l1glyu1.gz"

[modis_clumping_index]
git-tree-sha1 = "b849eb95c09190095e7bf021494ddeda8858af01"

[[modis_clumping_index.download]]
sha256 = "e4c766a93a673e5dc22540687ef5616416d65bb13a0f4a67789b95d49ccbb158"
url = "https://caltech.box.com/shared/static/ec2y3k5kqpl9wjvtsx3584wgkp5q8dyw.gz"
14 changes: 12 additions & 2 deletions experiments/benchmarks/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,21 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
# Energy Balance model
ac_canopy = FT(2.5e3)

#clm_data is used for g1, vcmax, rooting, and two_stream param maps
# clm_data is used for g1, vcmax, rooting, and two_stream param maps
clm_artifact_path = ClimaLand.Artifacts.clm_data_folder_path(; context)

# Foliage clumping index data derived from MODIS
modis_ci_artifact_path =
ClimaLand.Artifacts.modis_ci_data_folder_path(; context)

# TwoStreamModel parameters
Ω = FT(0.69)
Ω = SpaceVaryingInput(
joinpath(modis_ci_artifact_path, "He_et_al_2012_1x1.nc"),
"ci",
surface_space,
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
)
χl = SpaceVaryingInput(
joinpath(clm_artifact_path, "vegetation_properties_map.nc"),
"xl",
Expand Down
11 changes: 10 additions & 1 deletion experiments/long_runs/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,18 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))

#clm_data is used for g1, vcmax, rooting, and two_stream param maps
clm_artifact_path = ClimaLand.Artifacts.clm_data_folder_path(; context)
# Foliage clumping index data derived from MODIS
modis_ci_artifact_path =
ClimaLand.Artifacts.modis_ci_data_folder_path(; context)

# TwoStreamModel parameters
Ω = FT(0.69)
Ω = SpaceVaryingInput(
joinpath(modis_ci_artifact_path, "He_et_al_2012_1x1.nc"),
"ci",
surface_space,
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
)
χl = SpaceVaryingInput(
joinpath(clm_artifact_path, "vegetation_properties_map.nc"),
"xl",
Expand Down
13 changes: 12 additions & 1 deletion experiments/long_runs/land_region.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,19 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (10, 10, 15))
#clm_data is used for g1, vcmax, rooting, and two_stream param maps
clm_artifact_path = ClimaLand.Artifacts.clm_data_folder_path(; context)

# Foliage clumping index data derived from MODIS
modis_ci_artifact_path =
ClimaLand.Artifacts.modis_ci_data_folder_path(; context)

# TwoStreamModel parameters
Ω = FT(0.69)
Ω = SpaceVaryingInput(
joinpath(modis_ci_artifact_path, "He_et_al_2012_1x1.nc"),
"ci",
surface_space,
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
)

χl = SpaceVaryingInput(
joinpath(clm_artifact_path, "vegetation_properties_map.nc"),
"xl",
Expand Down
9 changes: 9 additions & 0 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ function clm_data_folder_path(; context = nothing)
return @clima_artifact("clm_data", context)
end

"""
modis_ci_data_folder_path(; context = nothing)
Return the path to the folder that contains the MODIS clumping index data.
"""
function modis_ci_data_folder_path(; context = nothing)
return @clima_artifact("modis_clumping_index", context)
end

"""
soil_params_artifact_path(; context)
Expand Down
2 changes: 1 addition & 1 deletion src/standalone/Vegetation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Base.@kwdef struct TwoStreamParameters{
"Emissivity of the canopy"
ϵ_canopy::FT
"Clumping index following Braghiere 2021 (unitless)"
Ω::FT
Ω::F
"Typical wavelength per PAR photon (m)"
λ_γ_PAR::FT
"Typical wavelength per NIR photon (m)"
Expand Down
4 changes: 3 additions & 1 deletion test/standalone/Vegetation/canopy_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ end
mechanism_field,
)
# create one case where parameters are spatially varying and one where not
Ω_cases = (FT(0.69), fill(FT(0.69), domain.space.surface))
g1_cases = (FT(790), fill(FT(790), domain.space.surface))
Vcmax25_cases = (FT(9e-5), fill(FT(9e-5), domain.space.surface))
mechanism_cases = (FT(1), mechanism_field)
Expand All @@ -1168,6 +1169,7 @@ end
τ_NIR_leaf_cases = (FT(0.25), fill(FT(0.25), domain.space.surface))
χl_cases = (FT(0.1), fill(FT(0.1), domain.space.surface))
zipped_params = zip(
Ω_cases,
g1_cases,
Vcmax25_cases,
mechanism_cases,
Expand All @@ -1179,6 +1181,7 @@ end
χl_cases,
)
for (
Ω,
g1,
Vcmax25,
is_c3,
Expand All @@ -1191,7 +1194,6 @@ end
) in zipped_params
BeerLambertparams = BeerLambertParameters(FT)
# TwoStreamModel parameters
Ω = FT(0.69)
G_Function = CLMGFunction(χl)
λ_γ_PAR = FT(5e-7)
λ_γ_NIR = FT(1.65e-6)
Expand Down
6 changes: 4 additions & 2 deletions test/standalone/Vegetation/test_two_stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@ for FT in (Float32, Float64)
τ_scalars = FT.(test_set[2:end, column_names .== "tau"])
τ_fields = map(x -> fill(x, domain.space.surface), τ_scalars)
# loop through once with params as floats, then with params as fields
Ω_cases = (FT(1), fill(FT(1), domain.space.surface))
α_PAR_leaf_cases = (α_PAR_leaf_scalars, α_PAR_leaf_fields)
τ_PAR_leaf_cases = (τ_scalars, τ_fields)
α_NIR_leaf_cases = (FT(0.4), fill(FT(0.4), domain.space.surface))
τ_NIR_leaf_cases = (FT(0.25), fill(FT(0.24), domain.space.surface))
lds_cases = (lds, lds_field)
zipped_params = zip(
Ω_cases,
α_PAR_leaf_cases,
τ_PAR_leaf_cases,
α_NIR_leaf_cases,
τ_NIR_leaf_cases,
lds_cases,
)
for (α_PAR_leaf, τ_PAR_leaf, α_NIR_leaf, τ_NIR_leaf, lds) in
for (Ω, α_PAR_leaf, τ_PAR_leaf, α_NIR_leaf, τ_NIR_leaf, lds) in
zipped_params
# Read the result for each setup from the Python output
py_FAPAR = FT.(test_set[2:end, column_names .== "FAPAR"])
Expand All @@ -72,12 +74,12 @@ for FT in (Float32, Float64)
# Set the parameters based on the setup read from the file
RT_params = TwoStreamParameters(
FT;
Ω = Ω,
G_Function = ConstantGFunction(FT.(lds[i])),
α_PAR_leaf = α_PAR_leaf[i],
τ_PAR_leaf = τ_PAR_leaf[i],
α_NIR_leaf = α_NIR_leaf,
τ_NIR_leaf = τ_NIR_leaf,
Ω = FT(1),
n_layers = n_layers[i],
)

Expand Down

0 comments on commit ae1a589

Please sign in to comment.