Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Feb 22, 2016 - IMPORTANT NOTE: To make the proposal a more formal standard, the content of this page has been migrated to GitHub, please follow this link.
The documentation below is no longer updated.

--------- snapshot Feb 22, 2016 ---------
Following the successful discussion that we had a few year's ago on conventions for storing unstructured grid data in netCDF files which eventually led to the UGRID conventions, I would like to propose a simple convention for documenting staggered data on structured grids that is consistent with the UGRID conventions. My proposal, which I will refer to as SGRID convention, is described below.

...

where the padding type may be one of the four literal strings: "none", "low", "high", or "both" depending on whether the face_dimension is one shorter than the corresponding node_dimension (padding:none), one longer than the corresponding node_dimension (padding:both), or of equal length with one extra value stored on the low or high end of the dimension (see the figure below). The edge1_dimensions and edge2_dimensions attributes may be used to define separate dimensions for the edges (see the ROMS example below), but by default the edge dimensions are assumed to be consistent with the dimensions used by the edges and faces respectively. The optional vertical_dimensions attribute may be used to specify the names of the dimensions for the layers and layer interfaces respectively using the same syntax: layer_dimension:layer_interface_dimension (padding:type).

Note:

  • The numbering of the edges corresponds to the order of the dimensions in the dimensions attributes. The order of the dimensions listed here does not change since these are specified as a string. The actual order of dimensions in the netCDF API (and hence in the dump generated by different tools) depends on the programming language used. Hence, the order of the dimensions listed here may differ from the order of the dimensions in the data definition.

 

Figure 1: illustrating the formulations used for expressing the relationship between face/edge and node dimensions. Please note that the numbering of the faces and nodes can be adjusted using face(face) and node(node) coordinate variables.

...

Required topology attributes

Value

cf_role

mesh_topology

topology_dimension

3

node_dimensions

node_dimension1 node_dimension2 node_dimension3

volume_dimensions

face_dimension1:node_dimension1 (padding:type1) face_dimension2:node_dimension2 (padding:type2) face_dimension3:node_dimension3 (padding:type3)

Optional attributes

Default value

edge1_dimensionsface_dimension1:node_dimension1 (padding:type1) node_dimension2 node_dimension3
edge2_dimensionsnode_dimension1 face_dimension2:node_dimension2 (padding:type2) node_dimension3
edge3_dimensionsnode_dimension1 node_dimension2 face_dimension3:node_dimension3 (padding:type3)
face1_dimensionsnode_dimension1 face_dimension2:node_dimension2 (padding:type2) face_dimension3:node_dimension3 (padding:type3)
face2_dimensionsface_dimension1:node_dimension1 (padding:type1) node_dimension2 face_dimension3:node_dimension3 (padding:type3)
face3_dimensionsface_dimension1:node_dimension1 (padding:type1) face_dimension2:node_dimension2 (padding:type2) node_dimension3
node_coordinates
edge <i> _coordinates
face <i> _coordinates
volume_coordinates

NoteNotes:

  • The edge1, edge2, and edge3 are in a 3D grid aligned to the dimensions1, 2, and 3 respectively, whereas the edge1 and edge2 are in a 2D grid perpendicular to the dimensions 1 and 2 respectively. The face1, face2, and face3 play that role in the 3D grid.

Example:

  • The 3d grid option should not be used be used for layered grids, such as typical ocean and atmosphere models. Use the 2d grid with vertical dimensions instead. This allows 2D quantities (such as surface quantities) and 3D quantities to be linked to the same mesh.

Example:

Code Block
dimensions:
Code Block
dimensions:
	time = UNLIMITED ;
	inode = 10 ;
	jnode = 20 ;
	knode = 30 ;
	iface = 9 ;
	jface = 19 ;
	kface = 29 ;

variables:
	char time(time) ;
		time:standard_name = "time" ;
		time:long_name = "time" ;
		time:units = "seconds since 2015-01-01 00:00:00" ;
	float u(time, kface, jface, inode) ;
		u:description = "x-velocity" ;
		u:units = "m s-1" ;
		u:grid = "MyGrid3" ;
		u:location = "face1" ;
	float v(time, kface, jnode, iface) ;
		u:description = "y-velocity" ;
		u:units = "m s-1" ;
		u:grid = "MyGrid3" ;
		u:location = "face2" ;
	float w(time, knode, jface, iface) ;
		u:description = "z-velocity" ;
		u:units = "m s-1" ;
		u:grid = "MyGrid3" ;
		u:location = "face3" ;
	float c(time, kface, jface, iface) ;
		c:description = "some concentration" ;
		c:grid = "MyGrid3" ;
		c:location = "volume" ;
	float node_lat(knode, jnode, inode) ;
		node_lat:standard_name = "latitude" ;
		node_lat:units = "degree_north" ;
	float node_lon(knode, jnode, inode) ;
		node_lon:standard_name = "longitude" ;
		node_lon:units = "degree_east" ;
	float node_elevation(knode, jnode, inode) ;
		node_elevation:description = "elevation" ;
		node_elevation:units = "m" ;

	int MyGrid3 ;
		grid:cf_role = grid_topology
		grid:topology_dimension = 3 ;
		grid:node_dimensions = "inode jnode knode" ;
		grid:volume_dimensions = "iface: inode (padding: none) jface: jnode (padding: none) kface: knode (padding: none)" ;
		grid:node_coordinates = "node_lon node_lat node_elevation" ;

...

The WRF-ARW also uses a C-grid. In this case the resulting data is described as a 3D grid topology. It could also be interpreted as a 2D layered model just like Delft3D and ROMS (or those models could also result in 3D grid topologies). A layered approach is more consistent with the UGRID approach that distinguishes between the unstructured mesh in the horizontal and the structured (layered) grid in the vertical, but the 3D grid offers a more symmetric treatment of the staggered U, V and W components.Again the model results can best be captured by a 2D grid.

It might be interesting to verify the result It might be interesting to verify the result for WRF-NMM since that model uses an E-grid, but I couldn't find an example file.

Code Block
netcdf wrfout_v2_Lambert {
dimensions:
	Time = UNLIMITED ; // (13 currently)
	DateStrLen = 19 ;
	west_east = 73 ;
	south_north = 60 ;
	west_east_stag = 74 ;
	bottom_top = 27 ;
	south_north_stag = 61 ;
	bottom_top_stag = 28 ;

variables:
	char Times(Time, DateStrLen) ;
	float U(Time, bottom_top, south_north, west_east_stag) ;
		U:description = "x-wind component" ;
		U:units = "m s-1" ;
		U:grid = "grid" ; // SGRID attribute
		U:location = "face1edge1" ; // SGRID attribute
	float V(Time, bottom_top, south_north_stag, west_east) ;
		V:description = "y-wind component" ;
		V:units = "m s-1" ;
		V:grid = "grid" ; // SGRID attribute
		U:location = "face2edge2" ; // SGRID attribute
	float W(Time, bottom_top_stag, south_north, west_east) ;
		W:description = "z-wind component" ;
		W:units = "m s-1" ;
		W:grid = "grid" ; // SGRID attribute
		W:location = "face3face" ; // SGRID attribute
	float T(Time, bottom_top, south_north, west_east) ;
		T:description = "perturbation potential temperature (theta-t0)" ;
		T:units = "K" ;
		W:grid = "grid" ; // SGRID attribute
		W:location = "volumeface" ; // SGRID attribute
	float XLAT(Time, south_north, west_east) ;
		XLAT:description = "LATITUDE, SOUTH IS NEGATIVE" ;
		XLAT:units = "degree_north" ;
	float XLONG(Time, south_north, west_east) ;
		XLONG:description = "LONGITUDE, WEST IS NEGATIVE" ;
		XLONG:units = "degree_east" ;
	float ZNU(Time, bottom_top) ;
		ZNU:description = "eta values on half (mass) levels" ;
		ZNU:units = "" ;
	float ZNW(Time, bottom_top_stag) ;
		ZNW:description = "eta values on full (w) levels" ;
		ZNW:units = "" ;
// SGRID variable
	int grid ;
		grid:cf_role = grid_topology
		grid:topology_dimension = 32 ;
		grid:node_dimensions = "west_east_stag south_north_stag bottom_top_stag" ;
		grid:volumeface_dimensions = "west_east: west_east_stag (padding: none) south_north: south_north_stag (padding: none) bottom_top: bottom_top_stag (padding: none)" ;
" ;
   		grid:volumeface_coordinates = "XLONG XLAT" ; // what to do with ZNU/ZNW vertical coordinates?
        grid:vertical_dimensions = "bottom_top: bottom_top_stag (padding: none)" ;

// global attributes:
		:TITLE = " OUTPUT FROM WRF V2.0 MODEL" ;
}