NetCDF  4.5.0
Variables

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

Functions

int nc_def_var_chunking (int ncid, int varid, int storage, const size_t *chunksizesp)
 Define chunking parameters for a variable. More...
 
int nc_free_string (size_t len, char **data)
 Free string space allocated by the library. More...
 
static int NC_get_var (int ncid, int varid, void *value, nc_type memtype)
 
int nc_get_var_chunk_cache (int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp)
 
static int NC_get_varm (int ncid, int varid, const size_t *start, const size_t *edges, const ptrdiff_t *stride, const ptrdiff_t *map, void *value, nc_type memtype)
 
static int NC_get_vars (int ncid, int varid, const size_t *start, const size_t *edges, const ptrdiff_t *stride, void *value, nc_type memtype)
 
int nc_set_var_chunk_cache (int ncid, int varid, size_t size, size_t nelems, float preemption)
 

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. More...
 

Rename a Variable

Rename a variable.

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

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int nc_get_var1 (int ncid, int varid, const size_t *indexp, void *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_text (int ncid, int varid, const size_t *indexp, char *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_schar (int ncid, int varid, const size_t *indexp, signed char *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_uchar (int ncid, int varid, const size_t *indexp, unsigned char *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_short (int ncid, int varid, const size_t *indexp, short *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_int (int ncid, int varid, const size_t *indexp, int *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_long (int ncid, int varid, const size_t *indexp, long *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_float (int ncid, int varid, const size_t *indexp, float *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_double (int ncid, int varid, const size_t *indexp, double *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_ubyte (int ncid, int varid, const size_t *indexp, unsigned char *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_ushort (int ncid, int varid, const size_t *indexp, unsigned short *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_uint (int ncid, int varid, const size_t *indexp, unsigned int *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_longlong (int ncid, int varid, const size_t *indexp, long long *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_ulonglong (int ncid, int varid, const size_t *indexp, unsigned long long *ip)
 Read a single datum from a variable. More...
 
int nc_get_var1_string (int ncid, int varid, const size_t *indexp, char **ip)
 Read a single datum from a variable. More...
 
int nc_get_var (int ncid, int varid, void *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_text (int ncid, int varid, char *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_schar (int ncid, int varid, signed char *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_uchar (int ncid, int varid, unsigned char *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_short (int ncid, int varid, short *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_int (int ncid, int varid, int *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_long (int ncid, int varid, long *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_float (int ncid, int varid, float *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_double (int ncid, int varid, double *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_ubyte (int ncid, int varid, unsigned char *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_ushort (int ncid, int varid, unsigned short *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_uint (int ncid, int varid, unsigned int *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_longlong (int ncid, int varid, long long *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_ulonglong (int ncid, int varid, unsigned long long *ip)
 Read an entire variable in one call. More...
 
int nc_get_var_string (int ncid, int varid, char **ip)
 Read an entire variable in one call. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

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. More...
 
int nc_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
 Learn about a variable. More...
 
int nc_inq_varname (int ncid, int varid, char *name)
 Learn the name of a variable. More...
 
int nc_inq_vartype (int ncid, int varid, nc_type *typep)
 Learn the type of a variable. More...
 
int nc_inq_varndims (int ncid, int varid, int *ndimsp)
 Learn how many dimensions are associated with a variable. More...
 
int nc_inq_vardimid (int ncid, int varid, int *dimidsp)
 Learn the dimension IDs associated with a variable. More...
 
int nc_inq_varnatts (int ncid, int varid, int *nattsp)
 Learn how many attributes are associated with a variable. More...
 
int nc_inq_var_deflate (int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
 Learn the storage and deflate settings for a variable. More...
 
int nc_inq_var_szip (int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
 Learn the szip settings of a variable. More...
 
int nc_inq_var_fletcher32 (int ncid, int varid, int *fletcher32p)
 Learn the checksum settings for a variable. More...
 
int nc_inq_var_chunking (int ncid, int varid, int *storagep, size_t *chunksizesp)
 This is a wrapper for nc_inq_var_all(). More...
 
int nc_inq_var_fill (int ncid, int varid, int *no_fill, void *fill_valuep)
 Learn the fill mode of a variable. More...
 
int nc_inq_var_endian (int ncid, int varid, int *endianp)
 Find the endianness of a variable. More...
 
int nc_inq_unlimdims (int ncid, int *nunlimdimsp, int *unlimdimidsp)
 Return number and list of unlimited dimensions. More...
 
int NC_inq_var_all (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp, int *shufflep, int *deflatep, int *deflate_levelp, int *fletcher32p, int *contiguousp, size_t *chunksizesp, int *no_fill, void *fill_valuep, int *endiannessp, int *options_maskp, int *pixels_per_blockp)
 Used in libdap2 and libdap4. More...
 

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int nc_put_var1 (int ncid, int varid, const size_t *indexp, const void *op)
 Write one datum. More...
 
int nc_put_var1_text (int ncid, int varid, const size_t *indexp, const char *op)
 Write one datum. More...
 
int nc_put_var1_schar (int ncid, int varid, const size_t *indexp, const signed char *op)
 Write one datum. More...
 
int nc_put_var1_uchar (int ncid, int varid, const size_t *indexp, const unsigned char *op)
 Write one datum. More...
 
int nc_put_var1_short (int ncid, int varid, const size_t *indexp, const short *op)
 Write one datum. More...
 
int nc_put_var1_int (int ncid, int varid, const size_t *indexp, const int *op)
 Write one datum. More...
 
int nc_put_var1_long (int ncid, int varid, const size_t *indexp, const long *op)
 Write one datum. More...
 
int nc_put_var1_float (int ncid, int varid, const size_t *indexp, const float *op)
 Write one datum. More...
 
int nc_put_var1_double (int ncid, int varid, const size_t *indexp, const double *op)
 Write one datum. More...
 
int nc_put_var1_ubyte (int ncid, int varid, const size_t *indexp, const unsigned char *op)
 Write one datum. More...
 
int nc_put_var1_ushort (int ncid, int varid, const size_t *indexp, const unsigned short *op)
 Write one datum. More...
 
int nc_put_var1_uint (int ncid, int varid, const size_t *indexp, const unsigned int *op)
 Write one datum. More...
 
int nc_put_var1_longlong (int ncid, int varid, const size_t *indexp, const long long *op)
 Write one datum. More...
 
int nc_put_var1_ulonglong (int ncid, int varid, const size_t *indexp, const unsigned long long *op)
 Write one datum. More...
 
int nc_put_var1_string (int ncid, int varid, const size_t *indexp, const char **op)
 Write one datum. More...
 
int nc_put_var (int ncid, int varid, const void *op)
 Write an entire variable with one call. More...
 
int nc_put_var_text (int ncid, int varid, const char *op)
 Write an entire variable with one call. More...
 
int nc_put_var_schar (int ncid, int varid, const signed char *op)
 Write an entire variable with one call. More...
 
int nc_put_var_uchar (int ncid, int varid, const unsigned char *op)
 Write an entire variable with one call. More...
 
int nc_put_var_short (int ncid, int varid, const short *op)
 Write an entire variable with one call. More...
 
int nc_put_var_int (int ncid, int varid, const int *op)
 Write an entire variable with one call. More...
 
int nc_put_var_long (int ncid, int varid, const long *op)
 Write an entire variable with one call. More...
 
int nc_put_var_float (int ncid, int varid, const float *op)
 Write an entire variable with one call. More...
 
int nc_put_var_double (int ncid, int varid, const double *op)
 Write an entire variable with one call. More...
 
int nc_put_var_ubyte (int ncid, int varid, const unsigned char *op)
 Write an entire variable with one call. More...
 
int nc_put_var_ushort (int ncid, int varid, const unsigned short *op)
 Write an entire variable with one call. More...
 
int nc_put_var_uint (int ncid, int varid, const unsigned int *op)
 Write an entire variable with one call. More...
 
int nc_put_var_longlong (int ncid, int varid, const long long *op)
 Write an entire variable with one call. More...
 
int nc_put_var_ulonglong (int ncid, int varid, const unsigned long long *op)
 Write an entire variable with one call. More...
 
int nc_put_var_string (int ncid, int varid, const char **op)
 Write an entire variable with one call. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

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 (see Attributes) may be associated with a variable to specify such properties as units.

Operations supported on variables are:

Language Types Corresponding to netCDF

External 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 HDF5 flag in nc_create. (see 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:

TypeC defineBits
byteNC_BYTE8
charNC_CHAR8
shortNC_SHORT16
intNC_INT32
floatNC_FLOAT32
doubleNC_DOUBLE64

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 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.

TypeC define

Bits

byteNC_BYTE8
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

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
nameVariable NetCDF Names.
xtypeData Types of the variable.
ndimsNumber 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.
dimidspVector 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.
varidpPointer 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
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:

1 #include <netcdf.h>
2  ...
3 int status;
4 int ncid;
5 int lat_dim, lon_dim, time_dim;
6 int rh_id;
7 int rh_dimids[3];
8  ...
9 status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
10 if (status != NC_NOERR) handle_error(status);
11  ...
12 
13 status = nc_def_dim(ncid, "lat", 5L, &lat_dim);
14 if (status != NC_NOERR) handle_error(status);
15 status = nc_def_dim(ncid, "lon", 10L, &lon_dim);
16 if (status != NC_NOERR) handle_error(status);
17 status = nc_def_dim(ncid, "time", NC_UNLIMITED, &time_dim);
18 if (status != NC_NOERR) handle_error(status);
19  ...
20 
21 rh_dimids[0] = time_dim;
22 rh_dimids[1] = lat_dim;
23 rh_dimids[2] = lon_dim;
24 status = nc_def_var (ncid, "rh", NC_DOUBLE, 3, rh_dimids, &rh_id);
25 if (status != NC_NOERR) handle_error(status);

Definition at line 207 of file dvar.c.

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

Define chunking parameters for a variable.

The function nc_def_var_chunking sets the chunking parameters for a variable in a netCDF-4 file. It can set the chunk sizes to get chunked storage, or it can set the contiguous flag to get contiguous storage.

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 that this does not work for scalar variables. Only non-scalar variables can have chunking.

Parameters
[in]ncidNetCDF ID, from a previous call to nc_open or nc_create.
[in]varidVariable ID.
[in]storageIf NC_CONTIGUOUS, then contiguous storage is used for this variable. Variables with one or more unlimited dimensions cannot use contiguous storage. If contiguous 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.
[in]chunksizespA 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.
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 wwere created with NC_STRICT_NC3 flag. See nc_create.
NC_EPERM Attempt to create object in read-only file.
NC_EBADCHUNK Retunrs if the chunk size specified for a variable is larger than the length of the dimensions associated with variable.

Example

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

1  printf("**** testing chunking...");
2  {
3 #define NDIMS5 1
4 #define DIM5_NAME "D5"
5 #define VAR_NAME5 "V5"
6 #define DIM5_LEN 1000
7 
8  int dimids[NDIMS5], dimids_in[NDIMS5];
9  int varid;
10  int ndims, nvars, natts, unlimdimid;
11  nc_type xtype_in;
12  char name_in[NC_MAX_NAME + 1];
13  int data[DIM5_LEN], data_in[DIM5_LEN];
14  size_t chunksize[NDIMS5] = {5};
15  size_t chunksize_in[NDIMS5];
16  int storage_in;
17  int i, d;
18 
19  for (i = 0; i < DIM5_LEN; i++)
20  data[i] = i;
21 
22  if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
23  if (nc_def_dim(ncid, DIM5_NAME, DIM5_LEN, &dimids[0])) ERR;
24  if (nc_def_var(ncid, VAR_NAME5, NC_INT, NDIMS5, dimids, &varid)) ERR;
25  if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
26  if (nc_put_var_int(ncid, varid, data)) ERR;
27 
28  if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
29  for (d = 0; d < NDIMS5; d++)
30  if (chunksize[d] != chunksize_in[d]) ERR;
31  if (storage_in != NC_CHUNKED) ERR;

Definition at line 702 of file dvar.c.

int nc_free_string ( size_t  len,
char **  data 
)

Free string space allocated by the library.

When you read string type the library will allocate the storage space for the data. This storage space must be freed, so pass the pointer back to this function, when you're done with the data, and it will free the string memory.

Parameters
lenThe number of character arrays in the array.
dataThe pointer to the data array.
Returns
NC_NOERR No error.

Definition at line 609 of file dvar.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1031 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 845 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 916 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 906 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 887 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 896 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 956 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 860 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 878 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 977 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 851 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 926 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 869 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 946 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 966 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
ipPointer 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.

Definition at line 936 of file dvarget.c.

int nc_get_var_chunk_cache ( int  ncid,
int  varid,
size_t *  sizep,
size_t *  nelemsp,
float *  preemptionp 
)
Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
sizepThe total size of the raw data chunk cache, in bytes, will be put here. Ignored if NULL.
nelemspThe number of chunk slots in the raw data chunk cache hash table will be put here. Ignored if NULL.
preemptionpThe preemption will be put here. The preemtion 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

Definition at line 585 of file dvar.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1100 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.
Examples:
pres_temp_4D_rd.c, and sfc_pres_temp_rd.c.

Definition at line 1091 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.
Examples:
simple_xy_nc4_rd.c, and simple_xy_rd.c.

Definition at line 1073 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1082 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1136 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1046 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1064 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1155 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1037 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1109 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1055 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1127 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.
Examples:
simple_nc4_rd.c.

Definition at line 1145 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ipPointer 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.

Definition at line 1118 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 649 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 737 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);
Examples:
pres_temp_4D_rd.c.

Definition at line 726 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 706 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 716 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 777 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 673 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 695 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 798 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 662 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 747 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 684 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 767 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 787 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

1 #include <netcdf.h>
2  ...
3 #define TIMES 3
4 #define LATS 5
5 #define LONS 10
6 int status;
7 int ncid;
8 int rh_id;
9 static size_t start[] = {0, 0, 0};
10 static size_t count[] = {TIMES, LATS, LONS};
11 double rh_vals[TIMES*LATS*LONS];
12  ...
13 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
14 if (status != NC_NOERR) handle_error(status);
15  ...
16 status = nc_inq_varid (ncid, "rh", &rh_id);
17 if (status != NC_NOERR) handle_error(status);
18  ...
19 status = nc_get_vara_double(ncid, rh_id, start, count, rh_vals);
20 if (status != NC_NOERR) handle_error(status);

Definition at line 757 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1447 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1533 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1521 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1497 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1509 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1584 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1461 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1486 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1622 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1609 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1545 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1474 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1571 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1596 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1558 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1206 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1304 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1292 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1268 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1280 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1352 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1232 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1256 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1377 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1220 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1316 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1244 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1340 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1364 of file dvarget.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
ipPointer 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.

Definition at line 1328 of file dvarget.c.

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
ncidNetCDF group ID, from a previous call to nc_open, nc_create, nc_def_grp, etc.
nunlimdimspA pointer to an int which will get the number of visible unlimited dimensions. Ignored if NULL.
unlimdimidspA 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.

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.

Definition at line 600 of file dvarinq.c.

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

Learn about a variable.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
nameReturned NetCDF Names of variable. Ignored if NULL.
xtypepPointer where typeid will be stored. Ignored if NULL.
ndimspPointer where number of dimensions will be stored. Ignored if NULL.
dimidspPointer where array of dimension IDs will be stored. Ignored if NULL.
nattspPointer 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

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

1 #include <netcdf.h>
2  ...
3 int status
4 int ncid;
5 int rh_id;
6 nc_type rh_type;
7 int rh_ndims;
8 int rh_dimids[NC_MAX_VAR_DIMS];
9 int rh_natts
10  ...
11 status = nc_open ("foo.nc", NC_NOWRITE, &ncid);
12 if (status != NC_NOERR) handle_error(status);
13  ...
14 status = nc_inq_varid (ncid, "rh", &rh_id);
15 if (status != NC_NOERR) handle_error(status);
16 status = nc_inq_var (ncid, rh_id, 0, &rh_type, &rh_ndims, rh_dimids,
17  &rh_natts);
18 if (status != NC_NOERR) handle_error(status);

Definition at line 116 of file dvarinq.c.

int NC_inq_var_all ( int  ncid,
int  varid,
char *  name,
nc_type xtypep,
int *  ndimsp,
int *  dimidsp,
int *  nattsp,
int *  shufflep,
int *  deflatep,
int *  deflate_levelp,
int *  fletcher32p,
int *  contiguousp,
size_t *  chunksizesp,
int *  no_fill,
void *  fill_valuep,
int *  endiannessp,
int *  options_maskp,
int *  pixels_per_blockp 
)

Used in libdap2 and libdap4.

Parameters
[in]ncidncid for file.
[in]varidvarid for variable in question.
[out]namePointer to memory to contain the name of the variable.
[out]xtypepPointer to memory to contain the type of the variable.
[out]ndimspPointer to memory to store the number of associated dimensions for the variable.
[out]dimidspPointer to memory to store the dimids associated with the variable.
[out]nattspPointer to memory to store the number of attributes associated with the variable.
[out]shufflepPointer to memory to store shuffle information associated with the variable.
[out]deflatepPointer to memory to store compression type associated with the variable.
[out]deflate_levelpPointer to memory to store compression level associated with the variable.
[out]fletcher32pPointer to memory to store compression information associated with the variable.
[out]contiguouspPointer to memory to store contiguous-data information associated with the variable.
[out]chunksizespPointer to memory to store chunksize information associated with the variable.
[out]no_fillPointer to memory to store whether or not there is a fill value associated with the variable.
[out]fill_valuepPointer to memory to store the fill value (if one exists) for the variable.
[out]endiannesspPointer to memory to store endianness value. One of NC_ENDIAN_BIG NC_ENDIAN_LITTLE NC_ENDIAN_NATIVE
[out]options_maskpPointer to memory to store mask options information.
[out]pixels_per_blockpPointer to memory to store pixels-per-block information for chunked data.
Note
Expose access to nc_inq_var_all().

Definition at line 643 of file dvarinq.c.

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

This is a wrapper for nc_inq_var_all().

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
storagepAddress of returned storage property, returned as NC_CONTIGUOUS if this variable uses contiguous storage, or NC_CHUNKED if it uses chunked storage. Ignored if NULL.
chunksizespThe 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.

Example

1  printf("**** testing contiguous storage...");
2  {
3 #define NDIMS6 1
4 #define DIM6_NAME "D5"
5 #define VAR_NAME6 "V5"
6 #define DIM6_LEN 100
7 
8  int dimids[NDIMS6], dimids_in[NDIMS6];
9  int varid;
10  int ndims, nvars, natts, unlimdimid;
11  nc_type xtype_in;
12  char name_in[NC_MAX_NAME + 1];
13  int data[DIM6_LEN], data_in[DIM6_LEN];
14  size_t chunksize_in[NDIMS6];
15  int storage_in;
16  int i, d;
17 
18  for (i = 0; i < DIM6_LEN; i++)
19  data[i] = i;
20 
21 
22  if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
23  if (nc_def_dim(ncid, DIM6_NAME, DIM6_LEN, &dimids[0])) ERR;
24  if (dimids[0] != 0) ERR;
25  if (nc_def_var(ncid, VAR_NAME6, NC_INT, NDIMS6, dimids, &varid)) ERR;
26  if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
27  if (nc_put_var_int(ncid, varid, data)) ERR;
28 
29 
30  if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
31  if (storage_in != NC_CONTIGUOUS) ERR;

Definition at line 466 of file dvarinq.c.

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

Learn the storage and deflate settings for a variable.

This is a wrapper for nc_inq_var_all().

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
shufflepA 1 will be written here if the shuffle filter is turned on for this variable, and a 0 otherwise. Ignored if NULL.
deflatepIf 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_levelpIf the deflate filter is in use for this variable, the deflate_level will be writen here. Ignored if NULL.
Returns
NC_NOERR No error.
NC_ENOTNC4 Not a netCDF-4 file.
NC_EBADID Bad ncid.
NC_ENOTVAR Invalid variable ID.

Definition at line 274 of file dvarinq.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
endianpStorage 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 550 of file dvarinq.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
no_fillPointer to an integer which will get a 1 if no_fill mode is set for this variable. Ignored if NULL.
fill_valuepA 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 501 of file dvarinq.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
fletcher32pWill 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.

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. NetCDF does not allow variables to be created with szip (due to license problems with the szip library), but we do enable read-only access of HDF5 files with szip compression.

This is a wrapper for nc_inq_var_all().

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
options_maskpThe szip options mask will be copied to this pointer. Ignored if NULL.
pixels_per_blockpThe szip pixels per block 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.

Definition at line 330 of file dvarinq.c.

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

Learn the dimension IDs associated with a variable.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
dimidspPointer 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 214 of file dvarinq.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
nameName of the variable.
varidpPointer to location for returned variable ID. Ignored if NULL.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.

Example

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:

1 #include <netcdf.h>
2  ...
3 int status, ncid, rh_id;
4  ...
5 status = nc_open("foo.nc", NC_NOWRITE, &ncid);
6 if (status != NC_NOERR) handle_error(status);
7  ...
8 status = nc_inq_varid (ncid, "rh", &rh_id);
9 if (status != NC_NOERR) handle_error(status);

Definition at line 52 of file dvarinq.c.

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

Learn the name of a variable.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
nameReturned 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 147 of file dvarinq.c.

int nc_inq_varnatts ( int  ncid,
int  varid,
int *  nattsp 
)

Learn how many attributes are associated with a variable.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
nattspPointer 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 237 of file dvarinq.c.

int nc_inq_varndims ( int  ncid,
int  varid,
int *  ndimsp 
)

Learn how many dimensions are associated with a variable.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
ndimspPointer 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 192 of file dvarinq.c.

int nc_inq_vartype ( int  ncid,
int  varid,
nc_type typep 
)

Learn the type of a variable.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
typepPointer 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 169 of file dvarinq.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 971 of file dvarput.c.

int nc_put_var1 ( int  ncid,
int  varid,
const size_t *  indexp,
const void *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 790 of file dvarput.c.

int nc_put_var1_double ( int  ncid,
int  varid,
const size_t *  indexp,
const double *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 859 of file dvarput.c.

int nc_put_var1_float ( int  ncid,
int  varid,
const size_t *  indexp,
const float *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 850 of file dvarput.c.

int nc_put_var1_int ( int  ncid,
int  varid,
const size_t *  indexp,
const int *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 832 of file dvarput.c.

int nc_put_var1_long ( int  ncid,
int  varid,
const size_t *  indexp,
const long *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 841 of file dvarput.c.

int nc_put_var1_longlong ( int  ncid,
int  varid,
const size_t *  indexp,
const long long *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 895 of file dvarput.c.

int nc_put_var1_schar ( int  ncid,
int  varid,
const size_t *  indexp,
const signed char *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 805 of file dvarput.c.

int nc_put_var1_short ( int  ncid,
int  varid,
const size_t *  indexp,
const short *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 823 of file dvarput.c.

int nc_put_var1_string ( int  ncid,
int  varid,
const size_t *  indexp,
const char **  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 914 of file dvarput.c.

int nc_put_var1_text ( int  ncid,
int  varid,
const size_t *  indexp,
const char *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 796 of file dvarput.c.

int nc_put_var1_ubyte ( int  ncid,
int  varid,
const size_t *  indexp,
const unsigned char *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 868 of file dvarput.c.

int nc_put_var1_uchar ( int  ncid,
int  varid,
const size_t *  indexp,
const unsigned char *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 814 of file dvarput.c.

int nc_put_var1_uint ( int  ncid,
int  varid,
const size_t *  indexp,
const unsigned int *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 886 of file dvarput.c.

int nc_put_var1_ulonglong ( int  ncid,
int  varid,
const size_t *  indexp,
const unsigned long long *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 904 of file dvarput.c.

int nc_put_var1_ushort ( int  ncid,
int  varid,
const size_t *  indexp,
const unsigned short *  op 
)

Write one datum.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
indexpIndex vector with one element for each dimension.
opPointer 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.

Definition at line 877 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1040 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.
Examples:
pres_temp_4D_wr.c, and sfc_pres_temp_wr.c.

Definition at line 1031 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.
Examples:
simple_xy_nc4_wr.c, and simple_xy_wr.c.

Definition at line 1013 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1022 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1076 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 986 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1004 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1095 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 977 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1049 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 995 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1067 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.
Examples:
simple_nc4_wr.c.

Definition at line 1085 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
opPointer 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.

Definition at line 1058 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 600 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 687 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.
Examples:
pres_temp_4D_wr.c.

Definition at line 676 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 654 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 665 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 731 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 621 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 643 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 754 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 613 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 698 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 632 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 720 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 742 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 709 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1376 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1480 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1467 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1441 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1454 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1532 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1402 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1428 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1559 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1390 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1493 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1415 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1519 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1545 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
imappMapping vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1506 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1136 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1239 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1226 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1200 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1213 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1291 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1162 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1187 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1318 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1150 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1252 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1174 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1278 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1304 of file dvarput.c.

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
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
startpStart vector with one element for each dimension to Specify a Hyperslab.
countpCount vector with one element for each dimension to Specify a Hyperslab.
stridepStride vector with one element for each dimension to Specify a Hyperslab.
opPointer 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.

Definition at line 1265 of file dvarput.c.

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.

Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
nameNew 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:

1 #include <netcdf.h>
2  ...
3 int status;
4 int ncid;
5 int rh_id;
6  ...
7 status = nc_open("foo.nc", NC_WRITE, &ncid);
8 if (status != NC_NOERR) handle_error(status);
9  ...
10 status = nc_redef(ncid);
11 if (status != NC_NOERR) handle_error(status);
12 status = nc_inq_varid (ncid, "rh", &rh_id);
13 if (status != NC_NOERR) handle_error(status);
14 status = nc_rename_var (ncid, rh_id, "rel_hum");
15 if (status != NC_NOERR) handle_error(status);
16 status = nc_enddef(ncid);
17 if (status != NC_NOERR) handle_error(status);

Definition at line 281 of file dvar.c.

int nc_set_var_chunk_cache ( int  ncid,
int  varid,
size_t  size,
size_t  nelems,
float  preemption 
)
Parameters
ncidNetCDF or group ID, from a previous call to nc_open(), nc_create(), nc_def_grp(), or associated inquiry functions such as nc_inq_ncid().
varidVariable ID
sizeThe total size of the raw data chunk cache, in bytes.
nelemsThe number of chunk slots in the raw data chunk cache.
preemptionThe 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

Definition at line 547 of file dvar.c.


Return to the Main Unidata NetCDF page.
Generated on Wed Oct 18 2017 11:47:07 for NetCDF. NetCDF is a Unidata library.