Previous: The New String Type in NetCDF-4 Next: Multiple Unlimited Dimensions in NetCDF-4 Table of contents Frames User guide
2007 Unidata NetCDF Workshop for Developers and Data Providers > Using NetCDF-4 Features, Part 1

12.10 Automatic enddef and redef in NetCDF-4
There is no need to call the enddef or redef functions for netCDF-4 files.

 

As demonstated, the enddef call is not required for netCDF-4 files. In the code below, it will be called automatically by the nc_put_vara_ function.

      /* Create a file with one unlimied dim and nothing else. */
      if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
      if (nc_def_dim(ncid, LEVEL_NAME, NC_UNLIMITED, &dimids[0])) ERR;
      if (nc_def_var(ncid, LEVEL_NAME, NC_UINT64, 1, dimids,
		     &level_varid)) ERR;

      /* Now write one record of data to the var. */
      start[0] = 0;
      count[0] = 1;
      if (nc_put_vara_ulonglong(ncid, 0, start, count, uint64_data)) ERR;

 


Previous: The New String Type in NetCDF-4 Next: Multiple Unlimited Dimensions in NetCDF-4 Table of contents Frames User guide
2007 Unidata NetCDF Workshop for Developers and Data Providers > Using NetCDF-4 Features, Part 1