%   MEXCDF  provides an interface between netCDF and MATLAB.  
%      This Mex-file invokes the complete C-Language NetCDF interface,
%      as described in the NetCDF Users Guide.  All of the specified
%      NetCDF input arguments are required.  All output arguments are
%      optional.
%
%      Matlab Syntax:
%
%              [out1, out2, ...] = mexcdf('operation', in1, in2, ...)
%
%      Extensions:
%
%              1.      Dimensions and variables accessible by id or name.
%              2.      Attributes accessible by name or number.
%              3.      Parameters accessible by number or name.
%              4.      Prepended "nc" not necessary for operation names.
%              5.      Prepended "NC_" not necessary for specifying parameters.
%              6.      Parameter names not case-sensitive.
%              7.      Required lengths default to actual lengths via -1.
%              8.      Scaling via "scale_factor" and "add_offset" attributes.
%              9.      SETOPTS to set NetCDF options.  NC_FATAL is disabled.
%              10.     ERR to get the error-code of the most recent operation.
%              11.     PARAMETER to access parameters by name.
%              12.     USAGE to list NCMEX syntax.
%
%
% NetCDF OPERATIONS
%  cdfid = mexcdf('CREATE', 'path', cmode); 
%  cdfid = mexcdf('OPEN', 'path', mode);
%  status = mexcdf('ENDEF', cdfid);
%  status = mexcdf('CLOSE', cdfid);
%  [ndims, nvars, natts, recdim, status] = mexcdf('INQUIRE', cdfid);
%  status = mexcdf('REDEF', cdfid);
%  status = mexcdf('SYNC', cdfid);
%  status = mexcdf('ABORT', cdfid);
%  len = mexcdf('TYPELEN', datatype);
%  old_fillmode = mexcdf('SETFILL', cdfid, fillmode);
%  old_ncopts = mexcdf('SETOPTS', ncopts);
%  ncerr = mexcdf('ERR');
%  code = mexcdf('PARAMETER', 'NC_...');
%
% DIMENSIONS
%  status = mexcdf('DIMDEF', cdfid, 'name', length);
%  dimid = mexcdf('DIMID', cdfid, 'name');
%  ['name',length,status] = mexcdf('DIMINQ', cdfid, dimid); 
%  status = mexcdf('DIMRENAME', cdfid, 'name');
% 
% VARIABLES
%  status = mexcdf('VARDEF', cdfid, 'name', datatype, ndims, [dim]);
%  status = mexcdf('VARID', cdfid, 'name');
%  ['name',datatype,ndims,[dim],natts, status] = mexcdf('VARINQ', cdfid, varid);
%  status = mexcdf('VARPUT1', cdfid, varid, [coords], value);
%  ['name',dtype,ndims,[dim],natts, status] = mexcdf('VARINQ', cdfid, varid);
%  [value,status] = mexcdf('VARGET1', cdfid, varid, [coords]);
%  status = mexcdf('VARPUT', cdfid, varid, [start], [count], [value]);
%  [value,status] = mexcdf('VARGET', cdfid, varid, [start], [count]);
%  status = mexcdf('VARRENAME', cdfid, varid, 'name');
% 
% ATTRIBUTES
%  status = mexcdf('ATTPUT', cdfid, varid, 'name', datatype, len, [value]);
%  [datatype, len, status] = mexcdf('ATTINQ', cdfid, varid, 'name');
%  [value], len, status] =  mexcdf('ATTGET', cdfid, varid, 'name');
%  status = mexcdf('ATTCOPY', incdf, invar, 'name', outcdf, outvar);
%  ['name', status] = mexcdf('ATTNAME', cdfid, varid, attnum);
%  status = mexcdf('ATTRENAME', cdfid, varid, 'name', 'newname');
%  status = mexcdf('ATTDEL', cdfid, varid, 'name');
