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 15, 2024
1 parent 52ab0ef commit d4651b9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 28 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ low-resolution version of such files is automatically downloaded when a
higher-resolution version is not available. Please, refer to
[ClimaArtifacts](https://github.com/CliMA/ClimaArtifacts) for more information.

### A higher resolution land-sea mask is now used and automatically downloaded

A 60 arcsecond land-sea mask constructed from topographic data is now used.
Topographic data is automatically downloaded and a land-sea mask is constructed
by identifying where elevation is greater than 0. Note, this can lead to
misidentification of ocean in some areas of the globe that are inland but below
sea level (Dead Sea, Death Valley, ...).
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"
12 changes: 10 additions & 2 deletions experiments/ClimaEarth/run_amip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ catch error
"MODEL.ICE.HAD187001-198110.OI198111-202206_lowres.nc",
)
end
land_mask_data =
joinpath(@clima_artifact("earth_orography_60arcseconds", comms_ctx), "ETOPO_2022_v1_60s_N90W180_surface.nc")

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

#=
## Component Model Initialization
Expand Down Expand Up @@ -239,7 +241,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
24 changes: 11 additions & 13 deletions experiments/ClimaEarth/run_cloudy_slabplanet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import ClimaCoupler:
TimeManager,
Utilities

import ClimaUtilities.ClimaArtifacts: @clima_artifact
import Interpolations

pkg_dir = pkgdir(ClimaCoupler)

#=
Expand Down Expand Up @@ -166,7 +169,8 @@ dir_paths = setup_output_dirs(output_dir = coupler_output_dir, comms_ctx = comms
## Data File Paths
=#
include(joinpath(pkgdir(ClimaCoupler), "artifacts", "artifact_funcs.jl"))
land_mask_data = artifact_data(mask_dataset_path(), "seamask")
land_mask_data =
joinpath(@clima_artifact("earth_orography_60arcseconds", comms_ctx), "ETOPO_2022_v1_60s_N90W180_surface.nc")

#=
## Component Model Initialization
Expand Down Expand Up @@ -200,18 +204,12 @@ This is a static field that contains the area fraction of land and sea, ranging
Note that land-sea area fraction is different to the land-sea mask, which is a binary field (masks are used internally by the coupler to indicate passive cells that are not populated by a given component model).
=#

land_area_fraction =
FT.(
Regridder.land_fraction(
FT,
dir_paths.regrid,
comms_ctx,
land_mask_data,
"LSMASK",
boundary_space,
mono = false,
)
)
land_area_fraction = SpaceVaryingInput(
land_mask_data,
"z",
boundary_space,
file_reader_kwargs = (; preprocess_func = (data) -> data >= 0),
)

#=
### Surface Model: Bucket Land and Slab Ocean
Expand Down

0 comments on commit d4651b9

Please sign in to comment.