Previous: Using Contiguous Variables Next: What NetCDF Developers Should Know About HDF5 Table of contents Frames 2010 Unidata NetCDF Workshop > Chunking and Deflating Data with NetCDF-4

18.12 Example of Contiguous Variable
A contiguous storage variable is created in this example.

 

The following example, from libsrc4/tst_vars2.c, creates a variable with contiguous storage.

      /* Create a netcdf-4 file with one dim and one var. */
      if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
      if (nc_def_dim(ncid, DIM6_NAME, DIM6_LEN, &dimids[0])) ERR;
      if (dimids[0] != 0) ERR;
      if (nc_def_var(ncid, VAR_NAME6, NC_INT, NDIMS6, dimids, &varid)) ERR;
      if (nc_def_var_chunking(ncid, varid, 1, NULL)) ERR;
      if (nc_put_var_int(ncid, varid, data)) ERR;

 


Previous: Using Contiguous Variables Next: What NetCDF Developers Should Know About HDF5 Table of contents Frames 2010 Unidata NetCDF Workshop > Chunking and Deflating Data with NetCDF-4