Skip to content
Snippets Groups Projects
Commit 3df6cb4f authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

fixed error stating netcdf 4 operation applied to netcdf 3 file

parent 3a8fa4e6
No related branches found
No related tags found
1 merge request!152M300433/cmake include fixes
Pipeline #103985 passed
......@@ -721,7 +721,9 @@ streamOpenNCMem(int ncidp, char mode)
stream_t *streamptr = stream_new_entry(CDI_UNDEFID);
int streamID = CDI_ESYSTEM;
#ifdef HAVE_NETCDF4
#ifdef NC_FORMAT_64BIT_DATA // so that we ran reliably use NC5 filetype
// Not doing this can result in an error message
// that falsely states a NC3 file is being used
streamID = streamptr->self;
if (streamID < 0) return CDI_ELIMIT;
......@@ -733,7 +735,7 @@ streamOpenNCMem(int ncidp, char mode)
streamptr->filename = strdup(filename);
streamptr->filemode = mode;
streamptr->filetype = CDI_FILETYPE_NC4;
streamptr->filetype = CDI_FILETYPE_NC5;
streamptr->fileID = ncidp;
if (mode == 'r')
......@@ -746,6 +748,8 @@ streamOpenNCMem(int ncidp, char mode)
reshRemove(streamptr->self, &streamOps);
}
}
#else
Error("tried to use in memory capabilities without Netcdf4 enabled");
#endif
return streamID;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment