Skip to content

Commit

Permalink
fixing for regions i.e. land_60N60S
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzhuzhang committed Nov 8, 2024
1 parent ef261b8 commit 542b88b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion e3sm_diags/driver/utils/regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ def _get_region_mask_var_key(ds_mask: xr.Dataset, region: str):
ValueError
If the region passed is not land or ocean.
"""
region_keys = FRAC_REGION_KEYS.get(region)
for region_prefix in ["land", "ocean"]:
if region_prefix in region:
region_keys = FRAC_REGION_KEYS.get(region_prefix)

if region_keys is None:
raise ValueError(f"Only land and ocean regions are supported, not '{region}'.")
Expand Down

0 comments on commit 542b88b

Please sign in to comment.