|
|
|||
|
||||
NF_DEF_VAR_FLETCHER32The function NF_DEF_VAR_FLETCHER32 sets the fletcher32 parameters for a variable in a netCDF-4 file.
This function must be called after the variable is defined, but before NC_ENDDEF is called.
NF_DEF_VAR_FLETCHER32(INTEGER NCID, INTEGER VARID, INTEGER FLETCHER32);
NCIDVARIDFLETCHER32NF_DEF_VAR_FLETCHER32 returns the value NF_NOERR if no errors occurred. Otherwise, the returned status indicates an error.
Possible return codes include:
NF_NOERRNF_BADIDNF_ENOTNC4NF_ENOTVARNF_ELATEDEFNF_ENOTINDEFINENF_EPERMIn this example from nf_test/ftst_vars.F, the variable in a file has the Fletcher32 checksum filter turned on.
C Create the netCDF file.
retval = nf_create(FILE_NAME, NF_NETCDF4, ncid)
if (retval .ne. nf_noerr) call handle_err(retval)
C Define the dimensions.
retval = nf_def_dim(ncid, "x", NX, x_dimid)
if (retval .ne. nf_noerr) call handle_err(retval)
retval = nf_def_dim(ncid, "y", NY, y_dimid)
if (retval .ne. nf_noerr) call handle_err(retval)
C Define the variable.
dimids(1) = y_dimid
dimids(2) = x_dimid
retval = NF_DEF_VAR(ncid, "data", NF_INT, NDIMS, dimids, varid)
if (retval .ne. nf_noerr) call handle_err(retval)
C Turn on chunking.
chunks(1) = NY
chunks(2) = NX
retval = NF_DEF_VAR_chunking(ncid, varid, 0, chunks)
if (retval .ne. nf_noerr) call handle_err(retval)
C Turn on deflate, fletcher32.
retval = NF_DEF_VAR_deflate(ncid, varid, 0, 1, 4)
if (retval .ne. nf_noerr) call handle_err(retval)
retval = NF_DEF_VAR_fletcher32(ncid, varid, 1)
if (retval .ne. nf_noerr) call handle_err(retval)
| Contact Us Site Map Search Terms and Conditions Privacy Policy Participation Policy | ||||||
|
||||||