Actions

NetCDF unstructured grid with subgrid

From BAWiki

Revision as of 09:30, 21 October 2022 by 127.0.0.1 (talk) (The LinkTitles extension automatically added links to existing pages (<a target="_blank" rel="nofollow noreferrer noopener" class="external free" href="https://github.com/bovender/LinkTitles">https://github.com/bovender/LinkTitles</a>).)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Introduction

A grid made out of arbitrary faces (triangles, quadrilaterals) is described. A topographic subgrid is available in addition to the computational grid. Typical file types are e.g. untrim_grid.dat as well as utrsub_grid.dat. Storage of grid related data, e. g. bathymetry or water level, is described elsewhere (see NetCDF synoptic data for unstructured grid with subgrid). Furthermore no information on open or closed edges, boundary conditions etc. is given here. The following description is concentrating solely on grid structure (topology).

The following description is complete with respect to the staggered locations node, edge and face.

All deviations/extensions from the UGRID conventions are highlighted in darkorange color.

Computational grid

The description of the computational grid is almost identical with NetCDF unstructured grid for an unstructured grid without subgrid. With respect to the computational grid only those variables are repeated here which deviate from their definition for an unstructured grid.

Grid with subgrid

In addition to the variables defining the computational grid all additional variables are presented which define the topographic subgrid. Because these informations are i. e. relevant for visualization, this type of grid is also referred to as plot-subgrid.

Combined grid

The two grids - computational grid plus subgrid - are part of the combined grid or parent mesh. In this context additional contact variables are required. They describe the relationship or connectivity between the two grids. This concept (parent mesh, contact variables) is esentially based on ideas worked out by Bert Jagers (Deltares) (see Deltares Conventions).

File contents

Dimensions

  1. nMesh2_node : number of nodes.
  2. nMesh2_edge : number of edges.
  3. nMesh2_face : number of faces (polygons).
  4. nMaxMesh2_face_nodes : maximum number of nodes/edges within a face (polygon)
  5. nSubMesh2_edge : number of plot-subedges.
  6. nSubMesh2_face : number of plot-subfaces (plot-subpolygons).
  7. nMaxSubMesh2_face_nodes : maximum number of plot-subnodes/plot-subedges within a plot-subface (-subpolygon).
  8. two : constant ( = 2 ).

Comment:

  1. Plot-subedges and plot-subfaces (-subpolygons) are mainly used for visualization purposes.
  2. The numerical model UNTRIM2 uses exclusively subface as well as subedge depth classes (not presented here).
  3. The total number of plot-subfaces and plot-subedges may be equal or larger than the respective number of depth classes.

Local coordinates

The definition for the local coordinates of the computational grid is identical to the description given for an unstructured computational grid without subgrid details. See NetCDF unstructured grid "local coordinates".

Local coordinates of the plot-subgrid

Edges

double SubMesh2_edge_x(nSubMesh2_edge) ;

SubMesh2_edge_x:long_name = "x-coordinate of 2D sub-mesh edges (center)" ;
SubMesh2_edge_x:units = "m" ;
SubMesh2_edge_x:name_id = 1650 ;
SubMesh2_edge_x:bounds = "SubMesh2_edge_x_bnd" ;
SubMesh2_edge_x:standard_name = "projection_x_coordinate" ;

double SubMesh2_edge_y(nSubMesh2_edge) ;

SubMesh2_edge_y:long_name = "y-coordinate of 2D sub-mesh edges (center)" ;
SubMesh2_edge_y:units = "m" ;
SubMesh2_edge_y:name_id = 1651 ;
SubMesh2_edge_y:bounds = "SubMesh2_edge_y_bnd" ;
SubMesh2_edge_y:standard_name = "projection_y_coordinate" ;

Comment:

  1. "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.

Faces (polygons)

double SubMesh2_face_x(nSubMesh2_face) ;

SubMesh2_face_x:long_name = "x-coordinate of 2D sub-mesh faces (arbitrary point inside face)" ;
SubMesh2_face_x:units = "m" ;
SubMesh2_face_x:name_id = 1650 ;
SubMesh2_face_x:bounds = "SubMesh2_face_x_bnd" ;
SubMesh2_face_x:standard_name = "projection_x_coordinate" ;

double SubMesh2_face_y(nSubMesh2_face) ;

SubMesh2_face_y:long_name = "y-coordinate of 2D sub-mesh faces (arbitrary point inside face)" ;
SubMesh2_face_y:units = "m" ;
SubMesh2_face_y:name_id = 1651 ;
SubMesh2_face_y:bounds = "SubMesh2_face_y_bnd" ;
SubMesh2_face_y:standard_name = "projection_y_coordinate" ;

Comment:

  1. "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
  2. An arbitrary point inside each face can be chosen.

Bounds for edges

double SubMesh2_edge_x_bnd(nSubMesh2_edge, two) ; \\ no metadata required

double SubMesh2_edge_y_bnd(nSubMesh2_edge, two) ; \\ no metadata required

Bounds for faces (polygons)

double SubMesh2_face_x_bnd(nSubMesh2_face, nMaxSubMesh2_face_nodes) ; \\ _FillValue required, not all nMaxSubMesh2_face_nodes must be present in one (sub-) face

SubMesh2_face_x_bnd:_FillValue = fillvalue ;

double SubMesh2_face_y_bnd(nSubMesh2_face, nMaxSubMesh2_face_nodes) ; \\ _FillValue required, not all nMaxSubMesh2_face_nodes must be present in one (sub-) face

SubMesh2_face_y_bnd:_FillValue = fillvalue ;

Comment:

  1. Coordinates of (sub-) faces (sub-polygons) must be prescribed in counter-clockwise orientation.
  2. Invalid coordinates are allowed to be present in the last position(s) in case there are less than nMaxSubMesh2_face_nodes nodes in a face.

Geographic coordinates

The definition for the geographic coordinates of the computational grid is identical to the description given for an unstructured computational grid without subgrid details. See NetCDF unstructured grid "geographic coordinates".

Geographic coordinates of the plot-subgrid

Edges

double SubMesh2_edge_lon(nSubMesh2_edge) ;

SubMesh2_edge_lon:long_name = "longitude of 2D sub-mesh edges (center)" ;
SubMesh2_edge_lon:units = "degrees_east" ;
SubMesh2_edge_lon:name_id = 1653 ;
SubMesh2_edge_lon:bounds = "SubMesh2_edge_lon_bnd" ;
SubMesh2_edge_lon:standard_name = "longitude" ;

double SubMesh2_edge_lat(nSubMesh2_edge) ;

SubMesh2_edge_lat:long_name = "latitude of 2D sub-mesh edges (center)" ;
SubMesh2_edge_lat:units = "degrees_north" ;
SubMesh2_edge_lat:name_id = 1652 ;
SubMesh2_edge_lat:bounds = "SubMesh2_edge_lat_bnd" ;
SubMesh2_edge_lat:standard_name = "latitude" ;

Comment:

  1. "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.

Faces (polygons)

double SubMesh2_face_lon(nSubMesh2_face) ;

SubMesh2_face_lon:long_name = "longitude of 2D sub-mesh faces (arbitrary point inside face)" ;
SubMesh2_face_lon:units = "degrees_east" ;
SubMesh2_face_lon:name_id = 1653 ;
SubMesh2_face_lon:bounds = "SubMesh2_face_lon_bnd" ;
SubMesh2_face_lon:standard_name = "longitude" ;

double SubMesh2_face_lat(nSubMesh2_face) ;

SubMesh2_face_lat:long_name = "latitude of 2D sub-mesh faces (arbitrary point inside face)" ;
SubMesh2_face_lat:units = "degrees_north" ;
SubMesh2_face_lat:name_id = 1652 ;
SubMesh2_face_lat:bounds = "SubMesh2_face_lat_bnd" ;
SubMesh2_face_lat:standard_name = "latitude" ;

Comment:

  1. "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
  2. An arbitrary point inside each face can be chosen.

Bounds for edges

double SubMesh2_edge_lon_bnd(nSubMesh2_edge, two) ; \\ no metadata required

double SubMesh2_edge_lat_bnd(nSubMesh2_edge, two) ; \\ no metadata required

Bounds for faces (Polygone)

double SubMesh2_face_lon_bnd(nSubMesh2_face, nMaxSubMesh2_face_nodes) ; \\ _FillValue required, not all nMaxSubMesh2_face_nodes must be present in one (sub-) face

SubMesh2_face_lon_bnd:_FillValue = fillvalue ;

double SubMesh2_face_lat_bnd(nSubMesh2_face, nMaxSubMesh2_face_nodes) ; \\ _FillValue required, not all nMaxSubMesh2_face_nodes must be present in one (sub-) face

SubMesh2_face_lat_bnd:_FillValue = fillvalue ;

Comment:

  1. Coordinates of (sub-) faces (sub-polygons) must be prescribed in counter-clockwise orientation.
  2. Invalid coordinates are allowed to be present in the last position(s) in case there are less than nMaxSubMesh2_face_nodes nodes in a face.

Connectivities

Computational grid

Connectivity tables for the computational grid are identical to those used for an unstructured grid without subgrid. See NetCDF unstructured grid "Connectivities".

Grid with subgrid

The subgrid does not require any connectivity table. Inter-relation between neighbors is not required at all.

Topology

Computational grid

int Mesh2 ;

Mesh2:long_name = "computational grid" ;
Mesh2:cf_role = "mesh_topology" ; \\ UGRID required
Mesh2:topology_dimension = 2 ; \\ UGRID required
Mesh2:node_coordinates = "Mesh2_node_x Mesh2_node_y Mesh2_node_lon Mesh2_node_lat" ; \\ UGRID required
Mesh2:edge_coordinates = "Mesh2_edge_x Mesh2_edge_y Mesh2_edge_lon Mesh2_edge_lat" ; \\ UGRID optionally required for data at edges
Mesh2:face_coordinates = "Mesh2_face_x Mesh2_face_y Mesh2_face_lon Mesh2_face_lat Mesh2_face_center_x Mesh2_face_center_y Mesh2_face_center_lon Mesh2_face_center_lat" ; \\ UGRID optionally required for data at faces
Mesh2:face_node_connectivity = "Mesh2_face_nodes" ; \\ UGRID required
Mesh2:face_edge_connectivity = "Mesh2_face_edges" ; \\ UGRID optional
Mesh2:edge_node_connectivity = "Mesh2_edge_nodes" ; \\ UGRID optional
Mesh2:edge_face_connectivity = "Mesh2_edge_faces" ;
Mesh2:parent_mesh = "Combined_Mesh2_and_SubMesh2" ;

Comment:

  1. Not all connectivities must be available because some of them contain redundant information. But be friendly to the end-user and provide as much information as possible.
  2. Attributes face_dimension and edge_dimension from 2D flexible mesh (mixed triangles, quadrilaterals, etc.) topology are not supported by BAW. These are required only in case the dimension ordering is nonstandard in any of the connectivity variables for faces and edges, respectively.
  3. Attribute "parent_mesh" refers to the combined mesh (parent mesh). The computational mesh is the first part of the parent mesh.

Grid with subgrid

int SubMesh2 ;

SubMesh2:long_name = "SubGrid" ;
SubMesh2:cf_role = "mesh_topology" ;
SubMesh2:topology_dimension = 2 ;
SubMesh2:edge_coordinates = "SubMesh2_edge_x SubMesh2_edge_y SubMesh2_edge_lon SubMesh2_edge_lat" ;
SubMesh2:face_coordinates = "SubMesh2_face_x SubMesh2_face_y SubMesh2_face_lon SubMesh2_face_lat" ;
SubMesh2:parent_mesh = "Combined_Mesh2_and_SubMesh2" ;

Hinweise:

  1. Other topological data are not available for the submesh.
  2. This variable is not compliant with UGRID Conventions, because the subgrid requires no connectivity tables.
  3. Attribute "parent_mesh" refers to the combined mesh (parent mesh). The subgrid is the second part of the parent mesh.

Combined grid

int Combined_Mesh2_and_SubMesh2 ;

Combined_Mesh2_and_SubMesh2:long_name = "combined grid" ;
Combined_Mesh2_and_SubMesh2:cf_role = "mesh_topology" ;
Combined_Mesh2_and_SubMesh2:sub_meshes = "Mesh2 SubMesh2" ;
Combined_Mesh2_and_SubMesh2:mesh_contacts = "SubMesh2_face_contact SubMesh2_edge_contact" ;

Comment:

  1. The Parent Mesh concept is so far not supported by the UGRID Conventions.
  2. Attribute "sub_meshes" refers to the two meshes (computational grid, subgrid) which constitute the Parent Mesh.
  3. Attribute "mesh_contacts" refers to variables (contact lists) which describe the inter-relation between the child meshes..

Contact lists

Contact lists describe the inter-relation between the different components (child meshes) of the parent mesh. In this example they are used to describe all connexions between computational grid and subgrid.

Contact list plot-subedges <-> edges

int SubMesh2_edge_contact(nSubMesh2_edge, two) ;

SubMesh2_edge_contact:long_name = "contact list between plot-subedges and edges in the computational grid" ;
SubMesh2_edge_contact:valid_range = 0, 4279 ;
SubMesh2_edge_contact:_FillValue = -999 ;
SubMesh2_edge_contact:coordinates = "SubMesh2_edge_x SubMesh2_edge_y SubMesh2_edge_lon SubMesh2_edge_lat" ;
SubMesh2_edge_contact:grid_mapping = "Mesh2_crs" ;
SubMesh2_edge_contact:cf_role = "mesh_topology_contact" ;
SubMesh2_edge_contact:contact_meshes = "SubMesh2 Mesh2" ;
SubMesh2_edge_contact:contact_type = "edge edge" ;
SubMesh2_edge_contact:start_index = 0 ;

Comment:

  1. The mesh topology contact concept is so far not supported by the UGRID Conventions.
  2. Indices start with zero..
  3. Each plot-subedge refers to an edge in the computational grid.
  4. Each edge of the computational grid typically refers to more than one plot-subedge.

Conatct list plot-subfaces <-> faces

int SubMesh2_face_contact(nSubMesh2_face, two) ;

SubMesh2_face_contact:long_name = "contact list between plot-subfaces and faces in the computational grid" ;
SubMesh2_face_contact:valid_range = 0, 10271 ;
SubMesh2_face_contact:_FillValue = -999 ;
SubMesh2_face_contact:coordinates = "SubMesh2_face_x SubMesh2_face_y SubMesh2_face_lon SubMesh2_face_lat" ;
SubMesh2_face_contact:grid_mapping = "Mesh2_crs" ;
SubMesh2_face_contact:cf_role = "mesh_topology_contact" ;
SubMesh2_face_contact:contact_meshes = "SubMesh2 Mesh2" ;
SubMesh2_face_contact:contact_type = "face face" ;
SubMesh2_face_contact:start_index = 0 ;

Comment:

  1. The mesh topology contact concept is so far not supported by the UGRID Conventions.
  2. Indices start with zero..
  3. Each plot-subface refers to a face in the computational grid.
  4. Each face of the computational grid typically refers to more than one plot-subface.

Coordinate transformation


back to NetCDF


Overview