From d2483e3800961848fe273990964bb34a71d7acdb Mon Sep 17 00:00:00 2001
From: Uwe Schulzweida <uwe.schulzweida@mpimet.mpg.de>
Date: Thu, 19 Jan 2017 13:14:13 +0100
Subject: [PATCH] cdf_def_zaxis_hybrid_cf: check number of hybrid levels.

---
 src/stream_cdf_o.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/stream_cdf_o.c b/src/stream_cdf_o.c
index d17312a5d..c86a9a289 100644
--- a/src/stream_cdf_o.c
+++ b/src/stream_cdf_o.c
@@ -1705,7 +1705,7 @@ void cdf_def_zaxis_hybrid_cf(stream_t *streamptr, int type, int *ncvaridp, int z
   //if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
     {
       size_t nvertex = 2;
-      if ( nc_inq_dimid(fileID, bndsName, &nvdimID) != NC_NOERR )
+      if ( dimlen > 1 && nc_inq_dimid(fileID, bndsName, &nvdimID) != NC_NOERR )
         cdf_def_dim(fileID, bndsName, nvertex, &nvdimID);
 
       if ( nvdimID != CDI_UNDEFID )
-- 
GitLab