Catch Xarray dimension inconsistencies

This commit is contained in:
Dennis Heimbigner 2022-09-04 13:45:29 -06:00
parent 7e48f2ad7b
commit 00a80ec8f9

View File

@ -2163,9 +2163,12 @@ parsedimrefs(NC_FILE_INFO_T* file, NClist* dimnames, size64_t* shape, NC_DIM_INF
/* If not found and create then create it */
if((stat = createdim(file, dimname, shape[i], &dims[i])))
goto done;
} else {
/* Verify consistency */
if(dims[i]->len != shape[i])
{stat = NC_EDIMSIZE; goto done;}
}
assert(dims[i] != NULL);
assert(dims[i]->len == shape[i]);
}
done:
nclistfreeall(segments);