diff --git a/src/cdf.c b/src/cdf.c index e9f91b8d1f1d9b1215a3e7275546b6cbde3ad75b..40a0cf202a63297d08762d54726e8d8a309e43ba 100644 --- a/src/cdf.c +++ b/src/cdf.c @@ -128,7 +128,7 @@ cdfOpenFile(const char *filename, const char *mode, int *filetype) if (*filetype == CDI_FILETYPE_NC4C) writemode |= (NC_NETCDF4 | NC_CLASSIC_MODEL); if (*filetype == CDI_FILETYPE_NCZARR) writemode |= NC_NETCDF4; #endif - cdf_create(filename, writemode, &ncid); + cdf__create(filename, writemode, &ncid); if (CDI_Version_Info) cdfComment(ncid); cdf_put_att_text(ncid, NC_GLOBAL, "Conventions", 6, "CF-1.6"); break; @@ -213,19 +213,17 @@ cdf4Open(const char *filename, const char *mode, int *filetype) if (CDF_Debug) Message("Open %s with mode %c", filename, *mode); #ifdef HAVE_NETCDF4 - { - if (cdf4CheckLibVersions() == 0) - { - const int fileID = cdfOpenFile(filename, mode, filetype); - if (CDF_Debug) Message("File %s opened with id %d", filename, fileID); - return fileID; - } - - return CDI_EUFTYPE; - } -#endif + if (cdf4CheckLibVersions() == 0) + { + const int fileID = cdfOpenFile(filename, mode, filetype); + if (CDF_Debug) Message("File %s opened with id %d", filename, fileID); + return fileID; + } + return CDI_EUFTYPE; +#else return CDI_ELIBNAVAIL; +#endif } static void diff --git a/src/cdf_int.c b/src/cdf_int.c index f1eb4bfbee6e36456f6475c96815d7686d6240d4..e2c3f9fb353e77da02f26d188bcf27f79937226f 100644 --- a/src/cdf_int.c +++ b/src/cdf_int.c @@ -26,7 +26,7 @@ has_uri(const char *uri) } void -cdf_create(const char *path, int cmode, int *ncidp) +cdf__create(const char *path, int cmode, int *ncidp) { int status = -1; size_t chunksizehint = 0; diff --git a/src/cdf_int.h b/src/cdf_int.h index b279aa4529936873db71cee13c0edc52710f6373..9d7ac8628ee10bf3b062070f8f40164ff5323395 100644 --- a/src/cdf_int.h +++ b/src/cdf_int.h @@ -5,7 +5,7 @@ #include <netcdf.h> -void cdf_create(const char *path, int cmode, int *idp); +void cdf__create(const char *path, int cmode, int *idp); int cdf_open(const char *path, int omode, int *idp); void cdf_close(int ncid); diff --git a/src/stream.c b/src/stream.c index 8add1ad78d87386a83aea129be109267db4b8ee3..43e4fcc0cada4dd465b1e580dd81dc3166e1495c 100644 --- a/src/stream.c +++ b/src/stream.c @@ -736,12 +736,16 @@ streamOpenA(const char *filename, const char *filemode, int filetype) } case CDI_FILETYPE_NC4: case CDI_FILETYPE_NC4C: - case CDI_FILETYPE_NCZARR: { fileID = cdf4Open(filename, filemode, &filetype); streamptr->ncmode = 2; break; } + case CDI_FILETYPE_NCZARR: + { + Message("%s not available in append mode!", strfiletype(filetype)); + return CDI_ELIBNAVAIL; + } #endif default: {