NetCDF triangular grid: Difference between revisions
From BAWiki
imported>Lang Guenther (text translated from German to English) |
imported>Lang Guenther m (→Face-edge connectivity: wrong use of nodes corrected) |
||
Line 180: | Line 180: | ||
Comment: | Comment: | ||
# | # Edges must be prescribed in counter-clockwise orientation. | ||
===Edge-face connectivity=== | ===Edge-face connectivity=== |
Revision as of 07:43, 15 April 2016
Introduction
A grid made out of triangles is described. Typical file types are e.g. gitter05.dat, gitter05.bin as well as selafin. But it could also be a grid of type untrim_grid.dat which consists exclusively out of triangles. Storage of grid related data, e. g. bathymetry or water level, is described elsewhere (see NetCDF synoptic data for triangular grid). Furthermore no information on open or closed edges, boundary cconditions 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. One should consider although that the full set of data is not available for all file types.
The concept presented is essentially identical with section 2D triangular mesh topology of the UGRID Conventions. All deviations from the UGRID conventions are highlighted in darkorange color.
File contents
Dimensions
- nMesh2_node : number of nodes.
- nMesh2_edge : number of edges.
- nMesh2_face : number of faces (polygons) - here triangles
- two : constant ( = 2 ).
- three : constant ( = 3 ).
Local coordinates
Nodes
double Mesh2_node_x(nMesh2_node) ;
- Mesh2_node_x:long_name = "x-coordinate of 2D mesh nodes" ;
- Mesh2_node_x:units = "m" ;
- Mesh2_node_x:name_id = 1650 ;
- Mesh2_node_x:standard_name = "projection_x_coordinate" ;
double Mesh2_node_y(nMesh2_node) ;
- Mesh2_node_y:long_name = "y-coordinate of 2D mesh nodes" ;
- Mesh2_node_y:units = "m" ;
- Mesh2_node_y:name_id = 1651 ;
- Mesh2_node_y:standard_name = "projection_y_coordinate" ;
Comment:
- "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
Edges
double Mesh2_edge_x(nMesh2_edge) ;
- Mesh2_edge_x:long_name = "x-coordinate of 2D mesh edges" ;
- Mesh2_edge_x:units = "m" ;
- Mesh2_edge_x:name_id = 1650 ;
- Mesh2_edge_x:bounds = "Mesh2_edge_x_bnd" ;
- Mesh2_edge_x:standard_name = "projection_x_coordinate" ;
double Mesh2_edge_y(nMesh2_edge) ;
- Mesh2_edge_y:long_name = "y-coordinate of 2D mesh edges" ;
- Mesh2_edge_y:units = "m" ;
- Mesh2_edge_y:name_id = 1651 ;
- Mesh2_edge_y:bounds = "Mesh2_edge_y_bnd" ;
- Mesh2_edge_y:standard_name = "projection_y_coordinate" ;
Comment:
- "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
Faces (polygons)
double Mesh2_face_x(nMesh2_face) ;
- Mesh2_face_x:long_name = "x-coordinate of 2D mesh faces (polygons), center of gravity" ;
- Mesh2_face_x:units = "m" ;
- Mesh2_face_x:name_id = 1650 ;
- Mesh2_face_x:bounds = "Mesh2_face_x_bnd" ;
- Mesh2_face_x:standard_name = "projection_x_coordinate" ;
double Mesh2_face_y(nMesh2_face) ;
- Mesh2_face_y:long_name = "y-coordinate of 2D mesh faces (polygons), center of gravity" ;
- Mesh2_face_y:units = "m" ;
- Mesh2_face_y:name_id = 1651 ;
- Mesh2_face_y:bounds = "Mesh2_face_y_bnd" ;
- Mesh2_face_y:standard_name = "projection_y_coordinate" ;
Comment:
- "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
- Center of gravity is used, because this point is always inside the polygon if the polygon is convex. The center of the circumcircle may be located outside of the polygon instead.
(optional) Bounds for edges
double Mesh2_edge_x_bnd(nMesh2_edge, two) ; \\ no metadata required
double Mesh2_edge_y_bnd(nMesh2_edge, two) ; \\ no metadata required
(optional) Bounds for faces (polygons)
double Mesh2_face_x_bnd(nMesh2_face, three) ; \\ no metadata required
double Mesh2_face_y_bnd(nMesh2_face, three) ; \\ no metadata required
Comment:
- Node coordinates of faces (polygons) must be prescribed in counter-clockwise orientation.
Geographic coordinates
Nodes
double Mesh2_node_lon(nMesh2_node) ;
- Mesh2_node_lon:long_name = "longitude of 2D mesh nodes" ;
- Mesh2_node_lon:units = "degrees_east" ;
- Mesh2_node_lon:name_id = 1653 ;
- Mesh2_node_lon:standard_name = "longitude" ;
double Mesh2_node_lat(nMesh2_node) ;
- Mesh2_node_lat:long_name = "latitude of 2D mesh nodes" ;
- Mesh2_node_lat:units = "degrees_north" ;
- Mesh2_node_lat:name_id = 1652 ;
- Mesh2_node_lat:standard_name = "latitude" ;
Comment:
- "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
Edges
double Mesh2_edge_lon(nMesh2_edge) ;
- Mesh2_edge_lon:long_name = "longitude of 2D mesh edge centers" ;
- Mesh2_edge_lon:units = "degrees_east" ;
- Mesh2_edge_lon:name_id = 1653 ;
- Mesh2_edge_lon:bounds = "Mesh2_edge_lon_bnd" ;
- Mesh2_edge_lon:standard_name = "longitude" ;
double Mesh2_edge_lat(nMesh2_edge) ;
- Mesh2_edge_lat:long_name = "latitude of 2D mesh edge centers" ;
- Mesh2_edge_lat:units = "degrees_north" ;
- Mesh2_edge_lat:name_id = 1652 ;
- Mesh2_edge_lat:bounds = "Mesh2_edge_lat_bnd" ;
- Mesh2_edge_lat:standard_name = "latitude" ;
Comment:
- "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
Faces (polygons)
double Mesh2_face_lon(nMesh2_face) ;
- Mesh2_face_lon:long_name = "longitude of 2D mesh faces (polygons), center of gravity" ;
- Mesh2_face_lon:units = "degrees_east" ;
- Mesh2_face_lon:name_id = 1653 ;
- Mesh2_face_lon:bounds = "Mesh2_face_lon_bnd" ;
- Mesh2_face_lon:standard_name = "longitude" ;
double Mesh2_face_lat(nMesh2_face) ;
- Mesh2_face_lat:long_name = "latitude of 2D mesh faces (polygons), center of gravity" ;
- Mesh2_face_lat:units = "degrees_north" ;
- Mesh2_face_lat:name_id = 1652 ;
- Mesh2_face_lat:bounds = "Mesh2_face_lat_bnd" ;
- Mesh2_face_lat:standard_name = "latitude" ;
Comment:
- "name_id" corresponds to the so-called PHYDEF-Code of variables which is used internally at BAW.
- Center of gravity is used, because this point is always inside the polygon if the polygon is convex. The center of the circumcircle may be located outside of the polygon instead.
(optional) Bounds for edges
double Mesh2_edge_lon_bnd(nMesh2_edge,two) ; \\ no metadata required
double Mesh2_edge_lat_bnd(nMesh2_edge,two) ; \\ no metadata required
(optional) Bounds for faces (polygons)
double Mesh2_face_lon_bnd(nMesh2_face,three) ; \\ no metadata required
double Mesh2_face_lat_bnd(nMesh2_face,three) ; \\ no metadata required
Comment:
- Node coordinates of faces (polygons) must be prescribed in counter-clockwise orientation.
Connectivities
Not all of the subsequently listed connectivity tables must be present. However it must be assured, that missing connectivities can be derived from the available ones.
Edge-node connectivity
int Mesh2_edge_nodes(nMesh2_edge,two) ;
- Mesh2_edge_nodes:long_name = "list of nodes for all edges, start node - end node" ;
- Mesh2_edge_nodes:cf_role= "edge_node_connectivity" ;
- Mesh2_edge_nodes:start_index = 0 ;
Comment:
- First an second node represent start and end point of an edge.
Face-node connectivity
int Mesh2_face_nodes(nMesh2_face, three) ;
- Mesh2_face_nodes:long_name = "list of nodes for all faces (polygons), counterclockwise" ;
- Mesh2_face_nodes:cf_role = "face_node_connectivity" ;
- Mesh2_face_nodes:start_index = 0 ;
Comment:
- Nodes must be prescribed in counter-clockwise orientation.
Face-edge connectivity
int Mesh2_face_edges(nMesh2_face,three) ;
- Mesh2_face_edges:long_name = "list of edges for all faces (polygons), counterclockwise" ;
- Mesh2_face_edges:cf_role= "face_edge_connectivity" ;
- Mesh2_face_edges:start_index = 0;
Comment:
- Edges must be prescribed in counter-clockwise orientation.
Edge-face connectivity
int Mesh2_edge_faces(nMesh2_edge,two) ;
- Mesh2_edge_faces:long_name = "list of (adjacent) faces (polygons) for all edges - left and right neigbour" ;
- Mesh2_edge_faces:cf_role = "edge_face_connectivity" ;
- Mesh2_edge_faces:_FillValue = fillvalue ;
- Mesh2_edge_faces:start_index = 0;
Comment:
- First and second entry represent left and right neighbor faces (polygons).
- "_FillValue" is used to indicate edges at boundaries with one missing neighbor polygon.
Topology
int Mesh2 ;
- Mesh2:long_name = "name of grid can be stored here" ;
- 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" ; \\ 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 optionally required for data at edges
- Mesh2:edge_face_connectivity = "Mesh2_edge_faces" ; \\
Comment:
- 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.
- Attributes face_dimension and edge_dimension from 2D triangular mesh 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.
Coordinate transformation
See NetCDF grid mapping variable.
back to NetCDF