diff --git a/ChangeLog b/ChangeLog index 889874a6449de8a9c347b74c2157b8246a751f2e..3097a0e18429120f15c4149192f8848cd6d7d637 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2022-11-16 Uwe Schulzweida + + * cdf_read_xcoord: skip char coordinates only if ndims=1 (bug fix) + 2022-11-13 Uwe Schulzweida * Added interface function streamOpenReadQuery(); diff --git a/src/stream_cdf_i.c b/src/stream_cdf_i.c index 57a00efd3e788cfec6c0ad856aa1660cf2c62c81..a4e45f8fe102b402b7a08e1307913c13cb615419 100644 --- a/src/stream_cdf_i.c +++ b/src/stream_cdf_i.c @@ -2278,13 +2278,13 @@ cdf_read_xcoord(stream_t *streamptr, struct cdfLazyGrid *lazyGrid, ncdim_t *ncdi grid_t *grid = &lazyGrid->base; bool skipvar = true; *isLon = axisvar->isLon; - int ndims = axisvar->ndims; + const int ndims = axisvar->ndims; size_t size = 0; - if (xtypeIsText(axisvar->xtype)) + if (ndims == 1 && xtypeIsText(axisvar->xtype)) { ncvar->varStatus = CoordVar; - Warning("Unsupported coordinate type (char/string), skipped variable %s!", ncvar->name); + Warning("Unsupported x-coordinate type (char/string), skipped variable %s!", ncvar->name); return true; } @@ -2361,13 +2361,13 @@ cdf_read_ycoord(stream_t *streamptr, struct cdfLazyGrid *lazyGrid, ncdim_t *ncdi grid_t *grid = &lazyGrid->base; bool skipvar = true; *isLat = axisvar->isLat; - int ndims = axisvar->ndims; + const int ndims = axisvar->ndims; size_t size = 0; - if (xtypeIsText(axisvar->xtype)) + if (ndims == 1 && xtypeIsText(axisvar->xtype)) { ncvar->varStatus = CoordVar; - Warning("Unsupported coordinate type (char/string), skipped variable %s!", ncvar->name); + Warning("Unsupported y-coordinate type (char/string), skipped variable %s!", ncvar->name); return true; }