sl.griddes2neighmat: Read CDO Grid Description File and Derive Neighbourhood

Description Usage Arguments Details Value Author(s) Examples

View source: R/sl.griddes2neighmat.R

Description

Read longitude and latitude information (nodes and boundary vertices) from a CDO grid description file of an unstructured triangular mesh and derive neighbourhood and other information.

Usage

1
sl.griddes2neighmat(CDOgriddes, critnum.neigh = 2, critnum.coast = 1)

Arguments

CDOgriddes

a character providing the system location of the CDO grid description file (NetCDF format).

critnum.neigh

an integer needed to decide whether any two nodes are neighbours; nodes need to have at least critnum.neigh common boundary vertices to be classified as neighbours. The correct value may depend on the mesh structure, and/or the question at hand. The default value is critnum.neigh=2.

critnum.coast

an integer needed to decide whether a node is coastal: if any of the corresponding boundary vertices has less than critnum.coast matches with any boundary vertex of any other node, the node is assigned as coastal. The correct value depends on the mesh structure. The default is critnum.coast=1, which works for meshes where coastal nodes have at least one boundary vertex that is not shared with any neighbour node. Other meshes may need critnum.coast=2.

Details

For each node given in the CDO mesh description the boundary vertices span a polygon that defines the 'stamp' of that node, that is, the patch over which the node value is assumed to be valid ('finite volume' interpretation). In this function the longitude and latitude information of the boundary vertices are used to derive the neighbourhood (and other) information. Note that the boundary polygon is not identical with what is usually referred to as an 'element': the latter is constructed by three nodes, whereas the boundary polygon consists of vertices surrounding each node, e.g., the edge medians and element centroids.

Value

lat

a vector of length N giving the latitudes of all nodes.

lon

a vector of length N giving the longitudes of all nodes.

neighmat

a matrix of size NxM giving the (ordered) neighbours of all nodes, where M is the maximum number of neighbours for a node.

Nneigh

a vector of size NxM giving the (ordered) neighbours of all nodes.

is.coast

a vector of size N with logical values indicating which nodes are coastal.

critnum.neigh

an integer identical with the equally named function argument.

critnum.coast

an integer identical with the equally named function argument.

Author(s)

Helge Goessling

Examples

1
## To be provided ...

helgegoessling/spheRlab documentation built on Sept. 29, 2018, 12:09 p.m.