Previous topic

nc_varcopy

Next topic

nc_vardelete

This Page

nc_vardefΒΆ

nc_vardef adds a new variable to an open netCDF file in define mode.

varid = nc_vardef(ncid, ssName, nDataType, rvDimids)

Return Value

varid is the ID of the variable. If a error occurs, varid is -1.

Parameters

ncid

Identifies the netCDF file.

ssName

ssName is the name of the variable. Must begin with an alphabetic character or an underscore, followed by zero or more alphanumeric characters including the underscore (_) or numbers. Case is significant.

nDataType

nDataType is the data type of the variable and is one of the following: NC_BYTE, NC_CHAR, NC_SHORT, NC_LONG, NC_FLOAT, NC_DOUBLE.

rvDimids

rvDimids is vector of dimension ID’s and defines the shape of a netCDF variable.

id-1963459