Documentation Center

  • Trial Software
  • Product Updates

netcdf.inqFormat

Determine format of NetCDF file

Syntax

format = netcdf.inqFormat(ncid)

Description

format = netcdf.inqFormat(ncid) returns the format for the file specified by NetCDF file identifier, ncid.

Input Arguments

ncid

Identifier of a NetCDF file, returned by netcdf.create or netcdf.open, or of a NetCDF group, returned by netcdf.defGrp.

Output Arguments

format

Text string that specifies the format of the NetCDF file. Values include:

Format StringDescription
FORMAT_CLASSICClassic format — Original NetCDF format, used by all NetCDF files created between 1989 and 2004
FORMAT_64BITClassic format, 64–bit — Original format with 64–bit addressing capability to allow creation and access of much larger files.
FORMAT_NETCDF4Enhanced model, HDF5-based — Introduced in 2008, NetCDF, version 4, extends the classic model and is based on HDF5.
FORMAT_NETCDF4_CLASSICClassic model, HDF5-based — Introduced in 2008, NetCDF, version 4, implements classic model but is based on HDF5.

Examples

This example opens the sample NetCDF file and determines the format.

ncid = netcdf.open('example.nc','NOWRITE');
fmt = netcdf.inqFormat(ncid)

format =

FORMAT_NETCDF4

netcdf.close(ncid);

References

This function corresponds to the nc_inq_format function in the NetCDF library C API.

For copyright information, read the netcdfcopyright.txt and mexnccopyright.txt files.

See Also

|

Was this topic helpful?