Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Next: , Previous: nc_inq_var_deflate, Up: Variables


6.12 Define Checksum Parameters for a Variable: nc_def_var_fletcher32

The function nc_def_var_fletcher32 sets the checksum parameters for a variable in a netCDF-4 file.

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

Usage

     nc_def_var_fletcher32(int ncid, int varid, int checksum);
ncid
NetCDF ID, from a previous call to nc_open or nc_create.
varid
Variable ID.
checksum
If this is NC_FLETCHER32, fletcher32 checksums will be turned on for this variable.

Errors

nc_def_var_fletcher32 returns the value NC_NOERR if no errors occurred. Otherwise, the returned status indicates an error.

Possible return codes include:

NC_NOERR
No error.
NC_BADID
Bad ncid.
NC_ENOTNC4
Not a netCDF-4 file.
NC_ENOTVAR
Can't find this variable.
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 enddef has been called, it is impossible to set the checksum property for a variable.
NC_ENOTINDEFINE
Not in define mode. This is returned for netCDF classic or 64-bit offset files, or for netCDF-4 files, when they were been created with NC_STRICT_NC3 flag. (see nc_create).
NC_EPERM
Attempt to create object in read-only file.

Example


       
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690