Next: ncmpi_fill_var_rec, Previous: ncmpi_def_var_fill, Up: Variables [Index]
ncmpi_inq_var_fill
The API ncmpi_inq_var_fill returns the fill mode settings for a variable. This API is only available in version 1.6.1 and later.
This API is an independent subroutine.
This API can be called while the file is in either define or data mode.
int ncmpi_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_value);
ncid
NetCDF ID, from a previous call to ncmpi_open or ncmpi_create.
varid
Variable ID. Different MPI processes may use different variable IDs.
no_fill
Pointer to an integer which will get a 1 if no_fill mode is set for this variable, 0 if no_fill mode is false. See ncmpi_def_var_fill for turning on and off the fill mode for a variable. This argument will be ignored if it is NULL.
fill_value
A pointer which will get the fill value for this variable. This argument will be ignored if it is NULL.
ncmpi_inq_var_fill returns the value NC_NOERR if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:
Here is an example using ncmpi_def_var to create a variable named rh of type double with three dimensions. Calling ncmpi_def_var_fill to turn on the variable’s fill mode with the PnetCDF default fill value. Later in data mode, it calls ncmpi_inq_var_fill to inquire the fill mode settings of the variable.
#include <pnetcdf.h> int no_fill; double fill_value_in; ... /* create a file */ ... /* define dimensions */ status = ncmpi_def_var(ncid, "rh", NC_DOUBLE, 3, dimids, &varid); if (status != NC_NOERR) handle_error(status); status = ncmpi_def_var_fill(ncid, varid, 0, NULL); if (status != NC_NOERR) handle_error(status); status = ncmpi_enddef(ncid); if (status != NC_NOERR) handle_error(status); ... /* check fill mode settings for variable "rh" */ status = ncmpi_inq_var_fill(ncid, varid, &no_fill, &fill_value_in); if (status != NC_NOERR) handle_error(status);
Next: ncmpi_fill_var_rec, Previous: ncmpi_def_var_fill, Up: Variables [Index]