Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 
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

 
 
  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