PIO
2.5.4
|
Define a new variable in the file in C. More...
Functions | |
int | PIOc_def_var (int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp) |
The PIO-C interface for the NetCDF function nc_def_var. More... | |
int | PIOc_def_var_fill (int ncid, int varid, int fill_mode, const void *fill_valuep) |
Set the fill value for a variable. More... | |
int | PIOc_def_var_deflate (int ncid, int varid, int shuffle, int deflate, int deflate_level) |
Set deflate (zlib) settings for a variable. More... | |
int | PIOc_def_var_chunking (int ncid, int varid, int storage, const PIO_Offset *chunksizesp) |
Set chunksizes for a variable. More... | |
int | PIOc_def_var_endian (int ncid, int varid, int endian) |
Set chunksizes for a variable. More... | |
int | PIOc_set_chunk_cache (int iosysid, int iotype, PIO_Offset size, PIO_Offset nelems, float preemption) |
Set chunk cache netCDF files to be opened/created. More... | |
int | PIOc_get_chunk_cache (int iosysid, int iotype, PIO_Offset *sizep, PIO_Offset *nelemsp, float *preemptionp) |
Get current file chunk cache settings from HDF5. More... | |
int | PIOc_set_var_chunk_cache (int ncid, int varid, PIO_Offset size, PIO_Offset nelems, float preemption) |
Set chunksizes for a variable. More... | |
Define a new variable in the file in C.
int PIOc_def_var | ( | int | ncid, |
const char * | name, | ||
nc_type | xtype, | ||
int | ndims, | ||
const int * | dimidsp, | ||
int * | varidp | ||
) |
The PIO-C interface for the NetCDF function nc_def_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
ncid | the ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile(). |
name | the variable name. |
xtype | the PIO_TYPE of the variable. |
ndims | the number of dimensions. |
dimidsp | pointer to array of dimension IDs. |
varidp | a pointer that will get the variable ID. |
int PIOc_def_var_chunking | ( | int | ncid, |
int | varid, | ||
int | storage, | ||
const PIO_Offset * | chunksizesp | ||
) |
Set 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.
Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.
See the netCDF variable documentation for details about the operation of this function.
ncid | the ncid of the open file. |
varid | the ID of the variable to set chunksizes for. |
storage | NC_CONTIGUOUS or NC_CHUNKED. |
chunksizesp | an array of chunksizes. Must have a chunksize for every variable dimension. |
int PIOc_def_var_deflate | ( | int | ncid, |
int | varid, | ||
int | shuffle, | ||
int | deflate, | ||
int | deflate_level | ||
) |
Set deflate (zlib) settings 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.
ncid | the ncid of the open file. |
varid | the ID of the variable. |
shuffle | non-zero to turn on shuffle filter. |
deflate | non-zero to turn on zlib compression for this variable. |
deflate_level | 1 to 9, with 1 being faster and 9 being more compressed. |
int PIOc_def_var_endian | ( | int | ncid, |
int | varid, | ||
int | endian | ||
) |
Set 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.
Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.
ncid | the ncid of the open file. |
varid | the ID of the variable to set chunksizes for. |
endian | NC_ENDIAN_NATIVE, NC_ENDIAN_LITTLE, or NC_ENDIAN_BIG. |
int PIOc_def_var_fill | ( | int | ncid, |
int | varid, | ||
int | fill_mode, | ||
const void * | fill_valuep | ||
) |
Set the fill value for a variable.
See the netCDF variable documentation for details about the operation of this function.
When the fill mode for the file is NC_FILL, then fill values are used for missing data. This function sets the fill value to be used for a variable. If no specific fill value is set (as a _FillValue attribute), then the default fill values from netcdf.h are used.
NetCDF-4 and pnetcdf files allow setting fill_mode (to NC_FILL or NC_NOFILL) on a per-variable basis. NetCDF classic only allows the fill_mode setting to be set for the whole file. For this function, the fill_mode parameter is ignored for classic files. Set the file-level fill mode with PIOc_set_fill().
ncid | the ncid of the open file. |
varid | the ID of the variable to set chunksizes for. |
fill_mode | fill mode for this variable (NC_FILL or NC_NOFILL) |
fill_valuep | pointer to the fill value to be used if fill_mode is set to NC_FILL. |
int PIOc_get_chunk_cache | ( | int | iosysid, |
int | iotype, | ||
PIO_Offset * | sizep, | ||
PIO_Offset * | nelemsp, | ||
float * | preemptionp | ||
) |
Get current file chunk cache settings from HDF5.
This function has no effect on netCDF classic files. Calling this function with iotype of PIO_IOTYPE_PNETCDF or PIO_IOTYPE_NETCDF returns an error.
The file chunk cache for HDF5 can be set, and will apply for any files opened or created until the program ends, or the settings are changed again. The cache settings apply only to the open file. They do not persist with the file, and must be set each time the file is opened, before it is opened, if they are to have effect.
See the netCDF variable documentation for details about the operation of this function.
Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.
iosysid | the IO system ID. |
iotype | the iotype of files to be created or opened. |
sizep | gets the size of file cache. |
nelemsp | gets the number of elements in file cache. |
preemptionp | gets the preemption setting for file cache. |
int PIOc_set_chunk_cache | ( | int | iosysid, |
int | iotype, | ||
PIO_Offset | size, | ||
PIO_Offset | nelems, | ||
float | preemption | ||
) |
Set chunk cache netCDF files to be opened/created.
This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.
The file chunk cache for HDF5 can be set, and will apply for any files opened or created until the program ends, or the settings are changed again. The cache settings apply only to the open file. They do not persist with the file, and must be set each time the file is opened, before it is opened, if they are to have effect.
See the netCDF variable documentation for details about the operation of this function.
iosysid | the IO system ID. |
iotype | the iotype of files to be created or opened. |
size | size of file cache. |
nelems | number of elements in file cache. |
preemption | preemption setting for file cache. |
int PIOc_set_var_chunk_cache | ( | int | ncid, |
int | varid, | ||
PIO_Offset | size, | ||
PIO_Offset | nelems, | ||
float | preemption | ||
) |
Set 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.
Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.
ncid | the ncid of the open file. |
varid | the ID of the variable to set chunksizes for. |
size | the size in bytes for the cache. |
nelems | the number of elements in the cache. |
preemption | the cache preemption value. |