Previous: NetCDF Examples for C, Java, F90, F77, and C++ Next: Reading a NetCDF Dataset with Known Names Table of contents Frames 2012 Unidata NetCDF Workshop > Using netCDF in programs

11.1 Creating a NetCDF Dataset
Abstract code for creating a netCDF dataset.

Here is a typical sequence of netCDF calls used to create a new netCDF dataset (with arguments and error handling not shown):

    nc_create           /* create netCDF dataset: enter define mode */
         ...
       nc_def_dim       /* define dimensions: from name and length */
         ...
       nc_def_var       /* define variables: from name, type, ... */
         ...
       nc_put_att       /* define attributes and assign attribute values */
         ...
    nc_enddef           /* end definitions: leave define mode */
         ...
       nc_put_var       /* provide values for variables */
         ...
    nc_close            /* close: save new netCDF dataset */

 


Previous: NetCDF Examples for C, Java, F90, F77, and C++ Next: Reading a NetCDF Dataset with Known Names Table of contents Frames 2012 Unidata NetCDF Workshop > Using netCDF in programs