The NCDF_CREATE function creates a new netCDF file.
Result = NCDF_CREATE( Filename [, /CLOBBER | , /NOCLOBBER] )
If successful, the netCDF ID for the file is returned. The newly-created netCDF file is automatically placed into define mode. If you do not have write permission to create the specified Filename, NCDF_CREATE returns an error message instead of a netCDF file ID.
A scalar string containing the name of the file to be created
Set this keyword to erase the existing file (if the file already exists) before creating the new version.
Set this keyword to create a new netCDF file only if the specified file does not already exist. This is the default.
; Open a new NetCDF File and destroy test.nc if it already exists: id = NCDF_CREATE('test.nc',/CLOBBER) id2 = NCDF_CREATE('test.nc', /NOCLOBBER)
This attempt to create a new version of the file
test.nc produces the following error because the NOCLOBBER keyword was set:
nccreate: filename "test.nc": File exists % NCDF_CREATE: Operation failed % Execution halted at $MAIN$ (NCDF_CREATE).
Introduced: Pre 4.0
NCDF_CLOSE, NCDF_CONTROL, NCDF_OPEN