Previous: Using Contiguous Variables Next: Parallel I/O with NetCDF Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > Chunking Data with NetCDF-4

12.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: Parallel I/O with NetCDF Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > Chunking Data with NetCDF-4