Loading...
Searching...
No Matches
Variables

Variables hold multi-dimensional arrays of data. More...

## Functions

size_t | NC_atomictypelen (nc_type xtype)
char * | NC_atomictypename (nc_type xtype)
int | NC_check_nulls (int ncid, int varid, const size_t *start, size_t **count, ptrdiff_t **stride)
int | nc_def_var_blosc (int ncid, int varid, unsigned subcompressor, unsigned level, unsigned blocksize, unsigned addshuffle)
| Turn on blosc for a variable.
int | nc_def_var_bzip2 (int ncid, int varid, int level)
| Turn on bzip2 compression for a variable.
int | nc_def_var_zstandard (int ncid, int varid, int level)
| Turn on Zstandard compression for a variable.
int | NC_getshape (int ncid, int varid, int ndims, size_t *shape)
int | NC_inq_recvar (int ncid, int varid, int *nrecdimsp, int *is_recdim)
int | nc_inq_var_blosc (int ncid, int varid, int *hasfilterp, unsigned *subcompressorp, unsigned *levelp, unsigned *blocksizep, unsigned *addshufflep)
| Learn whether Blosc compression is on for a variable, and, if so, the settings.
int | nc_inq_var_bzip2 (int ncid, int varid, int *hasfilterp, int *levelp)
| Learn whether bzip2 compression is on for a variable, and, if so, the level setting.
EXTERNL int | nc_inq_var_filter (int ncid, int varid, unsigned int *idp, size_t *nparamsp, unsigned int *params)
| Find the first filter (if any) associated with a variable.
EXTERNL int | nc_inq_var_filter_ids (int ncid, int varid, size_t *nfiltersp, unsigned int *ids)
| Find the set of filters (if any) associated with a variable.
EXTERNL int | nc_inq_var_filter_info (int ncid, int varid, unsigned int id, size_t *nparamsp, unsigned int *params)
| Find the param info about filter (if any) associated with a variable and with specified id.
int | nc_inq_var_zstandard (int ncid, int varid, int *hasfilterp, int *levelp)
| Learn whether Zstandard compression is on for a variable, and, if so, the level setting.
int | NC_is_recvar (int ncid, int varid, size_t *nrecs)
int | nctypelen (nc_type type)

## Defining Variables

Use these functions to define variables.
int | nc_def_var (int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp)
| Define a new variable.
int | nc_def_var_fill (int ncid, int varid, int no_fill, const void *fill_value)
| Set the fill value for a variable.
int | nc_def_var_deflate (int ncid, int varid, int shuffle, int deflate, int deflate_level)
| Set the zlib compression and shuffle settings for a variable in an netCDF/HDF5 file.
int | nc_def_var_quantize (int ncid, int varid, int quantize_mode, int nsd)
| Turn on quantization for a variable.
int | nc_def_var_fletcher32 (int ncid, int varid, int fletcher32)
| Set checksum for a var.
int | nc_def_var_chunking (int ncid, int varid, int storage, const size_t *chunksizesp)
| Define storage and, if chunked storage is used, chunking parameters for a variable.
int | nc_def_var_endian (int ncid, int varid, int endian)
| Define endianness of a variable.
int | nc_def_var_szip (int ncid, int varid, int options_mask, int pixels_per_block)
| Set szip compression settings on a variable.

## Rename a Variable

Rename a variable.
int | nc_rename_var (int ncid, int varid, const char *name)
| Rename a variable.

## Free String Resources

Use these functions to free resources associated with NC_STRING data.
int | nc_free_string (size_t len, char **data)
| Free string space allocated by the library.

## Variables Chunk Caches

Use these functions to change the variable chunk cache settings.
int | nc_set_var_chunk_cache (int ncid, int varid, size_t size, size_t nelems, float preemption)
| Change the cache settings for a chunked variable.
int | nc_get_var_chunk_cache (int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp)
| Get the per-variable chunk cache settings from the HDF5 layer.

## Reading Data from Variables

Functions to read data from variables.
int | nc_get_vara (int ncid, int varid, const size_t *startp, const size_t *countp, void *ip)
| Read an array of values from a variable.
int | nc_get_vara_text (int ncid, int varid, const size_t *startp, const size_t *countp, char *ip)
| Read an array of values from a variable.
int | nc_get_vara_schar (int ncid, int varid, const size_t *startp, const size_t *countp, signed char *ip)
| Read an array of values from a variable.
int | nc_get_vara_uchar (int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip)
| Read an array of values from a variable.
int | nc_get_vara_short (int ncid, int varid, const size_t *startp, const size_t *countp, short *ip)
| Read an array of values from a variable.
int | nc_get_vara_int (int ncid, int varid, const size_t *startp, const size_t *countp, int *ip)
| Read an array of values from a variable.
int | nc_get_vara_long (int ncid, int varid, const size_t *startp, const size_t *countp, long *ip)
| Read an array of values from a variable.
int | nc_get_vara_float (int ncid, int varid, const size_t *startp, const size_t *countp, float *ip)
| Read an array of values from a variable.
int | nc_get_vara_double (int ncid, int varid, const size_t *startp, const size_t *countp, double *ip)
| Read an array of values from a variable.
int | nc_get_vara_ubyte (int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip)
| Read an array of values from a variable.
int | nc_get_vara_ushort (int ncid, int varid, const size_t *startp, const size_t *countp, unsigned short *ip)
| Read an array of values from a variable.
int | nc_get_vara_uint (int ncid, int varid, const size_t *startp, const size_t *countp, unsigned int *ip)
| Read an array of values from a variable.
int | nc_get_vara_longlong (int ncid, int varid, const size_t *startp, const size_t *countp, long long *ip)
| Read an array of values from a variable.
int | nc_get_vara_ulonglong (int ncid, int varid, const size_t *startp, const size_t *countp, unsigned long long *ip)
| Read an array of values from a variable.
int | nc_get_vara_string (int ncid, int varid, const size_t *startp, const size_t *countp, char **ip)
| Read an array of values from a variable.
int | nc_get_var1 (int ncid, int varid, const size_t *indexp, void *ip)
| Read a single datum from a variable.
int | nc_get_var1_text (int ncid, int varid, const size_t *indexp, char *ip)
| Read a single datum from a variable.
int | nc_get_var1_schar (int ncid, int varid, const size_t *indexp, signed char *ip)
| Read a single datum from a variable.
int | nc_get_var1_uchar (int ncid, int varid, const size_t *indexp, unsigned char *ip)
| Read a single datum from a variable.
int | nc_get_var1_short (int ncid, int varid, const size_t *indexp, short *ip)
| Read a single datum from a variable.
int | nc_get_var1_int (int ncid, int varid, const size_t *indexp, int *ip)
| Read a single datum from a variable.
int | nc_get_var1_long (int ncid, int varid, const size_t *indexp, long *ip)
| Read a single datum from a variable.
int | nc_get_var1_float (int ncid, int varid, const size_t *indexp, float *ip)
| Read a single datum from a variable.
int | nc_get_var1_double (int ncid, int varid, const size_t *indexp, double *ip)
| Read a single datum from a variable.
int | nc_get_var1_ubyte (int ncid, int varid, const size_t *indexp, unsigned char *ip)
| Read a single datum from a variable.
int | nc_get_var1_ushort (int ncid, int varid, const size_t *indexp, unsigned short *ip)
| Read a single datum from a variable.
int | nc_get_var1_uint (int ncid, int varid, const size_t *indexp, unsigned int *ip)
| Read a single datum from a variable.
int | nc_get_var1_longlong (int ncid, int varid, const size_t *indexp, long long *ip)
| Read a single datum from a variable.
int | nc_get_var1_ulonglong (int ncid, int varid, const size_t *indexp, unsigned long long *ip)
| Read a single datum from a variable.
int | nc_get_var1_string (int ncid, int varid, const size_t *indexp, char **ip)
| Read a single datum from a variable.
int | nc_get_var (int ncid, int varid, void *ip)
| Read an entire variable in one call.
int | nc_get_var_text (int ncid, int varid, char *ip)
| Read an entire variable in one call.
int | nc_get_var_schar (int ncid, int varid, signed char *ip)
| Read an entire variable in one call.
int | nc_get_var_uchar (int ncid, int varid, unsigned char *ip)
| Read an entire variable in one call.
int | nc_get_var_short (int ncid, int varid, short *ip)
| Read an entire variable in one call.
int | nc_get_var_int (int ncid, int varid, int *ip)
| Read an entire variable in one call.
int | nc_get_var_long (int ncid, int varid, long *ip)
| Read an entire variable in one call.
int | nc_get_var_float (int ncid, int varid, float *ip)
| Read an entire variable in one call.
int | nc_get_var_double (int ncid, int varid, double *ip)
| Read an entire variable in one call.
int | nc_get_var_ubyte (int ncid, int varid, unsigned char *ip)
| Read an entire variable in one call.
int | nc_get_var_ushort (int ncid, int varid, unsigned short *ip)
| Read an entire variable in one call.
int | nc_get_var_uint (int ncid, int varid, unsigned int *ip)
| Read an entire variable in one call.
int | nc_get_var_longlong (int ncid, int varid, long long *ip)
| Read an entire variable in one call.
int | nc_get_var_ulonglong (int ncid, int varid, unsigned long long *ip)
| Read an entire variable in one call.
int | nc_get_var_string (int ncid, int varid, char **ip)
| Read an entire variable in one call.
int | nc_get_vars (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, void *ip)
| Read a strided array from a variable.
int | nc_get_vars_text (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char *ip)
| Read a strided array from a variable.
int | nc_get_vars_schar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, signed char *ip)
| Read a strided array from a variable.
int | nc_get_vars_uchar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip)
| Read a strided array from a variable.
int | nc_get_vars_short (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, short *ip)
| Read a strided array from a variable.
int | nc_get_vars_int (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, int *ip)
| Read a strided array from a variable.
int | nc_get_vars_long (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long *ip)
| Read a strided array from a variable.
int | nc_get_vars_float (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, float *ip)
| Read a strided array from a variable.
int | nc_get_vars_double (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, double *ip)
| Read a strided array from a variable.
int | nc_get_vars_ubyte (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip)
| Read a strided array from a variable.
int | nc_get_vars_ushort (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned short *ip)
| Read a strided array from a variable.
int | nc_get_vars_uint (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned int *ip)
| Read a strided array from a variable.
int | nc_get_vars_longlong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long long *ip)
| Read a strided array from a variable.
int | nc_get_vars_ulonglong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned long long *ip)
| Read a strided array from a variable.
int | nc_get_vars_string (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char **ip)
| Read a strided array from a variable.
int | nc_get_varm (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, void *ip)
| Read a mapped array from a variable.
int | nc_get_varm_schar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, signed char *ip)
| Read a mapped array from a variable.
int | nc_get_varm_uchar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip)
| Read a mapped array from a variable.
int | nc_get_varm_short (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, short *ip)
| Read a mapped array from a variable.
int | nc_get_varm_int (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, int *ip)
| Read a mapped array from a variable.
int | nc_get_varm_long (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long *ip)
| Read a mapped array from a variable.
int | nc_get_varm_float (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, float *ip)
| Read a mapped array from a variable.
int | nc_get_varm_double (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, double *ip)
| Read a mapped array from a variable.
int | nc_get_varm_ubyte (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip)
| Read a mapped array from a variable.
int | nc_get_varm_ushort (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned short *ip)
| Read a mapped array from a variable.
int | nc_get_varm_uint (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned int *ip)
| Read a mapped array from a variable.
int | nc_get_varm_longlong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long long *ip)
| Read a mapped array from a variable.
int | nc_get_varm_ulonglong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned long long *ip)
| Read a mapped array from a variable.
int | nc_get_varm_text (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char *ip)
| Read a mapped array from a variable.
int | nc_get_varm_string (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char **ip)
| Read a mapped array from a variable.

## Learning about Variables

Functions to learn about the variables in a file.
int | nc_inq_varid (int ncid, const char *name, int *varidp)
| Find the ID of a variable, from the name.
int | nc_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
| Learn about a variable.
int | nc_inq_varname (int ncid, int varid, char *name)
| Learn the name of a variable.
int | nc_inq_vartype (int ncid, int varid, nc_type *typep)
| Learn the type of a variable.
int | nc_inq_varndims (int ncid, int varid, int *ndimsp)
| Learn how many dimensions are associated with a variable.
int | nc_inq_vardimid (int ncid, int varid, int *dimidsp)
| Learn the dimension IDs associated with a variable.
int | nc_inq_varnatts (int ncid, int varid, int *nattsp)
| Learn how many attributes are associated with a variable.
int | nc_inq_var_deflate (int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
| Learn the shuffle and deflate settings for a variable.
int | nc_inq_var_fletcher32 (int ncid, int varid, int *fletcher32p)
| Learn the checksum settings for a variable.
int | nc_inq_var_chunking (int ncid, int varid, int *storagep, size_t *chunksizesp)
| Get the storage and (for chunked variables) the chunksizes of a variable.
int | nc_inq_var_fill (int ncid, int varid, int *no_fill, void *fill_valuep)
| Learn the fill mode of a variable.
int | nc_inq_var_quantize (int ncid, int varid, int *quantize_modep, int *nsdp)
| Learn whether quantization is on for a variable, and, if so, the NSD setting.
int | nc_inq_var_endian (int ncid, int varid, int *endianp)
| Find the endianness of a variable.
int | nc_inq_var_szip (int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
| Learn the szip settings of a variable.
int | nc_inq_unlimdims (int ncid, int *nunlimdimsp, int *unlimdimidsp)
| Return number and list of unlimited dimensions.

## Writing Data to Variables

Functions to write data from variables.
int | nc_put_vara (int ncid, int varid, const size_t *startp, const size_t *countp, const void *op)
| Write an array of values to a variable.
int | nc_put_vara_text (int ncid, int varid, const size_t *startp, const size_t *countp, const char *op)
| Write an array of values to a variable.
int | nc_put_vara_schar (int ncid, int varid, const size_t *startp, const size_t *countp, const signed char *op)
| Write an array of values to a variable.
int | nc_put_vara_uchar (int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op)
| Write an array of values to a variable.
int | nc_put_vara_short (int ncid, int varid, const size_t *startp, const size_t *countp, const short *op)
| Write an array of values to a variable.
int | nc_put_vara_int (int ncid, int varid, const size_t *startp, const size_t *countp, const int *op)
| Write an array of values to a variable.
int | nc_put_vara_long (int ncid, int varid, const size_t *startp, const size_t *countp, const long *op)
| Write an array of values to a variable.
int | nc_put_vara_float (int ncid, int varid, const size_t *startp, const size_t *countp, const float *op)
| Write an array of values to a variable.
int | nc_put_vara_double (int ncid, int varid, const size_t *startp, const size_t *countp, const double *op)
| Write an array of values to a variable.
int | nc_put_vara_ubyte (int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op)
| Write an array of values to a variable.
int | nc_put_vara_ushort (int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned short *op)
| Write an array of values to a variable.
int | nc_put_vara_uint (int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned int *op)
| Write an array of values to a variable.
int | nc_put_vara_longlong (int ncid, int varid, const size_t *startp, const size_t *countp, const long long *op)
| Write an array of values to a variable.
int | nc_put_vara_ulonglong (int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned long long *op)
| Write an array of values to a variable.
int | nc_put_vara_string (int ncid, int varid, const size_t *startp, const size_t *countp, const char **op)
| Write an array of values to a variable.
int | nc_put_var1 (int ncid, int varid, const size_t *indexp, const void *op)
| Write one datum.
int | nc_put_var1_text (int ncid, int varid, const size_t *indexp, const char *op)
| Write one datum.
int | nc_put_var1_schar (int ncid, int varid, const size_t *indexp, const signed char *op)
| Write one datum.
int | nc_put_var1_uchar (int ncid, int varid, const size_t *indexp, const unsigned char *op)
| Write one datum.
int | nc_put_var1_short (int ncid, int varid, const size_t *indexp, const short *op)
| Write one datum.
int | nc_put_var1_int (int ncid, int varid, const size_t *indexp, const int *op)
| Write one datum.
int | nc_put_var1_long (int ncid, int varid, const size_t *indexp, const long *op)
| Write one datum.
int | nc_put_var1_float (int ncid, int varid, const size_t *indexp, const float *op)
| Write one datum.
int | nc_put_var1_double (int ncid, int varid, const size_t *indexp, const double *op)
| Write one datum.
int | nc_put_var1_ubyte (int ncid, int varid, const size_t *indexp, const unsigned char *op)
| Write one datum.
int | nc_put_var1_ushort (int ncid, int varid, const size_t *indexp, const unsigned short *op)
| Write one datum.
int | nc_put_var1_uint (int ncid, int varid, const size_t *indexp, const unsigned int *op)
| Write one datum.
int | nc_put_var1_longlong (int ncid, int varid, const size_t *indexp, const long long *op)
| Write one datum.
int | nc_put_var1_ulonglong (int ncid, int varid, const size_t *indexp, const unsigned long long *op)
| Write one datum.
int | nc_put_var1_string (int ncid, int varid, const size_t *indexp, const char **op)
| Write one datum.
int | nc_put_var (int ncid, int varid, const void *op)
| Write an entire variable with one call.
int | nc_put_var_text (int ncid, int varid, const char *op)
| Write an entire variable with one call.
int | nc_put_var_schar (int ncid, int varid, const signed char *op)
| Write an entire variable with one call.
int | nc_put_var_uchar (int ncid, int varid, const unsigned char *op)
| Write an entire variable with one call.
int | nc_put_var_short (int ncid, int varid, const short *op)
| Write an entire variable with one call.
int | nc_put_var_int (int ncid, int varid, const int *op)
| Write an entire variable with one call.
int | nc_put_var_long (int ncid, int varid, const long *op)
| Write an entire variable with one call.
int | nc_put_var_float (int ncid, int varid, const float *op)
| Write an entire variable with one call.
int | nc_put_var_double (int ncid, int varid, const double *op)
| Write an entire variable with one call.
int | nc_put_var_ubyte (int ncid, int varid, const unsigned char *op)
| Write an entire variable with one call.
int | nc_put_var_ushort (int ncid, int varid, const unsigned short *op)
| Write an entire variable with one call.
int | nc_put_var_uint (int ncid, int varid, const unsigned int *op)
| Write an entire variable with one call.
int | nc_put_var_longlong (int ncid, int varid, const long long *op)
| Write an entire variable with one call.
int | nc_put_var_ulonglong (int ncid, int varid, const unsigned long long *op)
| Write an entire variable with one call.
int | nc_put_var_string (int ncid, int varid, const char **op)
| Write an entire variable with one call.
int | nc_put_vars (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const void *op)
| Write a strided array of values to a variable.
int | nc_put_vars_text (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char *op)
| Write a strided array of values to a variable.
int | nc_put_vars_schar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const signed char *op)
| Write a strided array of values to a variable.
int | nc_put_vars_uchar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op)
| Write a strided array of values to a variable.
int | nc_put_vars_short (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const short *op)
| Write a strided array of values to a variable.
int | nc_put_vars_int (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const int *op)
| Write a strided array of values to a variable.
int | nc_put_vars_long (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long *op)
| Write a strided array of values to a variable.
int | nc_put_vars_float (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const float *op)
| Write a strided array of values to a variable.
int | nc_put_vars_double (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const double *op)
| Write a strided array of values to a variable.
int | nc_put_vars_ubyte (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op)
| Write a strided array of values to a variable.
int | nc_put_vars_ushort (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned short *op)
| Write a strided array of values to a variable.
int | nc_put_vars_uint (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned int *op)
| Write a strided array of values to a variable.
int | nc_put_vars_longlong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long long *op)
| Write a strided array of values to a variable.
int | nc_put_vars_ulonglong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned long long *op)
| Write a strided array of values to a variable.
int | nc_put_vars_string (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char **op)
| Write a strided array of values to a variable.
int | nc_put_varm (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const void *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_text (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_schar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const signed char *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_uchar (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_short (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const short *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_int (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const int *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_long (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_float (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const float *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_double (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const double *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_ubyte (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_ushort (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned short *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_uint (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned int *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_longlong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long long *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_ulonglong (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned long long *op)
| Write a mapped array of values to a variable.
int | nc_put_varm_string (int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char **op)
| Write a mapped array of values to a variable.

## Detailed Description

Variables hold multi-dimensional arrays of data.

Variables for a netCDF dataset are defined when the dataset is created, while the netCDF dataset is in define mode. Other variables may be added later by reentering define mode. A netCDF variable has a name, a type, and a shape, which are specified when it is defined. A variable may also have values, which are established later in data mode.

Ordinarily, the name, type, and shape are fixed when the variable is first defined. The name may be changed, but the type and shape of a variable cannot be changed. However, a variable defined in terms of the unlimited dimension can grow without bound in that dimension.

A netCDF variable in an open netCDF dataset is referred to by a small integer called a variable ID.

Variable IDs reflect the order in which variables were defined within a netCDF dataset. Variable IDs are 0, 1, 2,..., in the order in which the variables were defined. A function is available for getting the variable ID from the variable name and vice-versa.

Attributes may be associated with a variable to specify such properties as units.

Operations supported on variables are:

- Create a variable, given its name, data type, and shape.
- Get a variable ID from its name.
- Get a variable's name, data type, shape, and number of attributes from its ID.
- Put a data value into a variable, given variable ID, indices, and value.
- Put an array of values into a variable, given variable ID, corner indices, edge lengths, and a block of values.
- Put a subsampled or mapped array-section of values into a variable, given variable ID, corner indices, edge lengths, stride vector, index mapping vector, and a block of values.
- Get a data value from a variable, given variable ID and indices.
- Get an array of values from a variable, given variable ID, corner indices, and edge lengths.
- Get a subsampled or mapped array-section of values from a variable, given variable ID, corner indices, edge lengths, stride vector, and index mapping vector.
- Rename a variable.

# Data Types

NetCDF supported six atomic data types through version 3.6.0 (char, byte, short, int, float, and double). Starting with version 4.0, many new atomic and user defined data types are supported (unsigned int types, strings, compound types, variable length arrays, enums, opaque).

The additional data types are only supported in netCDF-4/HDF5 files. To create netCDF-4/HDF5 files, use the NC_NETCDF4 flag in nc_create().

# NetCDF-3 Classic and 64-Bit Offset Data Types

NetCDF-3 classic and 64-bit offset files support 6 atomic data types, and none of the user defined datatype introduced in NetCDF-4.

The following table gives the netCDF-3 external data types and the corresponding type constants for defining variables in the C interface:

Type | C define | Bits
byte | NC_BYTE | 8
char | NC_CHAR | 8
short | NC_SHORT | 16
int | NC_INT | 32
float | NC_FLOAT | 32
double | NC_DOUBLE | 64

The first column gives the netCDF external data type, which is the same as the CDL data type. The next column gives the corresponding C pre-processor macro for use in netCDF functions (the pre-processor macros are defined in the netCDF C header-file netcdf.h). The last column gives the number of bits used in the external representation of values of the corresponding type.

# NetCDF-4 Atomic Data Types

NetCDF-4 files support all of the atomic data types from netCDF-3, plus additional unsigned integer types, 64-bit integer types, and a string type.

Type | C define | Bits
byte | NC_BYTE | 8
unsigned byte | NC_UBYTE^ | 8
char | NC_CHAR | 8
short | NC_SHORT | 16
unsigned short | NC_USHORT^ | 16
int | NC_INT | 32
unsigned int | NC_UINT^ | 32
unsigned long long | NC_UINT64^ | 64
long long | NC_INT64^ | 64
float | NC_FLOAT | 32
double | NC_DOUBLE | 64
char ** | NC_STRING^ | string length + 1

^This type was introduced in netCDF-4, and is not supported in netCDF classic or 64-bit offset format files, or in netCDF-4 files if they are created with the NC_CLASSIC_MODEL flags.

## Function Documentation

## NC_atomictypelen()

size_t NC_atomictypelen | ( | nc_type | xtype | ) |

Definition at line 1137 of file dvar.c.

## NC_atomictypename()

char * NC_atomictypename | ( | nc_type | xtype | ) |

Definition at line 1170 of file dvar.c.

## NC_check_nulls()

int NC_check_nulls | ( | int | ncid,
|  | int | varid,
|  | const size_t * | start,
|  | size_t ** | count,
|  | ptrdiff_t ** | stride )

Definition at line 1255 of file dvar.c.

## nc_def_var()

int nc_def_var | ( | int | ncid,
|  | const char * | name,
|  | nc_type | xtype,
|  | int | ndims,
|  | const int * | dimidsp,
|  | int * | varidp )

Define a new variable.

This function adds a new variable to an open netCDF dataset or group. It returns (as an argument) a variable ID, given the netCDF ID, the variable name, the variable type, the number of dimensions, and a list of the dimension IDs.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  name | Variable NetCDF Names.
  xtype | (Data type)[https://docs.unidata.ucar.edu/nug/current/md_types.html#data_type] of the variable.
  ndims | Number of dimensions for the variable. For example, 2 specifies a matrix, 1 specifies a vector, and 0 means the variable is a scalar with no dimensions. Must not be negative or greater than the predefined constant NC_MAX_VAR_DIMS. In netCDF-4/HDF5 files, may not exceed the HDF5 maximum number of dimensions (32).
  dimidsp | Vector of ndims dimension IDs corresponding to the variable dimensions. For classic model netCDF files, if the ID of the unlimited dimension is included, it must be first. This argument is ignored if ndims is 0. For expanded model netCDF4/HDF5 files, there may be any number of unlimited dimensions, and they may be used in any element of the dimids array.
  varidp | Pointer to location for the returned variable ID.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTINDEFINE Not in define mode.
  NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
  NC_EMAXVARS NC_MAX_VARS exceeded [Not enforced after 4.5.0]
  NC_EBADTYPE Bad type.
  NC_EINVAL Invalid input.
  NC_ENAMEINUSE Name already in use.
  NC_EPERM Attempt to create object in read-only file.

# Example

Here is an example using nc_def_var to create a variable named rh of type double with three dimensions, time, lat, and lon in a new netCDF dataset named foo.nc:

#include <netcdf.h>
...
int status;
int ncid;
int lat_dim, lon_dim, time_dim;
int rh_id;
int rh_dimids[3];
...
status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_def_dim(ncid, "lat", 5L, &lat_dim);
if (status != NC_NOERR) handle_error(status);
status = nc_def_dim(ncid, "lon", 10L, &lon_dim);
if (status != NC_NOERR) handle_error(status);
status = nc_def_dim(ncid, "time", NC_UNLIMITED, &time_dim);
if (status != NC_NOERR) handle_error(status);
...
rh_dimids[0] = time_dim;
rh_dimids[1] = lat_dim;
rh_dimids[2] = lon_dim;
status = nc_def_var (ncid, "rh", NC_DOUBLE, 3, rh_dimids, &rh_id);
if (status != NC_NOERR) handle_error(status);
nc_create
EXTERNL int nc_create(const char *path, int cmode, int *ncidp)
Create a new netCDF file.
Definition dfile.c:428
nc_def_dim
EXTERNL int nc_def_dim(int ncid, const char *name, size_t len, int *idp)
Define a new dimension.
Definition ddim.c:121
nc_def_var
EXTERNL int nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp)
Define a new variable.
Definition dvar.c:216
netcdf.h
Main header file for the C API.
NC_UNLIMITED
#define NC_UNLIMITED
Size argument to nc_def_dim() for an unlimited dimension.
Definition netcdf.h:300
NC_DOUBLE
#define NC_DOUBLE
double precision floating point number
Definition netcdf.h:41
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:417
NC_NOCLOBBER
#define NC_NOCLOBBER
Don't destroy existing file.
Definition netcdf.h:139

Author
  Glenn Davis, Ed Hartnett, Dennis Heimbigner

Definition at line 216 of file dvar.c.

## nc_def_var_blosc()

int nc_def_var_blosc | ( | int | ncid,
|  | int | varid,
|  | unsigned | subcompressor,
|  | unsigned | level,
|  | unsigned | blocksize,
|  | unsigned | addshuffle )

Turn on blosc for a variable.

Parameters

  ncid | File ID.
  varid | Variable ID.
  subcompressor | The subcompressor.
  level | The level setting.
  blocksize | The block size.
  addshuffle | If non-zero, turn on shuffle.

Returns
  0 for success, error code otherwise.

Since
  4.9.0

Author
  Dennis Heimbigner

Definition at line 393 of file dfilter.c.

## nc_def_var_bzip2()

int nc_def_var_bzip2 | ( | int | ncid,
|  | int | varid,
|  | int | level )

Turn on bzip2 compression for a variable.

Parameters

  ncid | File ID.
  varid | Variable ID.
  level | From 1 to 9. Set the block size to 100k, 200k ... 900k when compressing. (bzip2 default level is 9).

Returns
  0 for success, error code otherwise.

Since
  4.9.0

Author
  Dennis Heimbigner, Ed Hartnett

Definition at line 241 of file dfilter.c.

## nc_def_var_chunking()

int nc_def_var_chunking | ( | int | ncid,
|  | int | varid,
|  | int | storage,
|  | const size_t * | chunksizesp )

Define storage and, if chunked storage is used, chunking parameters for a variable.

The storage may be set to NC_CONTIGUOUS, NC_COMPACT, or NC_CHUNKED.

Contiguous storage means the variable is stored as one block of data in the file. This is the default storage.

Compact storage means the variable is stored in the header record of the file. This can have large performance benefits on HPC system running many processors. Compact storage is only available for variables whose data are 64 KB or less. Attempting to turn on compact storage for a variable that is too large will result in the NC_EVARSIZE error.

Chunked storage means the data are stored as chunks, of user-configurable size. Chunked storage is required for variable with one or more unlimited dimensions, or variable which use compression, or any other filter.

The total size of a chunk must be less than 4 GiB. That is, the product of all chunksizes and the size of the data (or the size of nc_vlen_t for VLEN types) must be less than 4 GiB.

This function may only be called after the variable is defined, but before nc_enddef is called. Once the chunking parameters are set for a variable, they cannot be changed.

Note
  Scalar variables may have a storage of NC_CONTIGUOUS or NC_COMPACT. Attempts to set chunking on a scalar variable will cause NC_EINVAL to be returned. Only non-scalar variables can have chunking.

Parameters

  ncid | NetCDF ID, from a previous call to nc_open() or nc_create().
  varid | Variable ID.

  storage

  If NC_CONTIGUOUS or NC_COMPACT, then contiguous or compact storage is used for this variable. Variables with one or more unlimited dimensions cannot use contiguous or compact storage. If contiguous or compact storage is turned on, the chunksizes parameter is ignored. If NC_CHUNKED, then chunked storage is used for this variable. Chunk sizes may be specified with the chunksizes parameter or default sizes will be used if that parameter is NULL.

  chunksizesp | A pointer to an array list of chunk sizes. The array must have one chunksize for each dimension of the variable. If NC_CONTIGUOUS storage is set, then the chunksizes parameter is ignored. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ID.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_ELATEDEF This variable has already been the subject of a nc_enddef call. In netCDF-4 files nc_enddef will be called automatically for any data read or write. Once nc_enddef has been called after the nc_def_var call for a variable, it is impossible to set the chunking for that variable.
  NC_ENOTINDEFINE Not in define mode. This is returned for netCDF classic or 64-bit offset files, or for netCDF-4 files, when they were created with NC_CLASSIC_MODEL flag by nc_create().
  NC_EPERM Attempt to create object in read-only file.
  NC_EBADCHUNK Returns if the chunk size specified for a variable is larger than the length of the dimensions associated with variable.
  NC_EVARSIZE Compact storage attempted for variable bigger than 64 KB.
  NC_EINVAL Attempt to set contiguous or compact storage for var with one or more unlimited dimensions, or chunking for a scalar var.

# Example

In this example from libsrc4/tst_vars2.c, chunksizes are set with nc_var_def_chunking, and checked with nc_var_inq_chunking.

printf("**** testing chunking...");
{
#define NDIMS5 1
#define DIM5_NAME "D5"
#define VAR_NAME5 "V5"
#define DIM5_LEN 1000
int dimids[NDIMS5], dimids_in[NDIMS5];
int varid;
int ndims, nvars, natts, unlimdimid;
nc_type xtype_in;
char name_in[NC_MAX_NAME + 1];
int data[DIM5_LEN], data_in[DIM5_LEN];
size_t chunksize[NDIMS5] = {5};
size_t chunksize_in[NDIMS5];
int storage_in;
int i, d;
for (i = 0; i < DIM5_LEN; i++)
data[i] = i;
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
if (nc_def_dim(ncid, DIM5_NAME, DIM5_LEN, &dimids[0])) ERR;
if (nc_def_var(ncid, VAR_NAME5, NC_INT, NDIMS5, dimids, &varid)) ERR;
if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
if (nc_put_var_int(ncid, varid, data)) ERR;
if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
for (d = 0; d < NDIMS5; d++)
if (chunksize[d] != chunksize_in[d]) ERR;
if (storage_in != NC_CHUNKED) ERR;
nc_inq_var_chunking
EXTERNL int nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
Get the storage and (for chunked variables) the chunksizes of a variable.
Definition dvarinq.c:466
nc_def_var_chunking
EXTERNL int nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp)
Define storage and, if chunked storage is used, chunking parameters for a variable.
Definition dvar.c:732
NC_NETCDF4
#define NC_NETCDF4
Use netCDF-4/HDF5 format.
Definition netcdf.h:179
NC_INT
#define NC_INT
signed 4 byte integer
Definition netcdf.h:38
NC_CHUNKED
#define NC_CHUNKED
In HDF5 files you can set storage for each variable to be either contiguous or chunked,...
Definition netcdf.h:353
NC_MAX_NAME
#define NC_MAX_NAME
Maximum for classic library.
Definition netcdf.h:330
nc_type
int nc_type
The nc_type type is just an int.
Definition netcdf.h:25

Author
  Ed Hartnett, Dennis Heimbigner

Definition at line 732 of file dvar.c.

## nc_def_var_deflate()

int nc_def_var_deflate | ( | int | ncid,
|  | int | varid,
|  | int | shuffle,
|  | int | deflate,
|  | int | deflate_level )

Set the zlib compression and shuffle settings for a variable in an netCDF/HDF5 file.

This function must be called after nc_def_var and before nc_enddef or any functions which writes data to the file.

Deflation and shuffle are only available for HDF5 files. Attempting to set them on non-HDF5 files will return NC_ENOTNC4.

Deflation and shuffle require chunked data. If this function is called on a variable with contiguous data, then the data is changed to chunked data, with default chunksizes. Use nc_def_var_chunking() to tune performance with user-defined chunksizes.

If this function is called on a scalar variable, NC_EINVAL is returned. Only chunked variables may use filters.

Zlib compression cannot be used with szip compression. If this function is called on a variable which already has szip compression turned on, NC_EINVAL is returned.

Note
  Parallel I/O reads work with compressed data. Parallel I/O writes work with compressed data in netcdf-c-4.7.4 and later releases, using hdf5-1.10.3 and later releases. Using the zlib, shuffle (or any other) filter requires that collective access be used with the variable. Turning on deflate and/or shuffle for a variable in a file opened for parallel I/O will automatically switch the access for that variable to collective access.
  The HDF5 manual has this to say about shuffle:

The shuffle filter de-interlaces a block of data by reordering the bytes. All the bytes from one consistent byte position of each data element are placed together in one block; all bytes from a second consistent byte position of each data element are placed together a second block; etc. For example, given three data elements of a 4-byte datatype stored as 012301230123, shuffling will re-order data as 000111222333. This can be a valuable step in an effective compression algorithm because the bytes in each byte position are often closely related to each other and putting them together can increase the compression ratio.

As implied above, the primary value of the shuffle filter lies in its coordinated use with a compression filter; it does not provide data compression when used alone. When the shuffle filter is applied to a dataset immediately prior to the use of a compression filter, the compression ratio achieved is often superior to that achieved by the use of a compression filter without the shuffle filter.

Note
  The shuffle and deflate flags are ambiguous.

In most cases, if the shuffle or deflate flag is zero, then it is interpreted to mean that shuffle or deflate should not be set. However, if the variable already has shuffle or deflate turned on, then it is unclear if a flag value of zero means leave the state as it is, or if it means that it should be turned off. Since currently no other filters can be disabled, it is assumed here that a zero value means to leave the state as it is.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  shuffle | True to turn on the shuffle filter. The shuffle filter can assist with the compression of data by changing the byte order in the data stream. It makes no sense to use the shuffle filter without setting a deflate level.
  deflate | True to turn on deflation for this variable.
  deflate_level | A number between 0 (no compression) and 9 (maximum compression).

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_ENOTNC4 Attempting netcdf-4 operation on file that is not netCDF-4/HDF5.
  NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
  NC_ELATEDEF Too late to change settings for this variable.
  NC_ENOTINDEFINE Not in define mode.
  NC_EPERM File is read only.
  NC_ESTRICTNC3 Attempting to create netCDF-4 type var in classic model file
  NC_EHDFERR Error returned by HDF5 layer.
  NC_EINVAL Invalid input. Deflate can't be set unless variable storage is NC_CHUNK.

# Example

Here is an example from /examples/C/simple_xy_nc4_wr.c using nc_def_var_deflate to create a variable and then turn on the shuffle filter and compression.

#include <netcdf.h>
#define NDIMS 2
#define NX 6
#define NY 12
int ncid, x_dimid, y_dimid, varid;
int dimids[NDIMS];
int shuffle, deflate, deflate_level;
int data_out[NX][NY];
int x, y, retval;
shuffle = NC_SHUFFLE;
deflate = 1;
deflate_level = 1;
...
if ((retval = nc_create(FILE_NAME, NC_NETCDF4, &ncid)))
ERR(retval);
if ((retval = nc_def_dim(ncid, "x", NX, &x_dimid)))
ERR(retval);
if ((retval = nc_def_dim(ncid, "y", NY, &y_dimid)))
ERR(retval);
dimids[0] = x_dimid;
dimids[1] = y_dimid;
if ((retval = nc_def_var(ncid, "data", NC_INT, NDIMS,
dimids, &varid)))
ERR(retval);
...
if ((retval = nc_def_var_deflate(ncid, varid, shuffle, deflate,
deflate_level)))
ERR(retval);
...
nc_def_var_deflate
EXTERNL int nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, int deflate_level)
Set the zlib compression and shuffle settings for a variable in an netCDF/HDF5 file.
Definition dvar.c:463
NC_SHUFFLE
#define NC_SHUFFLE
Control the HDF5 shuffle filter.
Definition netcdf.h:375

Author
  Ed Hartnett, Dennis Heimbigner

Definition at line 463 of file dvar.c.

## nc_def_var_endian()

int nc_def_var_endian | ( | int | ncid,
|  | int | varid,
|  | int | endian )

Define endianness of a variable.

With this function the endianness (i.e. order of bytes in integers) can be changed on a per-variable basis. By default, the endianness is the same as the default endianness of the platform. But with nc_def_var_endianness the endianness can be explicitly set for a variable.

Warning: this function is only defined if the type of the variable is an atomic integer or float type.

This function may only be called after the variable is defined, but before nc_enddef is called.

Parameters

  ncid | NetCDF ID, from a previous call to nc_open() or nc_create().
  varid | Variable ID.
  endian | NC_ENDIAN_NATIVE to select the native endianness of the platform (the default), NC_ENDIAN_LITTLE to use little-endian, NC_ENDIAN_BIG to use big-endian.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ID.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_ELATEDEF This variable has already been the subject of a nc_enddef call. In netCDF-4 files nc_enddef will be called automatically for any data read or write. Once nc_enddef has been called after the nc_def_var call for a variable, it is impossible to set the chunking for that variable.
  NC_ENOTINDEFINE Not in define mode. This is returned for netCDF classic or 64-bit offset files, or for netCDF-4 files, when they were created with NC_CLASSIC_MODEL flag by nc_create().
  NC_EPERM Attempt to create object in read-only file.

# Example

In this example from libsrc4/tst_vars2.c, a variable is created, and the endianness set to NC_ENDIAN_BIG.

#define NDIMS4 1
#define DIM4_NAME "Joe"
#define VAR_NAME4 "Ed"
#define DIM4_LEN 10
{
int dimids[NDIMS4], dimids_in[NDIMS4];
int varid;
int ndims, nvars, natts, unlimdimid;
nc_type xtype_in;
char name_in[NC_MAX_NAME + 1];
int data[DIM4_LEN], data_in[DIM4_LEN];
int endian_in;
int i;
for (i = 0; i < DIM4_LEN; i++)
data[i] = i;
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
if (nc_def_dim(ncid, DIM4_NAME, DIM4_LEN, &dimids[0])) ERR;
if (dimids[0] != 0) ERR;
if (nc_def_var(ncid, VAR_NAME4, NC_INT, NDIMS4, dimids, &varid)) ERR;
if (nc_def_var_endian(ncid, varid, NC_ENDIAN_BIG)) ERR;
nc_def_var_endian
EXTERNL int nc_def_var_endian(int ncid, int varid, int endian)
Define endianness of a variable.
Definition dvar.c:810
NC_ENDIAN_BIG
#define NC_ENDIAN_BIG
In HDF5 files you can set the endianness of variables with nc_def_var_endian().
Definition netcdf.h:345

Author
  Ed Hartnett

Definition at line 810 of file dvar.c.

## nc_def_var_fill()

int nc_def_var_fill | ( | int | ncid,
|  | int | varid,
|  | int | no_fill,
|  | const void * | fill_value )

Set the fill value for a variable.

Note
  For netCDF classic, 64-bit offset, and CDF5 formats, it is allowed (but not good practice) to set the fill value after data have been written to the variable. In this case, unless the variable has been completely specified (without gaps in the data), any existing filled values will not be recognized as fill values by applications reading the data. Best practice is to set the fill value after the variable has been defined, but before any data have been written to that variable. In NetCDF-4 files, this is enforced by the HDF5 library. For netCDF-4 files, an error is returned if the user attempts to set the fill value after writing data to the variable.

Parameters

  ncid | NetCDF ID, from a previous call to nc_open() or nc_create().
  varid | Variable ID.
  no_fill | Set to NC_NOFILL to turn off fill mode for this variable. Set to NC_FILL (the default) to turn on fill mode for the variable.
  fill_value | the fill value to be used for this variable. Must be the same type as the variable. This must point to enough free memory to hold one element of the data type of the variable. (For example, an NC_INT will require 4 bytes for it's fill value, which is also an NC_INT.)

Returns
  NC_NOERR No error.
  NC_EBADID Bad ID.
  NC_ENOTINDEFINE Not in define mode. This is returned for netCDF classic, 64-bit offset, or 64-bit data files, or for netCDF-4 files, when they were created with NC_CLASSIC_MODEL flag by nc_create().
  NC_EPERM Attempt to create object in read-only file.
  NC_ELATEDEF (NetCDF-4 only). Returned when user attempts to set fill value after data are written.
  NC_EGLOBAL Attempt to set fill value on NC_GLOBAL.

Warning: Using a vlen type as the fill value may lead to a memory leak.

# Example

In this example from libsrc4/tst_vars.c, a variable is defined, and the fill mode turned off. Then nc_inq_fill() is used to check that the setting is correct. Then some data are written to the variable. Since the data that are written do not cover the full extent of the variable, the missing values will just be random. If fill value mode was turned on, the missing values would get the fill value.

#define DIM7_LEN 2
#define DIM7_NAME "dim_7_from_Indiana"
#define VAR7_NAME "var_7_from_Idaho"
#define NDIMS 1
int dimids[NDIMS];
size_t index[NDIMS];
int varid;
int no_fill;
unsigned short ushort_data = 42, ushort_data_in, fill_value_in;
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
if (nc_def_dim(ncid, DIM7_NAME, DIM7_LEN, &dimids[0])) ERR;
if (nc_def_var(ncid, VAR7_NAME, NC_USHORT, NDIMS, dimids,
&varid)) ERR;
if (nc_def_var_fill(ncid, varid, 1, NULL)) ERR;
if (nc_inq_var_fill(ncid, varid, &no_fill, &fill_value_in)) ERR;
if (!no_fill) ERR;
index[0] = 1;
if (nc_put_var1_ushort(ncid, varid, index, &ushort_data)) ERR;
index[0] = 0;
if (nc_get_var1_ushort(ncid, varid, index, &ushort_data_in)) ERR;
if (nc_close(ncid)) ERR;
nc_close
EXTERNL int nc_close(int ncid)
Close an open netCDF dataset.
Definition dfile.c:1330
nc_def_var_fill
EXTERNL int nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value)
Set the fill value for a variable.
Definition dvar.c:311
nc_inq_var_fill
EXTERNL int nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)
Learn the fill mode of a variable.
Definition dvarinq.c:502
NC_USHORT
#define NC_USHORT
unsigned 2-byte int
Definition netcdf.h:43

Author
  Glenn Davis, Ed Hartnett, Dennis Heimbigner

Definition at line 311 of file dvar.c.

## nc_def_var_fletcher32()

int nc_def_var_fletcher32 | ( | int | ncid,
|  | int | varid,
|  | int | fletcher32 )

Set checksum for a var.

This function must be called after nc_def_var and before nc_enddef or any functions which writes data to the file.

Checksums require chunked data. If this function is called on a variable with contiguous data, then the data is changed to chunked data, with default chunksizes. Use nc_def_var_chunking() to tune performance with user-defined chunksizes.

Note
  Parallel I/O reads work with fletcher32 encoded data. Parallel I/O writes work with fletcher32 in netcdf-c-4.7.4 and later releases, using hdf5-1.10.2 and later releases. Using the fletcher32 (or any) filter requires that collective access be used with the variable. Turning on fletcher32 for a variable in a file opened for parallel I/O will automatically switch the access for that variable to collective access.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  fletcher32 | True to turn on Fletcher32 checksums for this variable.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_ENOTNC4 Attempting netcdf-4 operation on file that is not netCDF-4/HDF5.
  NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
  NC_ELATEDEF Too late to change settings for this variable.
  NC_EINVAL Invalid input

Author
  Ed Hartnett, Dennis Heimbigner

Definition at line 612 of file dvar.c.

## nc_def_var_quantize()

int nc_def_var_quantize | ( | int | ncid,
|  | int | varid,
|  | int | quantize_mode,
|  | int | nsd )

Turn on quantization for a variable.

The data are quantized by setting unneeded bits to zeros or ones so that they may compress well. BitGroom sets bits alternately to 1/0, while BitRound and Granular BitRound (GBR) round (more) bits to zeros Quantization is lossy (data are irretrievably altered), and it improves the compression ratio provided by a subsequent lossless compression filter. Quantization alone will not reduce the data size. Lossless compression like zlib must also be used (see nc_def_var_deflate()).

Producers of large datasets may find that using quantize with compression will result in significant improvement in the final data size.

A notable feature of all the quantization algorithms is data remain in IEEE754 format afterwards. Therefore quantization algorithms do nothing when data are read.

Quantization is only available for variables of type NC_FLOAT or NC_DOUBLE. Attempts to set quantization for other variable types return an error (NC_EINVAL).

Variables that use quantize will have added an attribute with name NC_QUANTIZE_[ALGORITHM_NAME]_ATT_NAME, which will contain the number of significant digits. Users should not delete or change this attribute. This is the only record that quantize has been applied to the data.

Quantization is not applied to values equal to the value of the _FillValue attribute, if any. If the _FillValue attribute is not set, then quantization is not applied to values matching the default fill value.

Quantization may be applied to scalar variables.

When type conversion takes place during a write, then it occurs before quantization is applied. For example, if nc_put_var_double() is called on a variable of type NC_FLOAT, which has quantize turned on, then the data are first converted from double to float, then quantization is applied to the float values.

As with the deflate settings, quantize settings may only be modified before the first call to nc_enddef(). Once nc_enddef() is called for the file, quantize settings for any variable in the file may not be changed.

Use of quantization is fully backwards compatible with existing versions and packages that can read compressed netCDF data. A variable which has been quantized is readable to older versions of the netCDF libraries, and to netCDF-Java.

For more information about quantization and the BitGroom filter, see Introduction.

Note
  Users new to quantization should start with Granular Bit Round, which results in the best compression. The Bit Groom algorithm is not as effective when compressing, but is faster than Granular Bit Round. The Bit Round algorithm accepts a number of bits to maintain, rather than a number of decimal digits, and is provided for users who are already performing some bit-based quantization, and wish to turn this task over to the netCDF library.

Parameters

  ncid | File ID.
  varid | Variable ID. NC_GLOBAL may not be used.
  quantize_mode | Quantization mode. May be NC_NOQUANTIZE or NC_QUANTIZE_BITGROOM or NC_QUANTIZE_GRANULARBR or NC_QUANTIZE_BITROUND.

  nsd

  Number of significant digits (either decimal or binary). May be any integer from 1 to NC_QUANTIZE_MAX_FLOAT_NSD (for variables of type NC_FLOAT) or NC_QUANTIZE_MAX_DOUBLE_NSD (for variables of type NC_DOUBLE) for mode NC_QUANTIZE_BITGROOM and mode NC_QUANTIZE_GRANULARBR. May be any integer from 1 to NC_QUANTIZE_MAX_FLOAT_NSB (for variables of type NC_FLOAT) or NC_QUANTIZE_MAX_DOUBLE_NSB (for variables of type NC_DOUBLE) for mode NC_QUANTIZE_BITROUND. Ignored if quantize_mode = NC_NOQUANTIZE.

Returns
  NC_NOERR No error.
  NC_EGLOBAL Can't use NC_GLOBAL with this function.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_ENOTNC4 Attempting netcdf-4 operation on file that is not netCDF-4/HDF5.
  NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
  NC_ELATEDEF Too late to change settings for this variable.
  NC_EINVAL Invalid input.

Since
  4.9.0

Author
  Charlie Zender, Ed Hartnett

Definition at line 563 of file dvar.c.

## nc_def_var_szip()

int nc_def_var_szip | ( | int | ncid,
|  | int | varid,
|  | int | options_mask,
|  | int | pixels_per_block )

Set szip compression settings on a variable.

Szip is an implementation of the extended-Rice lossless compression algorithm; it is reported to provide fast and effective compression. Szip is only available to netCDF if HDF5 was built with szip support.

SZIP compression cannot be applied to variables with any user-defined type.

If zlib compression has already be turned on for a variable, then this function will return NC_EINVAL.

To learn the szip settings for a variable, use nc_inq_var_szip().

Note
  The options_mask parameter may be either NC_SZIP_EC (entropy coding) or NC_SZIP_NN (nearest neighbor):
  - The entropy coding method is best suited for data that has been processed. The EC method works best for small numbers.
  - The nearest neighbor coding method preprocesses the data then the applies EC method as above.

For more information about HDF5 and szip, see https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip and https://support.hdfgroup.org/doc_resource/SZIP/index.html.

Parameters

  ncid | File ID.
  varid | Variable ID.
  options_mask | The options mask. Can be NC_SZIP_EC or NC_SZIP_NN.
  pixels_per_block | Pixels per block. Must be even and not greater than 32, with typical values being 8, 10, 16, or 32. This parameter affects compression ratio; the more pixel values vary, the smaller this number should be to achieve better performance. If pixels_per_block is bigger than the total number of elements in a dataset chunk, NC_EINVAL will be returned.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_ENOTNC4 Attempting netcdf-4 operation on file that is not netCDF-4/HDF5.
  NC_ELATEDEF Too late to change settings for this variable.
  NC_ENOTINDEFINE Not in define mode.
  NC_EINVAL Invalid input, or zlib filter already applied to this var.

Since
  4.0.0

Author
  Ed Hartnett

Definition at line 868 of file dvar.c.

## nc_def_var_zstandard()

int nc_def_var_zstandard | ( | int | ncid,
|  | int | varid,
|  | int | level )

Turn on Zstandard compression for a variable.

Parameters

  ncid | File ID.
  varid | Variable ID.
  level | From -131072 to 22 (depends on Zstandard version). when compressing. Regular compression levels are from 1 up to 19. Use levels >= 20, labeled --ultra, cautiously: they require more memory. Negative compression levels that extend the range of speed vs. ratio preferences. The lower the level, the faster the speed (at the cost of compression).

Returns
  0 for success, error code otherwise.

Since
  4.9.0

Author
  Charlie Zender, Dennis Heimbigner, Ed Hartnett

Definition at line 313 of file dfilter.c.

## nc_free_string()

int nc_free_string | ( | size_t | len,
|  | char ** | data )

Free string space allocated by the library.

When you read an array string typed data the library will allocate the storage space for the data. The allocated strings must be freed, so pass the pointer to the array plus a count of the number of elements in the array to this function, when you're done with the data, and it will free the allocated string memory.

WARNING: This does not free the top-level array itself, only the strings to which it points.

Parameters

  len | The number of character arrays in the array.
  data | The pointer to the data array.

Returns
  NC_NOERR No error.

Author
  Ed Hartnett

Definition at line 1320 of file dvar.c.

## nc_get_var()

int nc_get_var | ( | int | ncid,
|  | int | varid,
|  | void * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1038 of file dvarget.c.

## nc_get_var1()

int nc_get_var1 | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | void * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 894 of file dvarget.c.

## nc_get_var1_double()

int nc_get_var1_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | double * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 944 of file dvarget.c.

## nc_get_var1_float()

int nc_get_var1_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | float * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 937 of file dvarget.c.

## nc_get_var1_int()

int nc_get_var1_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | int * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 924 of file dvarget.c.

## nc_get_var1_long()

int nc_get_var1_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | long * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 930 of file dvarget.c.

## nc_get_var1_longlong()

int nc_get_var1_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | long long * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 972 of file dvarget.c.

## nc_get_var1_schar()

int nc_get_var1_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | signed char * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 906 of file dvarget.c.

## nc_get_var1_short()

int nc_get_var1_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | short * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 918 of file dvarget.c.

## nc_get_var1_string()

int nc_get_var1_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | char ** | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 986 of file dvarget.c.

## nc_get_var1_text()

int nc_get_var1_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | char * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 900 of file dvarget.c.

## nc_get_var1_ubyte()

int nc_get_var1_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | unsigned char * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 951 of file dvarget.c.

## nc_get_var1_uchar()

int nc_get_var1_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | unsigned char * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 912 of file dvarget.c.

## nc_get_var1_uint()

int nc_get_var1_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | unsigned int * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 965 of file dvarget.c.

## nc_get_var1_ulonglong()

int nc_get_var1_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | unsigned long long * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 979 of file dvarget.c.

## nc_get_var1_ushort()

int nc_get_var1_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | unsigned short * | ip )

Read a single datum from a variable.

Inputs are the netCDF ID, the variable ID, a multidimensional index that specifies which value to get, and the address of a location into which the data value will be read. The value is converted from the external data type of the variable, if necessary.

The nc_get_var1() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_var1_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 958 of file dvarget.c.

## nc_get_var_chunk_cache()

int nc_get_var_chunk_cache | ( | int | ncid,
|  | int | varid,
|  | size_t * | sizep,
|  | size_t * | nelemsp,
|  | float * | preemptionp )

Get the per-variable chunk cache settings from the HDF5 layer.

These settings may be changed with nc_set_var_chunk_cache().

See nc_set_chunk_cache() for a full discussion of these settings.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  sizep | The total size of the raw data chunk cache, in bytes, will be put here. Ignored if NULL.
  nelemsp | The number of chunk slots in the raw data chunk cache hash table will be put here. Ignored if NULL.

  preemptionp

  The preemption will be put here. The preemption value is between 0 and 1 inclusive and indicates how much chunks that have been fully read are favored for preemption. A value of zero means fully read chunks are treated no differently than other chunks (the preemption is strictly LRU) while a value of one means fully read chunks are always preempted before other chunks. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
  NC_EINVAL Invalid input

Author
  Ed Hartnett

Definition at line 1439 of file dvar.c.

## nc_get_var_double()

int nc_get_var_double | ( | int | ncid,
|  | int | varid,
|  | double * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1086 of file dvarget.c.

## nc_get_var_float()

int nc_get_var_float | ( | int | ncid,
|  | int | varid,
|  | float * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1080 of file dvarget.c.

## nc_get_var_int()

int nc_get_var_int | ( | int | ncid,
|  | int | varid,
|  | int * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1068 of file dvarget.c.

## nc_get_var_long()

int nc_get_var_long | ( | int | ncid,
|  | int | varid,
|  | long * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1074 of file dvarget.c.

## nc_get_var_longlong()

int nc_get_var_longlong | ( | int | ncid,
|  | int | varid,
|  | long long * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1110 of file dvarget.c.

## nc_get_var_schar()

int nc_get_var_schar | ( | int | ncid,
|  | int | varid,
|  | signed char * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1050 of file dvarget.c.

## nc_get_var_short()

int nc_get_var_short | ( | int | ncid,
|  | int | varid,
|  | short * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1062 of file dvarget.c.

## nc_get_var_string()

int nc_get_var_string | ( | int | ncid,
|  | int | varid,
|  | char ** | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1122 of file dvarget.c.

## nc_get_var_text()

int nc_get_var_text | ( | int | ncid,
|  | int | varid,
|  | char * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1044 of file dvarget.c.

## nc_get_var_ubyte()

int nc_get_var_ubyte | ( | int | ncid,
|  | int | varid,
|  | unsigned char * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1092 of file dvarget.c.

## nc_get_var_uchar()

int nc_get_var_uchar | ( | int | ncid,
|  | int | varid,
|  | unsigned char * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1056 of file dvarget.c.

## nc_get_var_uint()

int nc_get_var_uint | ( | int | ncid,
|  | int | varid,
|  | unsigned int * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1104 of file dvarget.c.

## nc_get_var_ulonglong()

int nc_get_var_ulonglong | ( | int | ncid,
|  | int | varid,
|  | unsigned long long * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1116 of file dvarget.c.

## nc_get_var_ushort()

int nc_get_var_ushort | ( | int | ncid,
|  | int | varid,
|  | unsigned short * | ip )

Read an entire variable in one call.

This function will read all the values from a netCDF variable of an open netCDF dataset.

This is the simplest interface to use for reading the value of a scalar variable or when all the values of a multidimensional variable can be read at once. The values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to read all the values of a record variable into an array but there are more records in the file than you assume, more data will be read than you expect, which may cause a segmentation violation. To avoid such problems, it is better to use the nc_get_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_var() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1098 of file dvarget.c.

## nc_get_vara()

int nc_get_vara | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | void * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);
nc_open
EXTERNL int nc_open(const char *path, int mode, int *ncidp)
Open an existing netCDF file.
Definition dfile.c:694
nc_inq_varid
EXTERNL int nc_inq_varid(int ncid, const char *name, int *varidp)
Find the ID of a variable, from the name.
Definition dvarinq.c:60
NC_NOWRITE
#define NC_NOWRITE
Set read-only access for nc_open().
Definition netcdf.h:135

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 746 of file dvarget.c.

## nc_get_vara_double()

int nc_get_vara_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | double * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 808 of file dvarget.c.

## nc_get_vara_float()

int nc_get_vara_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | float * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 801 of file dvarget.c.

## nc_get_vara_int()

int nc_get_vara_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | int * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 787 of file dvarget.c.

## nc_get_vara_long()

int nc_get_vara_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | long * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 794 of file dvarget.c.

## nc_get_vara_longlong()

int nc_get_vara_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | long long * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 836 of file dvarget.c.

## nc_get_vara_schar()

int nc_get_vara_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | signed char * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 766 of file dvarget.c.

## nc_get_vara_short()

int nc_get_vara_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | short * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 780 of file dvarget.c.

## nc_get_vara_string()

int nc_get_vara_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | char ** | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 850 of file dvarget.c.

## nc_get_vara_text()

int nc_get_vara_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | char * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 759 of file dvarget.c.

## nc_get_vara_ubyte()

int nc_get_vara_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | unsigned char * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 815 of file dvarget.c.

## nc_get_vara_uchar()

int nc_get_vara_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | unsigned char * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 773 of file dvarget.c.

## nc_get_vara_uint()

int nc_get_vara_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | unsigned int * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 829 of file dvarget.c.

## nc_get_vara_ulonglong()

int nc_get_vara_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | unsigned long long * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 843 of file dvarget.c.

## nc_get_vara_ushort()

int nc_get_vara_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | unsigned short * | ip )

Read an array of values from a variable.

The array to be read is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The data values are read into consecutive locations with the last dimension varying fastest. The netCDF dataset must be in data mode (for netCDF-4/HDF5 files, the switch to data mode will happen automatically, unless the classic model is used).

The nc_get_vara() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Other nc_get_vara_ functions will convert data to the desired output type as needed.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

# Example

Here is an example using nc_get_vara_double() to read all the values of the variable named rh from an existing netCDF dataset named foo.nc. For simplicity in this example, we assume that we know that rh is dimensioned with time, lat, and lon, and that there are three time values, five lat values, and ten lon values.

#include <netcdf.h>
...
#define TIMES 3
#define LATS 5
#define LONS 10
int status;
int ncid;
int rh_id;
static size_t start[] = {0, 0, 0};
static size_t count[] = {TIMES, LATS, LONS};
double rh_vals[TIMES*LATS*LONS];
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
...
status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
if (status != NC_NOERR) handle_error(status);

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 822 of file dvarget.c.

## nc_get_varm()

int nc_get_varm | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | void * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1370 of file dvarget.c.

## nc_get_varm_double()

int nc_get_varm_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | double * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1432 of file dvarget.c.

## nc_get_varm_float()

int nc_get_varm_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | float * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1423 of file dvarget.c.

## nc_get_varm_int()

int nc_get_varm_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | int * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1405 of file dvarget.c.

## nc_get_varm_long()

int nc_get_varm_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | long * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1414 of file dvarget.c.

## nc_get_varm_longlong()

int nc_get_varm_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | long long * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1471 of file dvarget.c.

## nc_get_varm_schar()

int nc_get_varm_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | signed char * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1378 of file dvarget.c.

## nc_get_varm_short()

int nc_get_varm_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | short * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1397 of file dvarget.c.

## nc_get_varm_string()

int nc_get_varm_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | char ** | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1499 of file dvarget.c.

## nc_get_varm_text()

int nc_get_varm_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | char * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1490 of file dvarget.c.

## nc_get_varm_ubyte()

int nc_get_varm_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | unsigned char * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1441 of file dvarget.c.

## nc_get_varm_uchar()

int nc_get_varm_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | unsigned char * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1388 of file dvarget.c.

## nc_get_varm_uint()

int nc_get_varm_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | unsigned int * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1461 of file dvarget.c.

## nc_get_varm_ulonglong()

int nc_get_varm_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | unsigned long long * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1480 of file dvarget.c.

## nc_get_varm_ushort()

int nc_get_varm_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | unsigned short * | ip )

Read a mapped array from a variable.

The nc_get_varm_ type family of functions reads a mapped array section of values from a netCDF variable of an open netCDF dataset. The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are made about the ordering or length of the dimensions of the data array. The netCDF dataset must be in data mode.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_get_varm() function will only read a variable of an atomic type; it will not read user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1451 of file dvarget.c.

## nc_get_vars()

int nc_get_vars | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | void * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1173 of file dvarget.c.

## nc_get_vars_double()

int nc_get_vars_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | double * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1245 of file dvarget.c.

## nc_get_vars_float()

int nc_get_vars_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | float * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1236 of file dvarget.c.

## nc_get_vars_int()

int nc_get_vars_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | int * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1218 of file dvarget.c.

## nc_get_vars_long()

int nc_get_vars_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | long * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1227 of file dvarget.c.

## nc_get_vars_longlong()

int nc_get_vars_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | long long * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1281 of file dvarget.c.

## nc_get_vars_schar()

int nc_get_vars_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | signed char * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1191 of file dvarget.c.

## nc_get_vars_short()

int nc_get_vars_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | short * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1209 of file dvarget.c.

## nc_get_vars_string()

int nc_get_vars_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | char ** | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1299 of file dvarget.c.

## nc_get_vars_text()

int nc_get_vars_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | char * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1182 of file dvarget.c.

## nc_get_vars_ubyte()

int nc_get_vars_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | unsigned char * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1254 of file dvarget.c.

## nc_get_vars_uchar()

int nc_get_vars_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | unsigned char * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1200 of file dvarget.c.

## nc_get_vars_uint()

int nc_get_vars_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | unsigned int * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1272 of file dvarget.c.

## nc_get_vars_ulonglong()

int nc_get_vars_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | unsigned long long * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1290 of file dvarget.c.

## nc_get_vars_ushort()

int nc_get_vars_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | unsigned short * | ip )

Read a strided array from a variable.

This function reads a subsampled (strided) array section of values from a netCDF variable of an open netCDF dataset. The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector. The values are read with the last dimension of the netCDF variable varying fastest. The netCDF dataset must be in data mode.

The nc_get_vars() function will read a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  ip | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1263 of file dvarget.c.

## NC_getshape()

int NC_getshape | ( | int | ncid,
|  | int | varid,
|  | int | ndims,
|  | size_t * | shape )

Definition at line 1212 of file dvar.c.

## NC_inq_recvar()

int NC_inq_recvar | ( | int | ncid,
|  | int | varid,
|  | int * | nrecdimsp,
|  | int * | is_recdim )

Definition at line 1013 of file dvar.c.

## nc_inq_unlimdims()

int nc_inq_unlimdims | ( | int | ncid,
|  | int * | nunlimdimsp,
|  | int * | unlimdimidsp )

Return number and list of unlimited dimensions.

In netCDF-4 files, it's possible to have multiple unlimited dimensions. This function returns a list of the unlimited dimension ids visible in a group.

Dimensions are visible in a group if they have been defined in that group, or any ancestor group.

Parameters

  ncid | NetCDF file and group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), etc.
  nunlimdimsp | A pointer to an int which will get the number of visible unlimited dimensions. Ignored if NULL.
  unlimdimidsp | A pointer to an already allocated array of int which will get the ids of all visible unlimited dimensions. Ignored if NULL. To allocate the correct length for this array, call nc_inq_unlimdims with a NULL for this parameter and use the nunlimdimsp parameter to get the number of visible unlimited dimensions.

# Example

Here is an example from nc_test4/tst_dims.c. In this example we create a file with two unlimited dimensions, and then call nc_inq_unlimdims() to check that there are 2 unlimited dimensions, and that they have dimids 0 and 1.

#include <netcdf.h>
...
#define ROMULUS "Romulus"
#define REMUS "Remus"
#define DIMS2 2
printf("*** Testing file with two unlimited dimensions...");
{
int ncid, dimid[DIMS2];
int unlimdimid_in[DIMS2];
int nunlimdims_in;
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
if (nc_def_dim(ncid, REMUS, NC_UNLIMITED, &dimid[0])) ERR;
if (nc_def_dim(ncid, ROMULUS, NC_UNLIMITED, &dimid[1])) ERR;
...
if (nc_inq_unlimdims(ncid, &nunlimdims_in, unlimdimid_in)) ERR;
if (nunlimdims_in != 2 || unlimdimid_in[0] != 0 || unlimdimid_in[1] != 1) ERR;
nc_inq_unlimdims
EXTERNL int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
Return number and list of unlimited dimensions.
Definition dvarinq.c:673

This function will return one of the following values.

Returns
  NC_NOERR No error.
  NC_EBADID Bad group id.
  NC_ENOTNC4 Attempting a netCDF-4 operation on a netCDF-3 file. NetCDF-4 operations can only be performed on files defined with a create mode which includes flag HDF5. (see nc_open).
  NC_ESTRICTNC3 This file was created with the strict netcdf-3 flag, therefore netcdf-4 operations are not allowed. (see nc_open).
  NC_EHDFERR An error was reported by the HDF5 layer.

Author
  Ed Hartnett, Dennis Heimbigner

Definition at line 673 of file dvarinq.c.

## nc_inq_var()

int nc_inq_var | ( | int | ncid,
|  | int | varid,
|  | char * | name,
|  | nc_type * | xtypep,
|  | int * | ndimsp,
|  | int * | dimidsp,
|  | int * | nattsp )

Learn about a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  name | Returned NetCDF Names of variable. Ignored if NULL.
  xtypep | Pointer where typeid will be stored. Ignored if NULL.
  ndimsp | Pointer where number of dimensions will be stored. Ignored if NULL.
  dimidsp | Pointer where array of dimension IDs will be stored. Ignored if NULL.
  nattsp | Pointer where number of attributes will be stored. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

# Example (find ID of a variable)

Here is an example using nc_inq_var() to find out about a variable named rh in an existing netCDF dataset named foo.nc:

#include <netcdf.h>
...
int status
int ncid;
int rh_id;
nc_type rh_type;
int rh_ndims;
int rh_dimids[NC_MAX_VAR_DIMS];
int rh_natts
...
status = nc_open ("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
status = nc_inq_var (ncid, rh_id, 0, &rh_type, &rh_ndims, rh_dimids,
&rh_natts);
if (status != NC_NOERR) handle_error(status);
nc_inq_var
EXTERNL int nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
Learn about a variable.
Definition dvarinq.c:124
NC_MAX_VAR_DIMS
#define NC_MAX_VAR_DIMS
max per variable dimensions
Definition netcdf.h:331

Definition at line 124 of file dvarinq.c.

## nc_inq_var_blosc()

int nc_inq_var_blosc | ( | int | ncid,
|  | int | varid,
|  | int * | hasfilterp,
|  | unsigned * | subcompressorp,
|  | unsigned * | levelp,
|  | unsigned * | blocksizep,
|  | unsigned * | addshufflep )

Learn whether Blosc compression is on for a variable, and, if so, the settings.

Parameters

  ncid | File ID.
  varid | Variable ID.
  hasfilterp | Pointer that gets a 0 if blosc is not in use for this var, and a 1 if it is. Ignored if NULL.
  subcompressorp | Pointer that gets the subcompressor, if blosc is in use. Ignored if NULL.
  levelp | Pointer that gets the level setting, if blosc is in use. Ignored if NULL.
  blocksizep | Pointer that gets the block size, if blosc is in use. Ignored if NULL.
  addshufflep | Pointer that gets non-zero value if shuffle is in use, if blosc is in use. Ignored if NULL.

Returns
  0 for success, error code otherwise.

Since
  4.9.0

Author
  Dennis Heimbigner

Definition at line 445 of file dfilter.c.

## nc_inq_var_bzip2()

int nc_inq_var_bzip2 | ( | int | ncid,
|  | int | varid,
|  | int * | hasfilterp,
|  | int * | levelp )

Learn whether bzip2 compression is on for a variable, and, if so, the level setting.

Parameters

  ncid | File ID.
  varid | Variable ID.
  hasfilterp | Pointer that gets a 0 if bzip2 is not in use for this var, and a 1 if it is. Ignored if NULL.
  levelp | Pointer that gets the level setting (from 1 to 9), if bzip2 is in use. Ignored if NULL.

Returns
  0 for success, error code otherwise.

Since
  4.9.0

Author
  Dennis Heimbigner, Ed Hartnett

Definition at line 274 of file dfilter.c.

## nc_inq_var_chunking()

int nc_inq_var_chunking | ( | int | ncid,
|  | int | varid,
|  | int * | storagep,
|  | size_t * | chunksizesp )

Get the storage and (for chunked variables) the chunksizes of a variable.

See nc_def_var_chunking() for explanation of storage.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  storagep | Address of returned storage property, returned as NC_CONTIGUOUS if this variable uses contiguous storage, NC_CHUNKED if it uses chunked storage, or NC_COMPACT for compact storage. Ignored if NULL.
  chunksizesp | The chunksizes will be copied here. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_ENOTVAR Invalid variable ID.

Author
  Ed Hartnett

# Example

printf("**** testing contiguous storage...");
{
#define NDIMS6 1
#define DIM6_NAME "D5"
#define VAR_NAME6 "V5"
#define DIM6_LEN 100
int dimids[NDIMS6], dimids_in[NDIMS6];
int varid;
int ndims, nvars, natts, unlimdimid;
nc_type xtype_in;
char name_in[NC_MAX_NAME + 1];
int data[DIM6_LEN], data_in[DIM6_LEN];
size_t chunksize_in[NDIMS6];
int storage_in;
int i, d;
for (i = 0; i < DIM6_LEN; i++)
data[i] = i;
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
if (nc_def_dim(ncid, DIM6_NAME, DIM6_LEN, &dimids[0])) ERR;
if (dimids[0] != 0) ERR;
if (nc_def_var(ncid, VAR_NAME6, NC_INT, NDIMS6, dimids, &varid)) ERR;
if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
if (nc_put_var_int(ncid, varid, data)) ERR;
if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
if (storage_in != NC_CONTIGUOUS) ERR;
NC_CONTIGUOUS
#define NC_CONTIGUOUS
In HDF5 files you can set storage for each variable to be either contiguous or chunked,...
Definition netcdf.h:354

Definition at line 466 of file dvarinq.c.

## nc_inq_var_deflate()

int nc_inq_var_deflate | ( | int | ncid,
|  | int | varid,
|  | int * | shufflep,
|  | int * | deflatep,
|  | int * | deflate_levelp )

Learn the shuffle and deflate settings for a variable.

Deflation is compression with the zlib library. Shuffle re-orders the data bytes to provide better compression (see nc_def_var_deflate()).

Deflation is only available for HDF5 files. For classic and other files, this function will return setting that indicate that deflation is not in use, and that the shuffle filter is not in use. That is: shuffle off, deflate off, and a deflate level of 0.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  shufflep | A 1 will be written here if the shuffle filter is turned on for this variable, and a 0 otherwise. Ignored if NULL.
  deflatep | If this pointer is non-NULL, the nc_inq_var_deflate function will write a 1 if the deflate filter is turned on for this variable, and a 0 otherwise. Ignored if NULL.
  deflate_levelp | If the deflate filter is in use for this variable, the deflate_level will be written here. If deflate is not in use, and deflate_levelp is provided, it will get a zero. (This behavior is expected by the Fortran APIs). Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Author
  Ed Hartnett, Dennis Heimbigner

Definition at line 295 of file dvarinq.c.

## nc_inq_var_endian()

int nc_inq_var_endian | ( | int | ncid,
|  | int | varid,
|  | int * | endianp )

Find the endianness of a variable.

This is a wrapper for nc_inq_var_all().

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  endianp | Storage which will get NC_ENDIAN_LITTLE if this variable is stored in little-endian format, NC_ENDIAN_BIG if it is stored in big-endian format, and NC_ENDIAN_NATIVE if the endianness is not set, and the variable is not created yet.

Returns
  NC_NOERR No error.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Definition at line 583 of file dvarinq.c.

## nc_inq_var_fill()

int nc_inq_var_fill | ( | int | ncid,
|  | int | varid,
|  | int * | no_fill,
|  | void * | fill_valuep )

Learn the fill mode of a variable.

The fill mode of a variable is set by nc_def_var_fill().

This is a wrapper for nc_inq_var_all().

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  no_fill | Pointer to an integer which will get a 1 if no_fill mode is set for this variable. Ignored if NULL.
  fill_valuep | A pointer which will get the fill value for this variable. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Definition at line 502 of file dvarinq.c.

## nc_inq_var_filter()

EXTERNL int nc_inq_var_filter | ( | int | ncid,
|  | int | varid,
|  | unsigned int * | idp,
|  | size_t * | nparamsp,
|  | unsigned int * | params )

Find the first filter (if any) associated with a variable.

Assumes HDF5 format using unsigned int.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  idp | Storage which will get the filter id; a return value of zero means variable has no filters.
  nparamsp | Storage which will get the number of parameters to the filter
  params | Storage which will get associated parameters (call allocates and frees).

This is redundant over the multi-filter API, so it can be implemented in terms of those functions.

Returns
  NC_NOERR No error.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Author
  Dennis Heimbigner

Definition at line 170 of file dfilter.c.

## nc_inq_var_filter_ids()

EXTERNL int nc_inq_var_filter_ids | ( | int | ncid,
|  | int | varid,
|  | size_t * | nfiltersp,
|  | unsigned int * | ids )

Find the set of filters (if any) associated with a variable.

Assumes HDF5 format using unsigned ints.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  nfiltersp | Pointer that gets the number of filters; may be zero.
  ids | return the filter ids (caller allocates)

Returns
  NC_NOERR No error.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_EBADID Bad ncid
  NC_ENOTVAR Invalid variable ID.
  NC_EINVAL Invalid arguments

Author
  Dennis Heimbigner

Definition at line 62 of file dfilter.c.

## nc_inq_var_filter_info()

EXTERNL int nc_inq_var_filter_info | ( | int | ncid,
|  | int | varid,
|  | unsigned int | id,
|  | size_t * | nparamsp,
|  | unsigned int * | params )

Find the param info about filter (if any) associated with a variable and with specified id.

Assumes HDF5 format using unsigned ints.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  id | The filter id of interest
  nparamsp | (Out) Storage which will get the number of parameters to the filter
  params | (Out) Storage which will get associated parameters. Note: the caller must allocate and free.

Returns
  NC_NOERR No error.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_ENOFILTER Specified filter not defined for this variable.

Author
  Dennis Heimbigner

Definition at line 98 of file dfilter.c.

## nc_inq_var_fletcher32()

int nc_inq_var_fletcher32 | ( | int | ncid,
|  | int | varid,
|  | int * | fletcher32p )

Learn the checksum settings for a variable.

This is a wrapper for nc_inq_var_all().

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  fletcher32p | Will be set to NC_FLETCHER32 if the fletcher32 checksum filter is turned on for this variable, and NC_NOCHECKSUM if it is not. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTNC4 Not a netCDF-4 file.
  NC_ENOTVAR Invalid variable ID.

Definition at line 378 of file dvarinq.c.

## nc_inq_var_quantize()

int nc_inq_var_quantize | ( | int | ncid,
|  | int | varid,
|  | int * | quantize_modep,
|  | int * | nsdp )

Learn whether quantization is on for a variable, and, if so, the NSD setting.

Parameters

  ncid | File ID.
  varid | Variable ID. Must not be NC_GLOBAL.
  quantize_modep | Pointer that gets a 0 if quantization is not in use for this var, and a 1 if it is. Ignored if NULL.
  nsdp | Pointer that gets the NSD setting (from 1 to 15), if quantization is in use. Ignored if NULL.

Returns
  0 for success, error code otherwise.

Since
  4.9.0

Author
  Charlie Zender, Ed Hartnett

Definition at line 546 of file dvarinq.c.

## nc_inq_var_szip()

int nc_inq_var_szip | ( | int | ncid,
|  | int | varid,
|  | int * | options_maskp,
|  | int * | pixels_per_blockp )

Learn the szip settings of a variable.

This function returns the szip settings for a variable. To turn on szip compression, use nc_def_var_szip(). Szip compression is only available for netCDF/HDF5 files, and only if HDF5 was built with szip support.

If a variable is not using szip, or if this function is called on a file that is not a HDF5 file, then a zero will be passed back for both options_maskp and pixels_per_blockp.

For more information on HDF5 and szip see https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip and https://support.hdfgroup.org/doc_resource/SZIP/index.html.

The nc_def_var_filter function may also be used to set szip compression.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  options_maskp | The szip options mask will be copied to this pointer. Note that the HDF5 layer adds to the options_mask, so this value may be different from the value used when setting szip compression, however the bit set when setting szip compression will still be set in the options_maskp and can be checked for. If zero is returned, szip is not in use for this variable.Ignored if NULL.
  pixels_per_blockp | The szip pixels per block will be copied here. The HDF5 layer may change this value, so this may not match the value passed in when setting szip compression. If zero is returned, szip is not in use for this variable. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_EFILTER Filter error.

Author
  Ed Hartnett, Dennis Heimbigner

Definition at line 733 of file dvarinq.c.

## nc_inq_var_zstandard()

int nc_inq_var_zstandard | ( | int | ncid,
|  | int | varid,
|  | int * | hasfilterp,
|  | int * | levelp )

Learn whether Zstandard compression is on for a variable, and, if so, the level setting.

Parameters

  ncid | File ID.
  varid | Variable ID.
  hasfilterp | Pointer that gets a 0 if Zstandard is not in use for this var, and a 1 if it is. Ignored if NULL.
  levelp | Pointer that gets the level setting (from -131072 to 22), if Zstandard is in use. Ignored if NULL.

Returns
  0 for success, error code otherwise.

Since
  4.9.0

Author
  Charlie Zender, Dennis Heimbigner, Ed Hartnett

Definition at line 351 of file dfilter.c.

## nc_inq_vardimid()

int nc_inq_vardimid | ( | int | ncid,
|  | int | varid,
|  | int * | dimidsp )

Learn the dimension IDs associated with a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  dimidsp | Pointer where array of dimension IDs will be stored. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Definition at line 225 of file dvarinq.c.

## nc_inq_varid()

int nc_inq_varid | ( | int | ncid,
|  | const char * | name,
|  | int * | varidp )

Find the ID of a variable, from the name.

The function nc_inq_varid returns the ID of a netCDF variable, given its name.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  name | Name of the variable.
  varidp | Pointer to location for returned variable ID. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

# Example (find ID of a variable)

Here is an example using nc_inq_varid to find out the ID of a variable named rh in an existing netCDF dataset named foo.nc:

#include <netcdf.h>
...
int status, ncid, rh_id;
...
status = nc_open("foo.nc", NC_NOWRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);

Definition at line 60 of file dvarinq.c.

## nc_inq_varname()

int nc_inq_varname | ( | int | ncid,
|  | int | varid,
|  | char * | name )

Learn the name of a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  name | Returned variable name. The caller must allocate space for the returned name. The maximum length is NC_MAX_NAME. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Definition at line 156 of file dvarinq.c.

## nc_inq_varnatts()

int nc_inq_varnatts | ( | int | ncid,
|  | int | varid,
|  | int * | nattsp )

Learn how many attributes are associated with a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  nattsp | Pointer where number of attributes will be stored. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Definition at line 249 of file dvarinq.c.

## nc_inq_varndims()

int nc_inq_varndims | ( | int | ncid,
|  | int | varid,
|  | int * | ndimsp )

Learn how many dimensions are associated with a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  ndimsp | Pointer where number of dimensions will be stored. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Definition at line 202 of file dvarinq.c.

## nc_inq_vartype()

int nc_inq_vartype | ( | int | ncid,
|  | int | varid,
|  | nc_type * | typep )

Learn the type of a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  typep | Pointer where typeid will be stored. Ignored if NULL.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.

Definition at line 178 of file dvarinq.c.

## NC_is_recvar()

int NC_is_recvar | ( | int | ncid,
|  | int | varid,
|  | size_t * | nrecs )

Definition at line 968 of file dvar.c.

## nc_put_var()

int nc_put_var | ( | int | ncid,
|  | int | varid,
|  | const void * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 922 of file dvarput.c.

## nc_put_var1()

int nc_put_var1 | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const void * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 783 of file dvarput.c.

## nc_put_var1_double()

int nc_put_var1_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const double * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 831 of file dvarput.c.

## nc_put_var1_float()

int nc_put_var1_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const float * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 825 of file dvarput.c.

## nc_put_var1_int()

int nc_put_var1_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const int * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 813 of file dvarput.c.

## nc_put_var1_long()

int nc_put_var1_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const long * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 819 of file dvarput.c.

## nc_put_var1_longlong()

int nc_put_var1_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const long long * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 855 of file dvarput.c.

## nc_put_var1_schar()

int nc_put_var1_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const signed char * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 795 of file dvarput.c.

## nc_put_var1_short()

int nc_put_var1_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const short * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 807 of file dvarput.c.

## nc_put_var1_string()

int nc_put_var1_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const char ** | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 867 of file dvarput.c.

## nc_put_var1_text()

int nc_put_var1_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const char * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 789 of file dvarput.c.

## nc_put_var1_ubyte()

int nc_put_var1_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const unsigned char * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 837 of file dvarput.c.

## nc_put_var1_uchar()

int nc_put_var1_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const unsigned char * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 801 of file dvarput.c.

## nc_put_var1_uint()

int nc_put_var1_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const unsigned int * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 849 of file dvarput.c.

## nc_put_var1_ulonglong()

int nc_put_var1_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const unsigned long long * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 861 of file dvarput.c.

## nc_put_var1_ushort()

int nc_put_var1_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | indexp,
|  | const unsigned short * | op )

Write one datum.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  indexp | Index vector with one element for each dimension.
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 843 of file dvarput.c.

## nc_put_var_double()

int nc_put_var_double | ( | int | ncid,
|  | int | varid,
|  | const double * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 970 of file dvarput.c.

## nc_put_var_float()

int nc_put_var_float | ( | int | ncid,
|  | int | varid,
|  | const float * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 964 of file dvarput.c.

## nc_put_var_int()

int nc_put_var_int | ( | int | ncid,
|  | int | varid,
|  | const int * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 952 of file dvarput.c.

## nc_put_var_long()

int nc_put_var_long | ( | int | ncid,
|  | int | varid,
|  | const long * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 958 of file dvarput.c.

## nc_put_var_longlong()

int nc_put_var_longlong | ( | int | ncid,
|  | int | varid,
|  | const long long * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 994 of file dvarput.c.

## nc_put_var_schar()

int nc_put_var_schar | ( | int | ncid,
|  | int | varid,
|  | const signed char * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 934 of file dvarput.c.

## nc_put_var_short()

int nc_put_var_short | ( | int | ncid,
|  | int | varid,
|  | const short * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 946 of file dvarput.c.

## nc_put_var_string()

int nc_put_var_string | ( | int | ncid,
|  | int | varid,
|  | const char ** | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1006 of file dvarput.c.

## nc_put_var_text()

int nc_put_var_text | ( | int | ncid,
|  | int | varid,
|  | const char * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 928 of file dvarput.c.

## nc_put_var_ubyte()

int nc_put_var_ubyte | ( | int | ncid,
|  | int | varid,
|  | const unsigned char * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 976 of file dvarput.c.

## nc_put_var_uchar()

int nc_put_var_uchar | ( | int | ncid,
|  | int | varid,
|  | const unsigned char * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 940 of file dvarput.c.

## nc_put_var_uint()

int nc_put_var_uint | ( | int | ncid,
|  | int | varid,
|  | const unsigned int * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 988 of file dvarput.c.

## nc_put_var_ulonglong()

int nc_put_var_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const unsigned long long * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1000 of file dvarput.c.

## nc_put_var_ushort()

int nc_put_var_ushort | ( | int | ncid,
|  | int | varid,
|  | const unsigned short * | op )

Write an entire variable with one call.

The nc_put_var_ type family of functions write all the values of a variable into a netCDF variable of an open netCDF dataset. This is the simplest interface to use for writing a value in a scalar variable or whenever all the values of a multidimensional variable can all be written at once. The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The values are converted to the external data type of the variable, if necessary.

Take care when using this function with record variables (variables that use the NC_UNLIMITED dimension). If you try to write all the values of a record variable into a netCDF file that has no record data yet (hence has 0 records), nothing will be written. Similarly, if you try to write all the values of a record variable but there are more records in the file than you assume, more in-memory data will be accessed than you supply, which may result in a segmentation violation. To avoid such problems, it is better to use the nc_put_vara interfaces for variables that use the NC_UNLIMITED dimension.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  op | Pointer from where the data will be copied.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 982 of file dvarput.c.

## nc_put_vara()

int nc_put_vara | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const void * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 633 of file dvarput.c.

## nc_put_vara_double()

int nc_put_vara_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const double * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 702 of file dvarput.c.

## nc_put_vara_float()

int nc_put_vara_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const float * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 694 of file dvarput.c.

## nc_put_vara_int()

int nc_put_vara_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const int * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 678 of file dvarput.c.

## nc_put_vara_long()

int nc_put_vara_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const long * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 686 of file dvarput.c.

## nc_put_vara_longlong()

int nc_put_vara_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const long long * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 734 of file dvarput.c.

## nc_put_vara_schar()

int nc_put_vara_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const signed char * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 654 of file dvarput.c.

## nc_put_vara_short()

int nc_put_vara_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const short * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 670 of file dvarput.c.

## nc_put_vara_string()

int nc_put_vara_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const char ** | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 750 of file dvarput.c.

## nc_put_vara_text()

int nc_put_vara_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const char * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 646 of file dvarput.c.

## nc_put_vara_ubyte()

int nc_put_vara_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const unsigned char * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 710 of file dvarput.c.

## nc_put_vara_uchar()

int nc_put_vara_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const unsigned char * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 662 of file dvarput.c.

## nc_put_vara_uint()

int nc_put_vara_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const unsigned int * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 726 of file dvarput.c.

## nc_put_vara_ulonglong()

int nc_put_vara_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const unsigned long long * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 742 of file dvarput.c.

## nc_put_vara_ushort()

int nc_put_vara_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const unsigned short * | op )

Write an array of values to a variable.

The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest in the C interface. The netCDF dataset must be in data mode. The array to be written is specified by giving a corner and a vector of edge lengths to Specify a Hyperslab.

The functions for types ubyte, ushort, uint, longlong, ulonglong, and string are only available for netCDF-4/HDF5 files.

The nc_put_var() function will write a variable of any type, including user defined type. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 718 of file dvarput.c.

## nc_put_varm()

int nc_put_varm | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const void * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1243 of file dvarput.c.

## nc_put_varm_double()

int nc_put_varm_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const double * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1320 of file dvarput.c.

## nc_put_varm_float()

int nc_put_varm_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const float * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1310 of file dvarput.c.

## nc_put_varm_int()

int nc_put_varm_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const int * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1290 of file dvarput.c.

## nc_put_varm_long()

int nc_put_varm_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const long * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1300 of file dvarput.c.

## nc_put_varm_longlong()

int nc_put_varm_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const long long * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1360 of file dvarput.c.

## nc_put_varm_schar()

int nc_put_varm_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const signed char * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1260 of file dvarput.c.

## nc_put_varm_short()

int nc_put_varm_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const short * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1280 of file dvarput.c.

## nc_put_varm_string()

int nc_put_varm_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const char ** | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1380 of file dvarput.c.

## nc_put_varm_text()

int nc_put_varm_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const char * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1251 of file dvarput.c.

## nc_put_varm_ubyte()

int nc_put_varm_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const unsigned char * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1330 of file dvarput.c.

## nc_put_varm_uchar()

int nc_put_varm_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const unsigned char * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1270 of file dvarput.c.

## nc_put_varm_uint()

int nc_put_varm_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const unsigned int * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1350 of file dvarput.c.

## nc_put_varm_ulonglong()

int nc_put_varm_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const unsigned long long * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1370 of file dvarput.c.

## nc_put_varm_ushort()

int nc_put_varm_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const ptrdiff_t * | imapp,
|  | const unsigned short * | op )

Write a mapped array of values to a variable.

The nc_put_varm() function will only write a variable of an atomic type; it will not write user defined types. For this function, the type of the data in memory must match the type of the variable - no data conversion is done.

Deprecated
  Use of this family of functions is discouraged, although it will continue to be supported. The reason is the complexity of the algorithm makes its use difficult for users to properly use.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  imapp | Mapping vector with one element for each dimension to Specify a Hyperslab.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1340 of file dvarput.c.

## nc_put_vars()

int nc_put_vars | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const void * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1048 of file dvarput.c.

## nc_put_vars_double()

int nc_put_vars_double | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const double * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1124 of file dvarput.c.

## nc_put_vars_float()

int nc_put_vars_float | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const float * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1114 of file dvarput.c.

## nc_put_vars_int()

int nc_put_vars_int | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const int * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1094 of file dvarput.c.

## nc_put_vars_long()

int nc_put_vars_long | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const long * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1104 of file dvarput.c.

## nc_put_vars_longlong()

int nc_put_vars_longlong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const long long * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1164 of file dvarput.c.

## nc_put_vars_schar()

int nc_put_vars_schar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const signed char * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1065 of file dvarput.c.

## nc_put_vars_short()

int nc_put_vars_short | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const short * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1084 of file dvarput.c.

## nc_put_vars_string()

int nc_put_vars_string | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const char ** | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1184 of file dvarput.c.

## nc_put_vars_text()

int nc_put_vars_text | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const char * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1056 of file dvarput.c.

## nc_put_vars_ubyte()

int nc_put_vars_ubyte | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const unsigned char * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1134 of file dvarput.c.

## nc_put_vars_uchar()

int nc_put_vars_uchar | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const unsigned char * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1074 of file dvarput.c.

## nc_put_vars_uint()

int nc_put_vars_uint | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const unsigned int * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1154 of file dvarput.c.

## nc_put_vars_ulonglong()

int nc_put_vars_ulonglong | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const unsigned long long * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1174 of file dvarput.c.

## nc_put_vars_ushort()

int nc_put_vars_ushort | ( | int | ncid,
|  | int | varid,
|  | const size_t * | startp,
|  | const size_t * | countp,
|  | const ptrdiff_t * | stridep,
|  | const unsigned short * | op )

Write a strided array of values to a variable.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  startp | Start vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  countp | Count vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  stridep | Stride vector with one element for each dimension to Specify a Hyperslab. This array must be same size as variable's number of dimensions.
  op | Pointer where the data will be copied. Memory must be allocated by the user before this function is called.

Returns
  NC_NOERR No error.
  NC_ENOTVAR Variable not found.
  NC_EINVALCOORDS Index exceeds dimension bound.
  NC_EEDGE Start+count exceeds dimension bound.
  NC_ERANGE One or more of the values are out of range.
  NC_EINDEFINE Operation not allowed in define mode.
  NC_EBADID Bad ncid.

Author
  Glenn Davis, Russ Rew, Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition at line 1144 of file dvarput.c.

## nc_rename_var()

int nc_rename_var | ( | int | ncid,
|  | int | varid,
|  | const char * | name )

Rename a variable.

This function changes the name of a netCDF variable in an open netCDF file or group. You cannot rename a variable to have the name of any existing variable.

For classic format, 64-bit offset format, and netCDF-4/HDF5 with classic mode, if the new name is longer than the old name, the netCDF dataset must be in define mode.

For netCDF-4/HDF5 files, renaming the variable changes the order of the variables in the file. The renamed variable becomes the last variable in the file.

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  name | New name of the variable.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_EBADNAME Bad name.
  NC_EMAXNAME Name is too long.
  NC_ENAMEINUSE Name in use.
  NC_ENOMEM Out of memory.

# Example

Here is an example using nc_rename_var to rename the variable rh to rel_hum in an existing netCDF dataset named foo.nc:

#include <netcdf.h>
...
int status;
int ncid;
int rh_id;
...
status = nc_open("foo.nc", NC_WRITE, &ncid);
if (status != NC_NOERR) handle_error(status);
...
status = nc_redef(ncid);
if (status != NC_NOERR) handle_error(status);
status = nc_inq_varid (ncid, "rh", &rh_id);
if (status != NC_NOERR) handle_error(status);
status = nc_rename_var (ncid, rh_id, "rel_hum");
if (status != NC_NOERR) handle_error(status);
status = nc_enddef(ncid);
if (status != NC_NOERR) handle_error(status);
nc_enddef
EXTERNL int nc_enddef(int ncid)
Leave define mode.
Definition dfile.c:1057
nc_redef
EXTERNL int nc_redef(int ncid)
Put open netcdf dataset into define mode.
Definition dfile.c:993
nc_rename_var
EXTERNL int nc_rename_var(int ncid, int varid, const char *name)
Rename a variable.
Definition dvar.c:948
NC_WRITE
#define NC_WRITE
Set read-write access for nc_open().
Definition netcdf.h:136

Author
  Glenn Davis, Ed Hartnett, Dennis Heimbigner

Definition at line 948 of file dvar.c.

## nc_set_var_chunk_cache()

int nc_set_var_chunk_cache | ( | int | ncid,
|  | int | varid,
|  | size_t | size,
|  | size_t | nelems,
|  | float | preemption )

Change the cache settings for a chunked variable.

This function allows users to control the amount of memory used in the per-variable chunk cache at the HDF5 level. Changing the chunk cache only has effect until the file is closed. Once re-opened, the variable chunk cache returns to its default value.

Current cache settings for each var may be obtained with nc_get_var_chunk_cache().

Default values for these settings may be changed for the whole file with nc_set_chunk_cache().

Parameters

  ncid | NetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
  varid | Variable ID
  size | The total size of the raw data chunk cache, in bytes.
  nelems | The number of chunk slots in the raw data chunk cache.
  preemption | The preemption, a value between 0 and 1 inclusive that indicates how much chunks that have been fully read are favored for preemption. A value of zero means fully read chunks are treated no differently than other chunks (the preemption is strictly LRU) while a value of one means fully read chunks are always preempted before other chunks.

Returns
  NC_NOERR No error.
  NC_EBADID Bad ncid.
  NC_ENOTVAR Invalid variable ID.
  NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
  NC_EINVAL Invalid input

# Example

In this example from nc_test4/tst_coords.c, a variable is defined, and the chunk cache settings are changed for that variable.

printf("**** testing setting cache values for coordinate variables...");
{
#define RANK_1 1
#define DIM0_NAME "d0"
#define CACHE_SIZE 1000000
#define CACHE_NELEMS 1009
#define CACHE_PREEMPTION .90
int ncid, dimid, varid;
char name_in[NC_MAX_NAME + 1];
if (nc_create(FILE_NAME, NC_CLASSIC_MODEL|NC_NETCDF4, &ncid)) ERR;
if (nc_def_dim(ncid, DIM0_NAME, NC_UNLIMITED, &dimid)) ERR;
if (nc_def_var(ncid, DIM0_NAME, NC_DOUBLE, 1, &dimid, &varid)) ERR;
if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS, CACHE_PREEMPTION)) ERR;
if (nc_close(ncid)) ERR;
...
}
SUMMARIZE_ERR;
nc_set_var_chunk_cache
EXTERNL int nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, float preemption)
Change the cache settings for a chunked variable.
Definition dvar.c:1398
NC_CLASSIC_MODEL
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
Definition netcdf.h:166

Author
  Ed Hartnett

Definition at line 1398 of file dvar.c.

## nctypelen()

int nctypelen | ( | nc_type | type | ) |

Definition at line 1091 of file dvar.c.