Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/sl.grid.readFESOM.R

Read and analyse a FESOM grid from ascii '.out' files.

1 | ```
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, 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. |

`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 FESOM 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.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.addinfo`

1 2 3 4 5 6 7 8 | ```
## Not run:
grid = sl.grid.readFESOM(griddir="PATH-TO-YOUR-FESOM-GRID",rot=TRUE,rot.invert=TRUE,rot.abg=c(50,15,-90))
ofile = "~/sl.grid.CDO"
sl.grid.writeCDO(grid,ofile=ofile)
system(paste0("cdo -f nc const,0,",ofile," ",ofile,".nc"))
sl.grid.addinfo(grid,ncdf.file.in=paste0(ofile,".nc"))
## End(Not run)
``` |

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.