PIO  2.5.4
Functions
Learn About a Variable

Learn variable name, dimensions, and type in C. More...

Functions

int PIOc_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
 The PIO-C interface for the NetCDF function nc_inq_var. More...
 
int PIOc_inq_varname (int ncid, int varid, char *name)
 Get the name of a variable. More...
 
int PIOc_inq_vartype (int ncid, int varid, nc_type *xtypep)
 Find the type of a variable. More...
 
int PIOc_inq_varndims (int ncid, int varid, int *ndimsp)
 Find the number of dimensions of a variable. More...
 
int PIOc_inq_vardimid (int ncid, int varid, int *dimidsp)
 Find the dimension IDs associated with a variable. More...
 
int PIOc_inq_varnatts (int ncid, int varid, int *nattsp)
 Find the number of attributes associated with a variable. More...
 
int PIOc_inq_varid (int ncid, const char *name, int *varidp)
 The PIO-C interface for the NetCDF function nc_inq_varid. More...
 
int PIOc_inq_var_fill (int ncid, int varid, int *no_fill, void *fill_valuep)
 The PIO-C interface for the NetCDF function nc_inq_var_fill. More...
 
int PIOc_inq_var_deflate (int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
 This function only applies to netCDF-4 files. More...
 
int PIOc_inq_var_chunking (int ncid, int varid, int *storagep, PIO_Offset *chunksizesp)
 Inquire about chunksizes for a variable. More...
 
int PIOc_inq_var_endian (int ncid, int varid, int *endianp)
 Inquire about chunksizes for a variable. More...
 
int PIOc_get_var_chunk_cache (int ncid, int varid, PIO_Offset *sizep, PIO_Offset *nelemsp, float *preemptionp)
 Get the variable chunk cache settings. More...
 

Detailed Description

Learn variable name, dimensions, and type in C.

Function Documentation

◆ PIOc_get_var_chunk_cache()

int PIOc_get_var_chunk_cache ( int  ncid,
int  varid,
PIO_Offset sizep,
PIO_Offset nelemsp,
float *  preemptionp 
)

Get the variable chunk cache settings.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

Note that these settings are not part of the data file - they apply only to the open file as long as it is open.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
sizepwill get the size of the cache in bytes. Ignored if NULL.
nelemspwill get the number of elements in the cache. Ignored if NULL.
preemptionpwill get the cache preemption value. Ignored if NULL.
Returns
PIO_NOERR for success, otherwise an error code.
Author
Ed Hartnett

◆ PIOc_inq_var()

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

The PIO-C interface for the NetCDF function nc_inq_var.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
namea pointer that gets the name of the dimension. Igorned if NULL. Name will be PIO_MAX_NAME chars or fewer.
xtypepa pointer that will get the type of the attribute. Ignored if NULL.
ndimspa pointer that will get the number of dimensions. Ignored if NULL.
dimidspa pointer that will get an array of dimids. Ignored if NULL.
nattspa pointer that will get the number of attributes. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_var_chunking()

int PIOc_inq_var_chunking ( int  ncid,
int  varid,
int *  storagep,
PIO_Offset chunksizesp 
)

Inquire about chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
storageppointer to int which will be set to either NC_CONTIGUOUS or NC_CHUNKED.
chunksizesppointer to memory where chunksizes will be set. There are the same number of chunksizes as there are dimensions.
Returns
PIO_NOERR for success, otherwise an error code.
Author
Ed Hartnett

◆ PIOc_inq_var_deflate()

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

This function only applies to netCDF-4 files.

When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

Inquire about deflate (zlib compression) settings for a variable.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
shuffleppointer to an int that will get the status of the shuffle filter. Ignored if NULL.
deflateppointer to an int that will be set to non-zero if deflation is in use for this variable. Ignored if NULL.
deflate_levelppointer to an int that will get the deflation level (from 1-9) if deflation is in use for this variable. Ignored if NULL.
Returns
PIO_NOERR for success, otherwise an error code.
Author
Ed Hartnett

◆ PIOc_inq_var_endian()

int PIOc_inq_var_endian ( int  ncid,
int  varid,
int *  endianp 
)

Inquire about chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
endianppointer to int which will be set to endianness. Ignored if NULL.
Returns
PIO_NOERR for success, otherwise an error code.
Author
Ed Hartnett

◆ PIOc_inq_var_fill()

int PIOc_inq_var_fill ( int  ncid,
int  varid,
int *  no_fill,
void *  fill_valuep 
)

The PIO-C interface for the NetCDF function nc_inq_var_fill.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
no_filla pointer to int that will get the fill mode. Ignored if NULL (except with pnetcdf, which seg-faults with NULL.)
fill_valueppointer to space that gets the fill value for this variable. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_vardimid()

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

Find the dimension IDs associated with a variable.

Parameters
ncidthe ncid of the open file.
varidthe variable ID.
dimidspa pointer that will get an array of dimids. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_varid()

int PIOc_inq_varid ( int  ncid,
const char *  name,
int *  varidp 
)

The PIO-C interface for the NetCDF function nc_inq_varid.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
namethe variable name.
varidpa pointer that will get the variable id
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_varname()

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

Get the name of a variable.

Parameters
ncidthe ncid of the open file.
varidthe variable ID.
namea pointer that will get the variable name.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_varnatts()

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

Find the number of attributes associated with a variable.

Parameters
ncidthe ncid of the open file.
varidthe variable ID.
nattspa pointer that will get the number of attriburtes. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_varndims()

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

Find the number of dimensions of a variable.

Parameters
ncidthe ncid of the open file.
varidthe variable ID.
ndimspa pointer that will get the number of dimensions. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett

◆ PIOc_inq_vartype()

int PIOc_inq_vartype ( int  ncid,
int  varid,
nc_type *  xtypep 
)

Find the type of a variable.

Parameters
ncidthe ncid of the open file.
varidthe variable ID.
xtypepa pointer that will get the type of the attribute. Ignored if NULL.
Returns
PIO_NOERR for success, error code otherwise.
Author
Jim Edwards, Ed Hartnett