Skip to content

Commit

Permalink
Add earth orography artifacts to toml file
Browse files Browse the repository at this point in the history
Add artifact getter function

TEST BUILD:
Update `soil_params_mask` to use ETOPO2022 dataset
	modified:   land.jl
	modified:   .buildkite/pipeline.yml
	modified:   experiments/long_runs/land.jl
  • Loading branch information
akshaysridhar committed Oct 21, 2024
1 parent ae1a589 commit 9eec259
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

steps:
- label: "init environment :computer:"
key: "init_cpu_env"
key: "init_gpu_env"
concurrency: 1
concurrency_group: 'depot/climaland-ci'
command:
Expand Down
11 changes: 11 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,14 @@ git-tree-sha1 = "b849eb95c09190095e7bf021494ddeda8858af01"
[[modis_clumping_index.download]]
sha256 = "e4c766a93a673e5dc22540687ef5616416d65bb13a0f4a67789b95d49ccbb158"
url = "https://caltech.box.com/shared/static/ec2y3k5kqpl9wjvtsx3584wgkp5q8dyw.gz"

[earth_orography_30arcseconds]
git-tree-sha1 = "03dd08fcbf363ed055a176dd7adefb60ff1c3493"

[earth_orography_60arcseconds]
git-tree-sha1 = "fe19d8dbe7a18ff39588e1f718014b0479d9c0f7"
lazy = true

[[earth_orography_60arcseconds.download]]
sha256 = "eca66c0701d1c2b9e271742314915ffbf4a0fae92709df611c323f38e019966e"
url = "https://caltech.box.com/shared/static/4asrxcgl6xsgenfcug9p0wkkyhtqilgk.gz"
44 changes: 32 additions & 12 deletions experiments/long_runs/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ diagnostics_outdir = joinpath(root_path, "global_diagnostics")
outdir =
ClimaUtilities.OutputPathGenerator.generate_output_path(diagnostics_outdir)

function mask_land_tendencies(Yₜ, land_mask)
@. Yₜ *= land_mask
end

function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))

earth_param_set = LP.LandParameters(FT)
Expand All @@ -70,8 +74,24 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
dz_tuple = FT.((10.0, 0.05)),
)
surface_space = domain.space.surface

# Land Mask Example
extrapolation_bc = (
Interpolations.Periodic(),
Interpolations.Flat(),
)
comms_ctx = ClimaComms.context(surface_space);
soil_params_mask = SpaceVaryingInput(
ClimaLand.Artifacts.earth_orography_file_path(; context = comms_ctx),
"z",
surface_space;
regridder_kwargs = (; extrapolation_bc,),
file_reader_kwargs = (; preprocess_func = (data) -> data >= 0),
)
# TODO : Define smoothing operation in preprocess pipeline

subsurface_space = domain.space.subsurface

start_date = DateTime(2021)
# Forcing data
era5_artifact_path =
Expand All @@ -94,17 +114,17 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
Interpolations.Flat(),
Interpolations.Flat(),
)
soil_params_mask = SpaceVaryingInput(
joinpath(
soil_params_artifact_path,
"vGalpha_map_gupta_etal2020_1.0x1.0x4.nc",
),
"α",
subsurface_space;
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
file_reader_kwargs = (; preprocess_func = (data) -> data > 0,),
)
#soil_params_mask = SpaceVaryingInput(
# joinpath(
# soil_params_artifact_path,
# "vGalpha_map_gupta_etal2020_1.0x1.0x4.nc",
# ),
# "α",
# subsurface_space;
# regridder_type,
# regridder_kwargs = (; extrapolation_bc,),
# file_reader_kwargs = (; preprocess_func = (data) -> data > 0,),
#)
oceans_to_value(field, mask, value) =
mask == 1.0 ? field : eltype(field)(value)

Expand Down
15 changes: 15 additions & 0 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,19 @@ function bareground_albedo_dataset_path(; context = nothing)
)
end

"""
earth_orography_file_path(; context=nothing)
Construct the file path for the 60arcsecond orography data NetCDF file.
Downloads the 60arc-second dataset by default.
"""
function earth_orography_file_path(; context = nothing)
filename = "ETOPO_2022_v1_60s_N90W180_surface.nc"
return joinpath(
@clima_artifact("earth_orography_60arcseconds", context),
filename,
)
end

end

0 comments on commit 9eec259

Please sign in to comment.