polaris.tasks.e3sm.init.topo.cull.dc_edge_diagnostics.check_ocean_dc_edge
- polaris.tasks.e3sm.init.topo.cull.dc_edge_diagnostics.check_ocean_dc_edge(ds_base_mesh, ocean_cull_mask, ds_sizing, min_ratio, max_ratio, logger, out_filename='ocean_dc_edge_diagnostics.nc', max_clusters=10)[source]
Check that
dcEdgein the ocean/sea-ice domain stays within bounds relative to the local ocean background cell width.Edges whose two adjacent cells are both kept by the ocean cull mask (the interior edges of the future culled ocean mesh) are compared against the ocean background cell width sampled from the unified sizing field at the edge location. A diagnostics file with the per-edge ratio and violation masks is written, and a
ValueErroris raised if any ratio falls belowmin_ratioor abovemax_ratio.See the design document
unified_mesh_cull_leakin the documentation for the motivation and the choice of thresholds.- Parameters:
ds_base_mesh (xarray.Dataset) – The base MPAS mesh, with
dcEdge,latEdge,lonEdgeandcellsOnEdgeocean_cull_mask (xarray.DataArray or numpy.ndarray) – The ocean cull mask on base-mesh cells (1 where cells are culled, 0 where they are kept as ocean/sea-ice)
ds_sizing (xarray.Dataset) – The unified sizing field, with
ocean_background_cell_width(km) onlat/loncoordinates (degrees)min_ratio (float) – The minimum allowed ratio of
dcEdgeto the local ocean background cell widthmax_ratio (float) – The maximum allowed ratio of
dcEdgeto the local ocean background cell widthlogger (logging.Logger) – The logger for summary output
out_filename (str, optional) – The name of the diagnostics file to write
max_clusters (int, optional) – The maximum number of violation clusters to report
- Raises:
ValueError – If any ocean-interior edge violates the ratio bounds