polaris.tasks.e3sm.init.topo.cull.consistency.check_land_locked_criteria

polaris.tasks.e3sm.init.topo.cull.consistency.check_land_locked_criteria(ds_mesh, ocean_cull_mask, ocean_no_cavities_cull_mask, latitude_threshold, logger, max_cells=20)[source]

Check that no land-locked cells survive in either ocean domain.

Three post-conditions of removing land-locked cells:

  1. Every cell of either domain has at least two active edges, so that a C-grid has a way to move water in and a way to move it out.

  2. Every cell of the ocean without cavities poleward of the sea-ice latitude threshold has at least one active vertex, so that a B-grid has a velocity point by which ice can leave it.

  3. Every cell of the ocean without cavities can reach the part of that domain equatorward of the threshold, where ice melts, over edges that carry B-grid flux.

Parameters:
  • ds_mesh (xarray.Dataset) – An MPAS mesh with cellsOnCell, nEdgesOnCell and latCell

  • ocean_cull_mask (xarray.DataArray or numpy.ndarray) – The ocean cull mask on base-mesh cells (1 where cells are culled)

  • ocean_no_cavities_cull_mask (xarray.DataArray or numpy.ndarray) – The cull mask for the ocean without ice-shelf cavities

  • latitude_threshold (float) – The latitude in degrees poleward of which sea ice can form

  • logger (logging.Logger) – The logger for summary output

  • max_cells (int, optional) – The maximum number of offending cell indices to report

Raises:

ValueError – If any of the criteria is violated