polaris.tasks.e3sm.init.topo.cull.consistency.check_sea_ice_removed_regions
- polaris.tasks.e3sm.init.topo.cull.consistency.check_sea_ice_removed_regions(ds_mesh, preliminary_ocean_cull_mask, ocean_cull_mask, max_region_cells, max_region_area, logger, max_regions=10)[source]
Check that removing the cells in which sea ice would be trapped did not remove a whole sea from the ocean.
The sea-ice criteria are meant to trim small pockets. A large connected region removed by them is a sea cut off from the rest of the ocean, almost always because a strait leading to it is too narrow on this mesh for sea ice to pass, and a critical ocean passage along that strait is the fix. A region counts as large only if it exceeds both limits: a fjord on a fine mesh can be many cells, and a pocket of a few cells on a coarse mesh can be a large area.
- Parameters:
ds_mesh (xarray.Dataset) – The base mesh, with
cellsOnCell,nEdgesOnCell,areaCell,latCellandlonCellpreliminary_ocean_cull_mask (xarray.DataArray or numpy.ndarray) – The ocean cull mask before the sea-ice criteria were applied (1 where cells are culled, 0 where they are kept)
ocean_cull_mask (xarray.DataArray or numpy.ndarray) – The final ocean cull mask
max_region_cells (int) – The number of cells a removed region may have before it can count as a sea
max_region_area (float) – The area in km^2 a removed region may have before it can count as a sea
logger (logging.Logger) – The logger for summary output
max_regions (int, optional) – The maximum number of offending regions to report
- Raises:
ValueError – If any removed region exceeds both limits