netcdf.create
Create new netCDF dataset
Syntax
ncid = netcdf.create(filename,cmode)
[chunksize_out,ncid] = netcdf.create(filename,cmode,initsz,chunksize)
Description
ncid = netcdf.create(filename,cmode) creates a new netCDF file according
to the file creation mode. The return value ncid is a file ID. The
cmode parameter determines the type of file access. Specify
cmode as one of these values.
Value of cmode | Description |
|---|---|
'NOCLOBBER' | Prevent overwriting of existing file with the same name. |
'CLOBBER' | Overwrite any existing file with the same name. |
'SHARE' | Allow synchronous file updates. |
'64BIT_OFFSET' | Allow easier creation of files and variables which are larger than two gigabytes. |
'NETCDF4' | Create a netCDF-4/HDF5 file |
'CLASSIC_MODEL' | Enforce the classic model; has no effect unless used in a bitwise-or
with NETCDF4 |
Note
You can specify the mode as a numeric value, retrieved using
the netcdf.getConstant function. To specify more
than one mode, use a bitwise-OR of the numeric values of the modes.
[chunksize_out,ncid] = netcdf.create(filename,cmode,initsz,chunksize) creates
a new netCDF file, but with additional performance tuning parameters. initsz sets
the initial size of the file. chunksize can affect
I/O performance. The actual value chosen by the netCDF library might
not correspond to the input value.
This function corresponds to the nc_create and
nc__create functions in the netCDF library C API. To use this
function, you should be familiar with the netCDF programming paradigm.
Examples
Version History
Introduced in R2008b