Skip to content

Commit

Permalink
Merge pull request #824 from trhille/landice/update_greenland_region_…
Browse files Browse the repository at this point in the history
…masks

Add ISMIP6 Greenland region masks that extend beyond ice edge
  • Loading branch information
trhille authored May 23, 2024
2 parents a9d4b53 + a781f57 commit 675d4b0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
10 changes: 5 additions & 5 deletions compass/landice/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
check_call(args, logger=logger)


def make_region_masks(self, mesh_filename, mask_filename, cores, tags):
def make_region_masks(self, mesh_filename, mask_filename,
cores, tags, component='landice', all_tags=True):
"""
Create masks for ice-sheet subregions based on data
in ``MPAS-Dev/geometric_fatures``.
Expand All @@ -797,10 +798,9 @@ def make_region_masks(self, mesh_filename, mask_filename, cores, tags):
gf = GeometricFeatures()
fcMask = FeatureCollection()

for tag in tags:
fc = gf.read(componentName='landice', objectType='region',
tags=[tag])
fcMask.merge(fc)
fc = gf.read(componentName=component, objectType='region',
tags=tags, allTags=all_tags)
fcMask.merge(fc)

geojson_filename = 'regionMask.geojson'
fcMask.to_geojson(geojson_filename)
Expand Down
3 changes: 2 additions & 1 deletion compass/landice/tests/antarctica/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def run(self):
self.cpus_per_task,
tags=['EastAntarcticaIMBIE',
'WestAntarcticaIMBIE',
'AntarcticPeninsulaIMBIE'])
'AntarcticPeninsulaIMBIE'],
all_tags=False)

mask_filename = f'{self.mesh_filename[:-3]}_ismip6_regionMasks.nc'
make_region_masks(self, self.mesh_filename, mask_filename,
Expand Down
11 changes: 9 additions & 2 deletions compass/landice/tests/greenland/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ def run(self):
data.variables['observedSurfaceVelocityUncertainty'][0, mask[0, :]] = 1.0 # noqa

# create region masks
mask_filename = f'{mesh_name[:-3]}_regionMasks.nc'
mask_filename = f'{mesh_name[:-3]}_ismip6_regionMasks.nc'
make_region_masks(self, mesh_name, mask_filename,
self.cpus_per_task,
tags=["Greenland", "ISMIP6", "Shelf"],
component='ocean')

mask_filename = f'{mesh_name[:-3]}_zwally_regionMasks.nc'
make_region_masks(self, mesh_name, mask_filename,
self.cpus_per_task,
tags=['eastCentralGreenland',
Expand All @@ -194,7 +200,8 @@ def run(self):
'southEastGreenland',
'southGreenland',
'southWestGreenland',
'westCentralGreenland'])
'westCentralGreenland'],
all_tags=False)

# Ensure basalHeatFlux is positive
data.variables['basalHeatFlux'][:] = np.abs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def make_diagnostics_files(logger, mesh_short_name, with_ice_shelf_cavities,

gf = GeometricFeatures()
region_groups = ['Antarctic Regions', 'Arctic Ocean Regions',
'Arctic Sea Ice Regions', 'Ocean Basins',
'Ocean Subbasins', 'ISMIP6 Regions']
'Arctic Sea Ice Regions', 'Greenland Regions',
'Ocean Basins', 'Ocean Subbasins', 'ISMIP6 Regions']

if with_ice_shelf_cavities:
region_groups.append('Ice Shelves')
Expand Down
2 changes: 1 addition & 1 deletion compass/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.4.0-alpha.1'
__version__ = '1.4.0-alpha.2'
2 changes: 1 addition & 1 deletion conda/compass_env/spec-file.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cartopy_offlinedata
cmocean
esmf=8.6.1={{ mpi_prefix }}_*
ffmpeg
geometric_features=1.3.0
geometric_features=1.4.0
git
gsw
h5py
Expand Down

0 comments on commit 675d4b0

Please sign in to comment.