.TH NETCDF 3 "26 February 1993" "Printed: \n(yr.\n(mo.\n(dy" "UNIDATA LIBRARY FUNCTIONS" .SH NAME netcdf \- Unidata Network Common Data Form (netCDF-2) library .SH WARNING The interface described here is obsolete, but included because the perl module still use it. .SH SYNOPSIS .ft B .na .nh .HP #include <netcdf.h> .HP 6 int nccreate(const char* path, int cmode) .HP int ncopen(const char* path, int mode) .HP int ncredef(int ncid) .HP int ncsetfill(int ncid, int fillmode) .HP int ncendef(int ncid) .HP int ncclose(int ncid) .HP int ncinquire(int ncid, int* ndims, int* nvars, int*\ natts, int*\ recdim) .HP int ncsync(int ncid) .HP int ncabort(int ncid) .HP int ncdimdef(int ncid, const char* name, long length) .HP int ncdimid(int ncid, const char* name) .HP int ncdiminq(int ncid, int dimid, char* name, long*\ length) .HP int ncdimrename(int ncid, int dimid, const char* name) .HP int ncvardef(int ncid, const char* name, nc_type datatype, int\ ndims, const int\ dimids[]) .HP int ncvarid(int ncid, const char* name) .HP int ncvarinq(int ncid, int varid, char* name, nc_type*\ datatype, int*\ ndims, int\ dimids[], int*\ natts) .HP int ncvarput1(int ncid, int varid, const long coords[], const void*\ value) .HP int ncvarget1(int ncid, int varid, const long coords[], void*\ value) .HP int ncvarput(int ncid, int varid, const long start[], const long\ count[], const void*\ value) .HP int ncvarget(int ncid, int varid, const long start[], const long\ count[], void*\ value) .HP int ncvarputg(int ncid, int varid, const long start[], const long\ count[], const long\ stride[], const long\ imap[], const void*\ value) .HP int ncvargetg(int ncid, int varid, const long start[], const long\ count[], const long\ stride[], const long\ imap[], void*\ value) .HP int ncrecput(int ncid, long\ recnum, void*\ const\ valuep[]) .HP int ncrecget(int ncid, long\ recnum, void*\ valuep[]) .HP int ncrecinq(int ncid, int*\ nrvars, int\ rvarids[], long\ rsizes[]) .HP int ncvarrename(int ncid, int varid, const char* name) .HP int ncattput(int ncid, int varid, const char* name, nc_type\ datatype, int\ len, const void*\ value) .HP int ncattinq(int ncid, int varid, const char* name, nc_type*\ datatype, int*\ len) .HP int ncattget(int ncid, int varid, const char* name, void*\ value) .HP int ncattcopy(int inncid, int invar, const char* name, int\ outncid, int\ outvar) .HP int ncattname(int ncid, int varid, int attnum, char*\ name) .HP int ncattrename(int ncid, int varid, const char* name, const char*\ newname) .HP int ncattdel(int ncid, int varid, const char* name) .HP int nctypelen(nc_type datatype) .ad .hy .SH "FUNCTION DESCRIPTIONS" .LP These routines implement the Unidata netCDF data-access interface for the C programming language. Only those arguments which are unique to the function being described are documented in this section. See the section "COMMON ARGUMENT DESCRIPTIONS" for descriptions of the other arguments. .HP 4 \fBint nccreate(const char* \fIpath\fB, int \fIcmode\fB)\fR .sp Creates the new netCDF file, returning a netCDF ID that can subsequently be used to refer to the netCDF file. The new netCDF file is placed in define mode. The mode parameter, \fIcmode\fP, should be either \fBNC_CLOBBER\fP or \fBNC_NOCLOBBER\fP. \fBNC_CLOBBER\fP means that even if the file already exists, you want to create a new file with the same name, erasing the old file's contents. \fBNC_NOCLOBBER\fP means you want to create a new netCDF file only if the given file name does not refer to a file that already exists. If an error occurs, this function returns -1. .HP \fBint ncopen(const char* \fIpath\fB, int \fImode\fB)\fR .sp Opens the existing netCDF file for access. The mode parameter, \fImode\fP, should be either \fBNC_WRITE\fP, to open the file for writing, or \fBNC_NOWRITE\fP, to open the file read-only. "Writing" means any kind of change to the file, including appending or changing data, adding or renaming dimensions, variables, or attributes, or deleting attributes. If an error occurs, this function returns -1. .HP \fBint ncredef(int \fIncid\fB)\fR .sp Puts an open netCDF file into define mode, so dimensions, variables, and attributes can be added or renamed and attributes can be deleted. If an error occurs, this function returns -1. .HP \fBint ncsetfill(int \fIncid\fB, int \fIfillmode\fB)\fR .sp Determines whether or not variable prefilling will be done (see \fBVARIABLE PREFILLING\fP below). The netCDF file shall be writable. \fIfillmode\fP is either \fBNC_FILL\fP to enable prefilling (the default) or \fBNC_NOFILL\fP to disable prefilling. This function returns the previous setting or -1 if an error occurs. .HP \fBint ncendef(int \fIncid\fB)\fR .sp Takes an open netCDF file out of define mode. The changes made to the netCDF file while it was in define mode are checked and committed to disk if no problems occurred. In particular, non-record variables are filled with their fill-values unless \fBncsetfill(\|)\fP has been called with the argument \fBNC_NOFILL\fP. The netCDF file is then placed in data mode, so that variable data can be read or written. If an error occurs, this function returns -1. .HP \fBint ncclose(int \fIncid\fB)\fR .sp Closes an open netCDF file. If the file is in define mode, \fBncendef(\|)\fP will be called before closing. (In this case, if \fBncendef(\|)\fP returns an error, \fBncabort(\|)\fP will automatically be called to restore the file to the consistent state before define mode was last entered.) After an open netCDF file is closed, its netCDF ID will be reassigned to the next netCDF file that is opened or created. If an error occurs, this function returns -1. .HP \fBint ncinquire(int \fIncid\fB, int* \fIndims\fB, int* \fInvars\fB, int* \fInatts\fB, int* \fIrecdim)\fR .sp Returns information about an open netCDF file. Upon successful return, \fIndims\fP will contain the number of dimensions defined for this netCDF file, \fInvars\fP will contain the number of variables, \fInatts\fP will contain the number of attributes, and \fIrecdim\fP will contain the ID of the unlimited dimension if one exists, or -1 otherwise. If any of the return parameters is a \fBNULL\fP pointer, then the corresponding information will not be returned; hence, no space need be allocated for it. If an error occurs, this function returns -1. .HP \fBint ncsync(int \fIncid\fB)\fR .sp Updates a writable netCDF file. The netCDF file must be in data mode. A netCDF file in define mode is synchronized to disk only when \fBncendef(\|)\fP is called. It can be expensive in computer resources to always synchronize to disk after every write of variable data or change of an attribute value. There are two reasons you might want to synchronize after writes: 1) to minimize data loss in case of abnormal termination; and 2) to make data available to other processes for reading immediately after it is written. Data is automatically synchronized to disk when a netCDF file is closed, or whenever you leave define mode. If an error occurs, this function returns -1. .HP \fBint ncabort(int \fIncid\fB)\fR .sp Closes or deletes a netCDF file. If the netCDF file isn't in define mode, then the file is closed. If the file is being created and is still in define mode, the file is deleted. If define mode was entered by a call to \fBncredef(\|)\fP, the netCDF file is restored to its state before definition mode was entered and the file is closed. The main reason for calling \fBncabort(\|)\fP is to restore the netCDF to a known consistent state in case anything goes wrong during the definition of new dimensions, variables, or attributes. This function is called automatically if \fBncclose(\|)\fP is called from define mode and the call to leave define mode before closing fails. If an error occurs, this function returns -1. .HP \fBint ncdimdef(int \fIncid\fB, const char* \fIname\fB, long \fIlength\fB)\fR .sp Adds a new dimension to an open netCDF file, which must be in define mode. \fIname\fP is the dimension name. If an error occurs, this function returns -1. .HP \fBint ncdimid(int \fIncid\fB, const char* \fIname\fB)\fR .sp Returns the ID of a netCDF dimension, given the name of the dimension. If an error occurs, this function returns -1. .HP \fBint ncdiminq(int \fIncid\fB, int \fIdimid\fB, char* \fIname\fB, long*\ \fIsize\fB)\fR .sp Returns the name and size of a dimension, given its ID. If either the \fIname\fP parameter or \fIsize\fP parameter is a \fBNULL\fP pointer, the associated information will not be returned, so no space needs to be allocated. For the unlimited dimension, the returned size is the current maximum value used for writing any record variables, (i.e. the maximum record number). If an error occurs, this function returns -1. .HP \fBint ncdimrename(int \fIncid\fB, int \fIdimid\fB, const char* \fIname\fB)\fR .sp Renames an existing dimension in an open netCDF file. If the new name is longer than the old name, the netCDF must be in define mode. You cannot rename a dimension to have the same name as another dimension. If an error occurs, this function returns -1. .HP \fBint ncvardef(int \fIncid\fB, const char* \fIname\fB, nc_type \fIdatatype\fB, int \fIndims\fB, const int \fIdimids[]\fB)\fR .sp Adds a new variable to an open netCDF file in define mode. It returns a netCDF variable ID. If an error occurs, this function returns -1. .HP \fBint ncvarid(int \fIncid\fB, const char* \fIname\fB)\fR .sp Returns the ID of a netCDF variable, given its name. If an error occurs, this function returns -1. .HP \fBint ncvarinq(int \fIncid\fB, int \fIvarid\fB, char* \fIname\fB, nc_type* \fIdatatype\fB, int* \fIndims\fB, int \fIdimids[]\fB, int* \fInatts)\fR .sp Returns information about a netCDF variable, given its ID. If any of the return parameters (\fIname\fP, \fIdatatype\fP, \fIndims\fI, \fIdimids\fI, or \fInatts\fP) is a \fBNULL\fP pointer, then the corresponding information will not be returned; hence, no space need be allocated for it. If an error occurs, this function returns -1. .HP \fBint ncvarput1(int \fIncid\fB, int \fIvarid\fB, const long \fIcoords[]\fB, const void* \fIvalue\fB)\fR .sp Puts a single data value into a variable of an open netCDF file that is in data mode. If an error occurs, this function returns -1. .HP \fBint ncvarget1(int \fIncid\fB, int \fIvarid\fB, const long \fIcoords[]\fB, void* \fIvalue\fB)\fR .sp Gets a single data value from a variable of an open netCDF file that is in data mode. If an error occurs, this function returns -1. .HP \fBint ncvarput(int \fIncid\fB, int \fIvarid\fB, const long \fIstart[]\fB, const long \fIcount[]\fB, const void* \fIvalue\fB)\fR .sp Writes a hyperslab of values into a netCDF variable of an open netCDF file, which must be in data mode. If an error occurs, this function returns -1. .HP \fBint ncvarget(int \fIncid\fB, int \fIvarid\fB, const long \fIstart[]\fB, const long \fIcount[]\fB, void* \fIvalue\fB)\fR .sp Reads a hyperslab of values from a netCDF variable of an open netCDF file, which must be in data mode. If an error occurs, this function returns -1. .HP \fBint ncvarputg(int \fIncid\fB, int \fIvarid\fB, const long \fIstart[]\fB, const long \fIcount[]\fB, const long \fIstride[]\fB, const long \fIimap[]\fB, const void* \fIvalue\fB)\fR .sp Writes a general hyperslab of values into a netCDF variable of an open netCDF file, which must be in data mode. The locations of the memory-resident data values may be arbitrary, though they are constrained to have a regular structure. In addition, the values of the netCDF variable may be accessed using non-unity strides. If an error occurs, this function returns -1. .HP \fBint ncvargetg(int \fIncid\fB, int \fIvarid\fB, const long \fIstart[]\fB, const long \fIcount[]\fB, const long \fIstride[]\fB, const long \fIimap[]\fB, void* \fIvalue\fB)\fR .sp Reads a general hyperslab of values from a netCDF variable of an open netCDF file, which must be in data mode. The locations of the memory-resident data values may be arbitrary, though they are constrained to have a regular structure. In addition, the values of the netCDF variable may be accessed using non-unity strides. If an error occurs, this function returns -1. .HP \fBint ncrecput(int\ \fIncid\fP, long\ \fIrecnum\fP, const void*\ \fIvaluep[]\fP)\fR .sp Writes a record (or a subset of a record) of values into the record variables of an open netCDF file, which must be in data mode. The record number, \fIrecnum\fP, must be a nonnegative number that specifies which record (which value of the unlimited or record dimension) to write. The array of pointers to blocks of data to be written, \fIvaluep\fP, should have one pointer for each record variable. The pointer to the data to be written to the \fIn\fP-th record variable, \fIvaluep[n]\fP, points to one record's worth of data of the appropriate type to be written into the \fIrecnum\fP-th record of that netCDF variable. If the pointer for any record variable is the \fBNULL\fP pointer, no data is written for that variable. Hence any subset of record variables may be written by specifying non-\fBNULL\fP pointers for the desired record variables. Invoking this function is equivalent to a sequence of invocations of ncvarput() for all record variables for which a non-\fBNULL\fP pointer is specified. If an error occurs, this function returns -1. .HP \fBint ncrecget(int\ \fIncid\fP, long\ \fIrecnum\fP, void*\ \fIvaluep[]\fP)\fR .sp Reads a record (or a subset of a record) of values from the record variables of an open netCDF file, which must be in data mode. The record number, \fIrecnum\fP, must be a nonnegative number that specifies which record to read. The array of pointers to blocks of data to be read, \fIvaluep\fP, should have one pointer for each record variable. The pointer to the data to be read for the \fIn\fP-th record variable, \fIvaluep[n]\fP, shall point to enough space to hold one record's worth of data of the appropriate type for that netCDF record variable. If the pointer for any record variable is the \fBNULL\fP pointer, no data is read from that variable. Hence any subset of record variables may be read by specifying non-\fBNULL\fP pointers for only the desired record variables. Invoking this function is equivalent to a sequence of invocations of ncvarget() for all record variables for which a non-\fBNULL\fP pointer is specified. If an error occurs, this function returns -1. .HP \fBint ncrecinq(int \fIncid\fP, int*\ \fInrvars\fP, int\ \fIrvarids[]\fP, long\ \fIrsizes[]\fP)\fR .sp Returns information about the record variables (variables that use the unlimited dimension) of an open netCDF file. Upon successful return, \fInrvars\fP will contain the number of record variables, \fIrvarids\fP will contain the variable IDs of those record variables, and \fIrsizes\fP will contain the size in bytes for a record's worth of data for each record variable. If any of the return parameters (\fInrvars\fP, \fIrvarids\fP, or \fIrsizes\fP) is a \fBNULL\fP pointer, the specified information will not be returned; hence no space needs to be allocated for it. If an error occurs, this function returns -1. .HP \fBint ncvarrename(int \fIncid\fB, int \fIvarid\fB, const char* \fIname\fB)\fR .sp Changes the name of a netCDF variable in an open netCDF. If the new name is longer than the old name, the netCDF must be in define mode. You cannot rename a variable to have the name of any existing variable. If an error occurs, this function returns -1. .HP \fBint ncattput(int \fIncid\fB, int \fIvarid\fB, const char* \fIname\fB, nc_type \fIdatatype\fB, int \fIlen\fB, const void* \fIvalue\fB)\fR .sp Adds or changes a variable attribute or global attribute of an open netCDF file. If this attribute is new, or if the space required to store the attribute is greater than before, the netCDF file must be in define mode. If an error occurs, this function returns -1. .HP \fBint ncattinq(int \fIncid\fB, int \fIvarid\fB, const char* \fIname\fB, nc_type* \fIdatatype\fB, int* \fIlen\fB)\fR .sp Returns information about a netCDF attribute, given its variable ID and name. The information returned is the type and length of the attribute. If either of the return parameters is a \fBNULL\fP pointer, the specified information will not be returned; hence no space needs to be allocated for it. If an error occurs, this function returns -1. .HP \fBint ncattget(int \fIncid\fB, int \fIvarid\fB, const char* \fIname\fB, void* \fIvalue\fB)\fR .sp Gets the value(s) of a netCDF attribute, given its variable ID and name. All elements of the vector of attribute values are returned, so you must allocate enough space to hold them. If you don't know how much space to reserve, call \fBncattinq(\|)\fP first to find out the length of the attribute. If an error occurs, this function returns -1. .HP \fBint ncattcopy(int \fIinncid\fB, int \fIinvar\fB, const char* \fIname\fB, int \fIoutncid\fB, int \fIoutvar\fB)\fR .sp Copies an attribute from one open netCDF file to another. It can also be used to copy an attribute from one variable to another within the same netCDF. \fIinncid\fP is the netCDF ID of an input netCDF file from which the attribute will be copied. \fIinvar\fP is the ID of the variable in the input netCDF file from which the attribute will be copied, or \fBNC_GLOBAL\fP for a global attribute. \fIname\fP is the name of the attribute in the input netCDF file to be copied. \fIoutncid\fP is the netCDF ID of the output netCDF file to which the attribute will be copied. It is permissible for the input and output netCDF IDs to be the same. The output netCDF file should be in define mode if the attribute to be copied does not already exist for the target variable, or if it would cause an existing target attribute to grow. \fIoutvar\fP is the ID of the variable in the output netCDF file to which the attribute will be copied, or \fBNC_GLOBAL\fP to copy to a global attribute. If an error occurs, this function returns -1. .HP \fBint ncattname(int \fIncid\fB, int \fIvarid\fB, int \fIattnum\fB, char* \fIname\fB)\fR .sp Gets the name of an attribute, given its variable ID and number as an attribute of that variable. This function is useful in generic applications that need to get the names of all the attributes associated with a variable, since attributes are accessed by name rather than number in all other attribute functions. The number of an attribute is more volatile than the name, since it can change when other attributes of the same variable are deleted. This is why an attribute number is not called an attribute ID. \fIattnum\fP is the number of the attribute. The attributes for each variable are numbered from 0 (the first attribute) to \fInvatts\fP-1, where \fInvatts\fP is the number of attributes for the variable, as returned from a call to \fBncvarinq(\|)\fP. If the \fIname\fP parameter is a \fBNULL\fP pointer, no name will be returned and no space need be allocated. If an error occurs, this function returns -1. .HP \fBint ncattrename(int \fIncid\fB, int \fIvarid\fB, const char* \fIname\fB, const char* \fInewname\fB)\fR .sp Changes the name of an attribute. If the new name is longer than the original name, the netCDF must be in define mode. You cannot rename an attribute to have the same name as another attribute of the same variable. \fIname\fP is the original attribute name. \fInewname\fP is the new name to be assigned to the specified attribute. If the new name is longer than the old name, the netCDF file must be in define mode. If an error occurs, this function returns -1. .HP \fBint ncattdel(int \fIncid\fB, int \fIvarid\fB, const char* \fIname\fB)\fR .sp Deletes a netCDF attribute from an open netCDF file. The netCDF file must be in define mode. If an error occurs, this function returns -1. .HP \fBint nctypelen(nc_type \fIdatatype\fB)\fR .sp Returns the number of bytes in a netCDF data type. If an error occurs, this function returns -1. .SH "COMMON ARGUMENT DESCRIPTIONS" .TP 4 .BI "char* " name is the name of a dimension, variable, or attribute. It shall begin with an alphabetic character, followed by zero or more alphanumeric characters including the underscore (`_'). Case is significant. As an input argument, it shall be a pointer to a 0-terminated string; as an output argument, it shall be the address of a buffer in which to hold such a string. The maximum allowable number of characters (excluding the terminating 0) is MAX_NC_NAME. Attribute names that begin with an underscore (`_') are reserved for use by the netCDF interface. .TP .BI "char* " path is the pathname of a netCDF file. It may be absolute or relative. .TP .BI "int " ncid is the netCDF ID returned from a previous, successful call to \fBncopen(\|)\fP or \fBnccreate(\|)\fP. .TP .BI "int " dimids [] is a vector of dimension ID's and defines the shape of a netCDF variable. The size of the vector shall be greater than or equal to the rank (i.e. the number of dimensions) of the variable (\fIndims\fP). The vector shall be ordered by the speed with which a dimension varies: \fIdimids\fP[\fIndims\fP-1] shall be the dimension ID of the most rapidly varying dimension and \fIdimids\fP[0] shall be the dimension ID of the most slowly varying dimension. Consequently, if a variable is a record variable, then \fIdimids\fP[0] shall be the dimension ID of the record dimension. The maximum possible number of dimensions for a variable is given by the symbolic constant \fBMAX_VAR_DIMS\fP. .TP .BI "int " dimid is the ID of a netCDF dimension. netCDF dimension ID's are allocated sequentially from the non-negative integers beginning with 0. .TP .BI "int " len is the number of values associated with an attribute. If the attribute is of type \fBNC_CHAR\fP, then this is one more than the string length (since the terminating 0 is stored). .TP .BI "int " ndims is either the total number of dimensions in a netCDF dataset or the rank (i.e. the number of dimensions) of a netCDF variable. The value shall not be negative or greater than the symbolic constant \fBMAX_VAR_DIMS\fP. .TP .BI "int " varid is the ID of a netCDF variable or (for the attribute-access functions) the symbolic constant \fBNC_GLOBAL\fP, which is used to reference global attributes. netCDF variable ID's are allocated sequentially from the non-negative integers beginning with 0. .TP .BI "int " natts is the number of global attributes in a netCDF dataset for the \fBncinquire(\|)\fP function or the number of attributes associated with a netCDF variable for the \fBncvarinq(\|)\fP function. .TP .BI "long " imap [] is the index mapping vector that specifies how data values associated with a netCDF variable are arranged in memory. The offset, in bytes, from the memory location pointed to by the \fIvalue\fP argument to a particular datum is given by the inner (dot) product of the index mapping vector with the coordinates of the datum. For example, on a machine where `\fBsizeof(float) == 4\fP', the index mapping vector for the array `\fBfloat u[3][5];\fP' is `\fBlong imap[2] = {20,4}\fP'. Note that the index mapping vector can be used to access memory-resident data values in a manner that differs radically from the nominal structure of the associated netCDF variable. For example, the following definitions .sp .RS +8 .nf struct vel { int flags; float u; float v; } vel[NX][NY]; long imap[2] = { sizeof(struct vel), sizeof(struct vel)*NY}; .fi .RE .sp .TP \& can be used to access the memory-resident values of the netCDF variable, `\fBu[NY][NX]\fP', even though the dimensions are transposed and the data is contained in a 2-D array of structures rather than a 2-D array of floating-point values. The index mapping vector may contain negative values if the \fIvalue\fP argument is appropriately set. A \fBNULL\fP index mapping vector argument obtains the default behavior in which the memory-resident values are assumed to have the same structure as the associated netCDF variable. .TP .BI "long " coords [] specifies the indicial coordinates of the netCDF data value to be accessed. The indices are relative to 0; thus, for example, the first data value of a two-dimensional variable is \fB(0,0)\fP. The size of the vector shall be at least the rank of the associated netCDF variable and its elements shall correspond, in order, to the variable's dimensions. Consequently, if the variable is a record variable, then the first index is the record number. .TP .BI "long " count [] specifies the number of data values to be accessed in terms of the lengths of the sides of the hyperslab. Thus, to access a single value, for example, specify \fIcount\fP as \fB(1, 1, ..., 1)\fP. Note that, for generalized hyperslab I/O, this argument must be adjusted to be compatible with the \fIstride\fP and \fIstart\fP arguments so that the interaction of the three does not attempt to access an invalid data co-ordinate. For example, to access every \fIstride\fB(\fIi\fB)\fR'th datum along dimension \fIi\fP beginning with point \fIstart\fB(\fIi\fB), \fIcounts\fB(\fIi\fB)\fR should be \fB1+(\fInpts\fB(\fIi\fB)-1-\fIstart\fB(\fIi\fB))/\fIstride\fB(\fIi\fB)\fR: where \fInpts\fB(\fIi\fB)\fR is the size of dimension \fIi\fR. The size of the \fIcount\fP vector shall be at least the rank of the associated netCDF variable and its elements shall correspond, in order, to the variable's dimensions. Consequently, if the variable is a record variable, then the first element of \fIcount\fP is the number of records to access. .TP .BI "long " length is the size of a netCDF dimension. As an input argument, it shall be a positive integer or the symbolic constant \fBNC_UNLIMITED\fP. At most one such unlimited size dimension, called the record dimension, shall be defined in a netCDF dataset. As an output argument, it shall be a positive integer. .TP .BI "long " start [] specifies the starting point for accessing a netCDF variable's data values in terms of the indicial coordinates of the corner of the hyperslab. The indices are relative to 0; thus, the first data value of a variable is \fB(0, 0, ..., 0)\fP. The size of the vector shall be at least the rank of the associated netCDF variable and its elements shall correspond, in order, to the variable's dimensions. Consequently, if the variable is a record variable, then the first index is the starting record number for accessing the netCDF variable's data values. .TP .BI "long " stride [] specifies, for each dimension, the interval between the accessed values of a netCDF variable. The size of the vector shall be at least the rank of the associated netCDF variable and its elements shall correspond, in order, to the variable's dimensions. A value of 1 accesses adjacent values of the netCDF variable in the corresponding dimension; a value of 2 accesses every other value of the netCDF variable in the corresponding dimension; and so on. Attempting to access a data value that lies outside the defined data space of a variable is an error. A \fBNULL\fP stride argument obtains the default behavior in which adjacent values are accessed along each dimension. .TP .BI "nc_type " datatype specifies the data type of a netCDF variable and is one of the following: \fBNC_BYTE\fP, \fBNC_CHAR\fP, \fBNC_SHORT\fP, \fBNC_LONG\fP, \fBNC_FLOAT\fP, or \fBNC_DOUBLE\fP. .TP .BI "void* " value points to the start of the memory-resident data values to be accessed. The pointer is declared to be of type \fBvoid*\fP because it can point to data of any of the basic netCDF types. The data should be of the appropriate type for the netCDF variable: .sp .RS +8 .TS tab(|); c c l l. \fBnetCDF Type|C Type\fP NC_BYTE|unsigned char NC_CHAR|char NC_SHORT|short NC_LONG|\fBnclong\fP NC_FLOAT|float NC_DOUBLE|double .TE .RE .IP NOTE: The C type corresponding to the netCDF type \fBNC_LONG\fP is \fBnclong\fP. This type is defined in the netCDF header file and is guaranteed to hold at least 32 bits. It is defined as either a C `\fBint\fP' or a C `\fBlong\fP' -- depending on the platform. .IP \fBWarning: neither the compiler nor the netCDF software can detect if the wrong type of data is used.\fP .SH "VARIABLE PREFILLING" .LP By default, the netCDF interface sets the values of all newly-defined variables of finite length (i.e. not having an unlimited, record dimension) to the type-dependent fill-value associated with each variable. This is done when `\fBncendef()\fP' is called. The fill-value for a variable may be changed from the default value by defining the attribute `\fB_FillValue\fP' for the variable. This attribute must have the same type as the variable and be of length one. .LP Variables with an unlimited record dimension are also prefilled, but on an `as needed' basis. For example, if the first write of a record variable is to position 5, then positions 0 through 4 (and no others) would be set to the fill-value at the same time. .LP This default prefilling of data values may be disabled by calling the function \fBncsetfill(\|)\fP with the argument \fBNC_NOFILL\fP. Note that, for non-record variables, this call must be made before \fBncendef()\fP; whereas, for record-variables, this call may be made at any time. .LP One can obtain increased performance of the netCDF interface by using this feature, but only at the expense of requiring the application to set every single data value. .SH "GLOBAL OPTIONS" .LP The global variable `\fBncopts\fP', which is defined in `\fBnetcdf.h\fP', affects the actions of the netCDF interface. It may be set by the user to the bitwise OR of any of the following, non-zero, symbolic bit-values: .TP 14 .B NC_VERBOSE Print error-messages on standard error. .TP .B NC_FATAL Abort. Call `\fBexit()\fP' with an error-condition if an error occurs. .LP By default, `\fBncopts\fP' is `\fBNC_VERBOSE | NC_FATAL\fP'. .SH "ENVIRONMENT VARIABLES" .TP 4 .B NETCDF_FFIOSPEC Specifies the Flexible File I/O buffers for netCDF I/O when executing under the UNICOS operating system (the variable is ignored on other operating systems). An appropriate specification can greatly increase the efficiency of netCDF I/O -- to the extent that it can actually surpass FORTRAN binary I/O. The default specification is \fBbufa:336:2\fP. See UNICOS Flexible File I/O for more information. .SH "MAILING-LISTS" .LP Both a mailing list and a digest are available for discussion of the netCDF interface and announcements about netCDF bugs, fixes, and enhancements. To begin or change your subscription to either the mailing-list or the digest, send one of the following in the body (not the subject line) of an email message to "Majordomo@unidata.ucar.edu". Use your email address in place of \fIjdoe@host.inst.domain\fP. .sp To subscribe to the netCDF mailing list: .RS \fBsubscribe netcdfgroup \fIjdoe@host.inst.domain\fR .RE To unsubscribe from the netCDF mailing list: .RS \fBunsubscribe netcdfgroup \fIjdoe@host.inst.domain\fR .RE To subscribe to the netCDF digest: .RS \fBsubscribe netcdfdigest \fIjdoe@host.inst.domain\fR .RE To unsubscribe from the netCDF digest: .RS \fBunsubscribe netcdfdigest \fIjdoe@host.inst.domain\fR .RE To retrieve the general introductory information for the mailing list: .RS \fBinfo netcdfgroup\fR .RE To get a synopsis of other majordomo commands: .RS \fBhelp\fR .RE .SH "SEE ALSO" .BR ncdump (1), .BR ncgen (1), .BR netcdf (3f). .LP \fInetCDF User's Guide\fP, published by the Unidata Program Center, University Corporation for Atmospheric Research, located in Boulder, Colorado.