3.1.1 Creating a NetCDF File in C
Use nc_create to create a file. Then use nc_def_dim to define each
shared dimension. The data variables are then specified with
nc_def_var. Any attributes are added with nc_put_att. Finally, call
nc_enddef to tell the library that you are done defining the metadata,
and ready to start writing the data.
After all data are written to the file, call nc_close to ensure that
all buffers are flushed, and any resources associated with the
open file are returned to the operating system.
For a very simple example, See simple_xy in C.
For a typical sequence of calls to the C versions of these functions,
see See Creating a NetCDF Dataset (The NetCDF C Interface Guide).