Commit 48448174 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

No commit message

No commit message
parent 86ee95ca
......@@ -103,6 +103,18 @@ int cdfOpenFile(const char *filename, const char *mode, int version)
fmode = 'r';
status = cdf_open(filename, readmode, &ncid);
if ( status > 0 && ncid < 0 ) ncid = CDI_ESYSTEM;
#if defined (NC_NETCDF4)
else
{
int format;
(void) nc_inq_format(ncid, &format);
if ( format == NC_FORMAT_NETCDF4 )
{
cdf_close(ncid);
ncid = CDI_EUNC4;
}
}
#endif
break;
case 'w':
case 'W':
......
......@@ -23,6 +23,7 @@ extern "C" {
#define CDI_EUFTYPE -21 /* Unsupported file type */
#define CDI_ELIBNAVAIL -22 /* xxx library not available */
#define CDI_EUFSTRUCT -23 /* Unsupported file structure */
#define CDI_EUNC4 -24 /* Unsupported netCDF4 structure */
/* File types */
......
......@@ -10,6 +10,7 @@ static char UnknownError[] = "Unknown Error";
static char _EUFTYPE[] = "Unsupported file type";
static char _ELIBNAVAIL[] = "Unsupported file type (library support not compiled in)";
static char _EUFSTRUCT[] = "Unsupported file structure";
static char _EUNC4[] = "Unsupported netCDF4 structure";
char *cdiStringError(int cdiErrno)
{
......@@ -23,6 +24,7 @@ char *cdiStringError(int cdiErrno)
case CDI_EUFTYPE: return _EUFTYPE;
case CDI_ELIBNAVAIL: return _ELIBNAVAIL;
case CDI_EUFSTRUCT: return _EUFSTRUCT;
case CDI_EUNC4: return _EUNC4;
}
return UnknownError;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment