sl.grid.readFESOM | R Documentation |
Read and analyse a FESOM1 or FESOM2 grid from ascii '.out' files.
sl.grid.readFESOM(griddir, rot = FALSE, rot.invert = FALSE, rot.abg, threeD = TRUE, remove.emptylev = TRUE, read.boundary = TRUE, reorder.ccw = TRUE, maxmaxneigh = 12, findneighbours.maxiter = 10, repeatlastpoint = TRUE, onlybaryc = FALSE, omitcoastnds = FALSE, calcpolyareas = TRUE, Rearth = 6371000, basicreadonly = FALSE, fesom2 = TRUE, verbose = TRUE)
griddir |
a character specifying the path to the FESOM grid directory. |
rot |
a logical value indicating whether or not to rotate the grid. |
rot.invert |
a logical value indicating whether or not to invert the rotation. |
rot.abg |
a vector of length 3 specifying the |
threeD |
a logical value indicating whether or not to read 3D grid information. If |
remove.emptylev |
a logical value indicating whether or not to remove empty bottom levels from the 3D grid. Only used if |
read.boundary |
a logical value indicating whether or not to read info on which 3D nodes are at horizontal or vertical boundaries. Only used if |
reorder.ccw |
a logical value indicating whether or not to reorder the triangular surface elements counterclockwise. |
maxmaxneigh |
an integer specifying an upper limit for the expected maximum number of neighbours for a surface node. For a typical (close to orthogonal) triangular mesh, there are 6 neighbours per node on average; the default value |
findneighbours.maxiter |
an integer specifying the maximum number of iterations used to order the neighbours of each surface node. The default |
repeatlastpoint |
a logical value indicating whether or not to pad the rows of the 'stamp polygon' matrices |
onlybaryc |
a logical value indicating whether or not to use only the barycenters (centroids) of the triangular surface elements for the stamp polygons, that is, to omit the edge medians inbetween. For a perfectly orthogonal grid the result will be identical as the lines connecting the centroids intersect the edge medians, but for non-orthogonal grids this introduces an inaccuracy. |
omitcoastnds |
a logical value indicating whether or not to omit coastal surface nodes from their corresponding stamp polygons. Usually the default |
calcpolyareas |
a logical value indicating whether or not to compute the areas of the triangular surface elements and of the stamp polygons. |
Rearth |
a scalar specifying the radius of the sphere - in case of FESOM the Earth. Used only if |
basicreadonly |
a logical value indicating whether or not only to read grid data without analysing neighborhood information etc. Reading is even faster with rot, reorder.ccw, and threeD all set to FALSE. |
fesom2 |
a logical value indicating whether the grid to be read is a FESOM2 grid. If FALSE, the grid is assumed to be a FESOM1 grid. Default is |
verbose |
a logical value indicating whether or not print statements shall report on the function progess. |
This is a FESOM-specific function to read grid information from the standard FESOM1 and FESOM2 ascii '.out' files.
a spheRlab grid list with the following elements:
N |
an integer specifying the number of surface nodes. |
Nlev |
an integer specifying the number of vertical levels. |
N3D |
an integer specifying the number of 3D nodes (only counting wet nodes). |
lon |
a vector of length |
lat |
a vector of length |
elem |
an |
coast |
a vector of length |
neighnodes |
an |
neighelems |
an |
stamppoly.lon |
an |
stamppoly.lat |
as |
baryc.lon |
a vector of length |
baryc.lat |
a vector of length |
cellareas |
a vector of length |
elemareas |
a vector of length |
depth |
a vector of length |
depth.bounds |
a vector of length |
depth.lev |
an integer vector of length |
boundary |
an integer vector of length |
It would probably make sense to split this function further as it consists of a number of well-defined blocks that might also be useful in other circumstances where the remainder of this function is not needed. The separate functions could be named consistenty sl.grid.SOMETHING.
The 3D functionality is incomplete; e.g., no 3d-element information is considered. The functionality can be extended when needed.
Helge Goessling
sl.grid.writeFESOM
, sl.grid.writeCDO
, sl.grid.writeZAXIS
## Not run:
# In this example a 'backward rotation' is performed, assuming that the original mesh coordinates are rotated;
# if that's not the case (which is now default), set 'rot=FALSE' or leave it unspecified (default is FALSE).
grid = sl.grid.readFESOM(griddir="PATH-TO-YOUR-FESOM-GRID",rot=TRUE,rot.invert=TRUE,rot.abg=c(50,15,-90))
# Write a grid description that is valid for quantities defined at nodes:
sl.grid.writeCDO(grid,ofile="~/sl.grid.scalars.nc")
# Write a grid description that is valid for quantities defined at element centers (or representative for elements):
sl.grid.writeCDO(grid,ofile="~/sl.grid.vectors.nc",fesom2velocities=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.