Previous topic

NC_MapInterpolation

Next topic

nc_redef

This Page

nc_openΒΆ

nc_open opens an existing data file.

ncid = nc_open(ssFileName)
ncid = nc_open(ssFileName, nOpenMode)

Return Value

If the function succeeds, the return value is the handle of the netCDF file. If the function fails, the return value is -1.

Parameters

ssFileName

ssFileName is the complete file name.

nOpenMode

nOpenMode is NC_WRITE or NC_NOWRITE.

Value Meaning
NC_WRITE Opens the file for writing.
NC_NOWRITE Opens the file read-only.

Example

ncid = nc_open("d:\\dat\\test.nc", NC_NOWRITE);
if (ncid == -1) {
    error();
}
...
nc_close(ncid);

History

Version Description
R2012 (5.40.0)  

id-1781578