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 */