Meshing realistic domains: General aims

Registered by Adam Candy

General aims of the Meshing to Realistic Domains project

Blueprint information

Adam Candy
Needs approval
Adam Candy
Series goal:
Milestone target:
Started by
Adam Candy

Related branches



Latest version of a new meshing approach for realistic domains.

This code generates Gmsh .geo files from RTopo NetCDF files. It is currently coded to use the mask to generate a boundary along the coastlines and grounding line* (which is not positioned at a constant depth). The code is easily extended to boundaries along depth contours and to work with other NetCDF sources.

The new approach uses Python contouring routines (as opposed to the GSHHS Gmsh plugin, or the GMT approach Changze's UROP used). It would be useful to test this new code on a wide range of regions - particularly to check the contouring routines are behaving satisfactorily. It works very well in the Antarctic region (including the region inside ice shelf cavities).

The dependencies are all Python modules (e.g. GMT is not required).

 * which involves a neat trick with modulo arithmetic to keep calculation time down significantly.

Supported features:
 - Define boundaries from NetCDF (currently restricted to the RTopo mask - trivial to extend)
 - Regions defined by arbitrary functions of longitude and latitude (given on the command line)
 - Simpler definition of regions by boxes (such as 'longmin:longmax,latmin:longmax')
 - Define included paths by Gmsh ID number (useful to include or exclude specific islands/land masses)
 - Deals with multiple open boundaries
 - Islands and boundaries split by the global boundary are treated
 - Automatically closes boundaries with parallels and meridians (with a prescribed length step)
 - Applies different boundary IDs on open and closed boundaries
 - Exclude smaller islands - restricted by a given minimum area
 - Option to extend domain in latitude on open boundaries (e.g. for sponge regions, or large open regions in the open ocean)
 - Command line used is saved in the Gmsh .geo file for reference
 - Option to generate the ACC average track line (and then to refine the mesh to this)

 1. Extend input options to extract boundaries from other NetCDF data (i.e. give field name and condition for contour)
 2. Calculate area in the right projection
 3. Length step for drawing parallels and meridians should be projected to the correct space (currently in radians (well degrees on the command line)).
 4. Make it possible to generate 3 distinct regions (ocean, ice-covered ocean, land) instead of the current 2 (ocean, land). This is necessary for applying boundary conditions on the top surface, for example.
 5. Look into using the Python Polygon library ( for more flexible definition of regions. This might also help in achieving point 4.


Work Items

This blueprint contains Public information 
Everyone can see this information.