Only write the coord dimids if ndims >= 1
It looks like some vars have ndims==0 in which case the coord_dimids should not be written. Modify patch to catch those cases.
@@ -992,6 +992,7 @@ var_create_dataset(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, nc_bool_t write_dimid
/* Always write the hidden coordinates attribute, which lists the
* dimids of this var. When present, this speeds opens. When no
* present, dimscale matching is used. */
+ if (var->ndims)
if ((retval = write_coord_dimids(var)))
BAIL(retval);
