ocnWmean: volume-weighted average of ocean variables

Description Usage Arguments Details Value

View source: R/ocnWmean.R

Description

Get the mean value of a scalar field in the ocean component

Usage

1
ocnWmean(nc, vname=NULL, x=NULL, mask=NULL, wsum=FALSE, getprofile=FALSE)

Arguments

nc

ncdf4 object as returned by the package ncdf4

vname

CHARACTER, variable name

x

REAL, (nlon, nlat, nz), variable over which to get the statistics

mask

LOGICAL, (nlon, nlat, nz), mask to select a 3D subgrid for the calculations

wsum

LOGICAL, if TRUE the weighted sum over the masked volume is given instead of the mean

getprofile

LOGICAL, if TRUE the weighted mean/sum is given at every depth

Details

The function assumes the variable uses the temperature grid. Is it thus an approximation for velocity of other fields which use the velocity grid. It is possible to use the function for any input matrix x and its associated mask, if these are compliant with the grid for TEMP in the nc netCDF file.

Value

A scalar for a 3D grid, or a vector for multistep (4D) grid


garciapintado/rdafCESM documentation built on July 18, 2019, 4:41 p.m.