The following IDL commands should be used to create a new netCDF file:
NCDF_CREATE: Call this procedure to begin creating a new file. The new file is put into define mode.
NCDF_DIMDEF: Create dimensions for the file.
NCDF_VARDEF: Define the variables to be used in the file.
NCDF_ATTPUT: Optionally, use attributes to describe the data.
NCDF_CONTROL, /ENDEF: Call NCDF_CONTROL and set the ENDEF keyword to leave define mode and enter data mode.
NCDF_VARPUT: Write the appropriate data to the netCDF file.
NCDF_CLOSE: Close the file.
Two example files that demonstrate the use of the netCDF routines can be found in the hdf_ncdf subdirectory of the examples subdirectory of the IDL distribution. The file nncdf_cat.pro prints a summary of basic information about a netCDF file. The file ncdf_rdwr.pro creates a new netCDF file and then reads the information back from that file.
The following example shows how to create a netCDF file, populate it with data, read data from the file, and make a simple plot from the data.The resulting graphic is shown in SHOW3 Result of Unlimited Dimensions Example .