Converting Other Mesh Formats#

Iris’ Mesh Data Model is based primarily on the CF-UGRID conventions (see The Mesh Data Model), but other mesh formats can be converted to fit into this model, enabling use of Iris’ specialised mesh support. Below are some examples demonstrating how this works for various mesh formats.

FESOM 1.4 Voronoi Polygons#

Sample of FESOM mesh voronoi polygons, with variable numbers of sides.

A FESOM mesh encoded in a NetCDF file includes:

  • X+Y point coordinates

  • X+Y corners coordinates of the Voronoi Polygons around these points - represented as the bounds of the coordinates

To represent the Voronoi Polygons as faces, the corner coordinates will be used as the nodes when creating the Iris Mesh.

WAVEWATCH III Spherical Multi-Cell (SMC) WAVE Quad Grid#

Sample of an SMC mesh, with decreasing quad sizes at the coastlines.

An SMC grid encoded in a NetCDF file includes:

  • X+Y face centre coordinates

  • X+Y base face sizes

  • X+Y face size factors

From this information we can derive face corner coordinates, which will be used as the nodes when creating the Iris Mesh.

NEMO data on ORCA tripolar grid#

Plot of ORCA-gridded data from NEMO.

NEMO can use various grids, but is frequently used with ORCA type grids. ORCA grids store global data in 2-dimensional ny * nx arrays. All cells are four-sided. The grids are based on tri-polar layouts, but X and Y spacings are irregular and not given by any defined functional forms.

  • arrays (ny, nx) of face-located data variables

  • arrays (ny, nx) of X+Y face centre coordinates

  • arrays (ny, nx, 4) of X+Y face corner coordinates (all faces are quadrilaterals)

For simplicity, we treat each face corner as an independent node, and use a face-node connectivity which simply lists the nodes in sequence, i.e. [[0, 1, 2, 3], [4, 5, 6, 7], …].

Note

This is the simplest solution, but produces approx 4x more nodes than necessary, since the coordinate bounds contain many duplicate locations. Removing the duplicates is quite easy, but often not necessary.

To make an unstructured cube, the data must be ‘flattened’ to convert the given X and Y dimensions into a single mesh dimension. Since Iris cubes don’t support a “reshape” or “flatten” operations, we create a new cube from the flattened data.