Skip to content

Commit

Permalink
Use higher resolution land-sea mask
Browse files Browse the repository at this point in the history
As added in CliMA/ClimaArtifacts#49

30 arcseconds is already pretty high resolution
  • Loading branch information
Sbozzolo committed Oct 9, 2024
1 parent e9aedc9 commit 6ac91fd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
12 changes: 0 additions & 12 deletions artifacts/artifact_funcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ function co2_dataset_path()
return AW.get_data_folder(co2_dataset)
end

function mask_dataset_path()
mask_dataset = AW.ArtifactWrapper(
@__DIR__,
"land_mask",
AW.ArtifactFile[AW.ArtifactFile(
url = "https://caltech.box.com/shared/static/vubmq84nhvbgdqayezguf3i1w6nqtwvu.ncc",
filename = "seamask.nc",
),],
)
return AW.get_data_folder(mask_dataset)
end

"""
artifact_data(datapath_full, filename)
Expand Down
1 change: 0 additions & 1 deletion artifacts/download_artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ include(joinpath(@__DIR__, "artifact_funcs.jl"))
# Trigger download if data doesn't exist locally
function trigger_download()
@info "co2 dataset path: `$(co2_dataset_path())`"
@info "mask dataset path: `$(mask_dataset_path())`"
return nothing
end
trigger_download()
10 changes: 10 additions & 0 deletions experiments/ClimaEarth/Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@ git-tree-sha1 = "7f7b6d4ae6055c4c2b6a6dfba5be8b4e6ca1b0be"
[[historical_sst_sic_lowres.download]]
sha256 = "b68c0ce6ea682c38e29cb87c9c6ced6736ecac32d0d32dbaba78beb66046a06c"
url = "https://caltech.box.com/shared/static/ufnesb00zkvlc3sxzhnnmqc3zbatxkb9.gz"

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

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

[[earth_orography_60arcseconds.download]]
sha256 = "eca66c0701d1c2b9e271742314915ffbf4a0fae92709df611c323f38e019966e"
url = "https://caltech.box.com/shared/static/4asrxcgl6xsgenfcug9p0wkkyhtqilgk.gz"
17 changes: 14 additions & 3 deletions experiments/ClimaEarth/run_amip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,13 @@ catch error
"MODEL.ICE.HAD187001-198110.OI198111-202206_lowres.nc",
)
end
land_mask_data = try
joinpath(@clima_artifact("earth_orography_30arcseconds", comms_ctx), "ETOPO_2022_v1_30s_N90W180_surface.nc")
catch error
joinpath(@clima_artifact("earth_orography_60arcseconds", comms_ctx), "ETOPO_2022_v1_60s_N90W180_surface.nc")
end

co2_data = joinpath(co2_dataset_path(), "mauna_loa_co2.nc")
land_mask_data = joinpath(mask_dataset_path(), "seamask.nc")

#=
## Component Model Initialization
Expand All @@ -203,7 +208,7 @@ returns a `ComponentModelSimulation` object (see `Interfacer` docs for more deta

#=
### Atmosphere
This uses the `ClimaAtmos.jl` model, with parameterization options specified in the `atmos_config_object` dictionary.
This uses the `ClimaAtmos.jl` model, with parametrization options specified in the `atmos_config_object` dictionary.
=#

Utilities.show_memory_usage()
Expand Down Expand Up @@ -237,7 +242,13 @@ Note that land-sea area fraction is different to the land-sea mask, which is a b
(masks are used internally by the coupler to indicate passive cells that are not populated by a given component model).
=#

land_area_fraction = SpaceVaryingInput(land_mask_data, "LSMASK", boundary_space)
# Preprocess the file to be 1s and 0s before remapping into onto the grid
land_area_fraction = SpaceVaryingInput(
land_mask_data,
"z",
boundary_space,
file_reader_kwargs = (; preprocess_func = (data) -> data >= 0),
)
if !mono_surface
land_area_fraction = Regridder.binary_mask.(land_area_fraction)
end
Expand Down

0 comments on commit 6ac91fd

Please sign in to comment.