NCDF_CREATE

The NCDF_CREATE function creates a new netCDF file. 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.

Calling Sequence

Result = NCDF_CREATE( Filename )

Arguments

Filename

A scalar string containing the name of the file to be created

Keywords

CLOBBER

Set this keyword to erase the existing file (if the file already exists) before creating the new version.

NOCLOBBER

Set this keyword to create a new netCDF file only if the specified file does not already exist. This is the default.

Example

id = NCDF_CREATE('test.nc',/CLOBBER) ; Open a new NetCDF File and destroy test.nc if it already exists.

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.

IDL prints:

nccreate: filename "test.nc": File exists

% NCDF_CREATE: Operation failed

% Execution halted at $MAIN$ (NCDF_CREATE).

See Also

NCDF_CLOSE , NCDF_CONTROL , NCDF_OPEN