Dmitry Voytsekhovskiy <dvoits@xxxxxxxxx> writes:
> Hello,
> I get an HDF Layer error (-101) when I define a dimension with same name
> as a name of already defined variable:
> int ncid, dtime, vtime;
> int res = nc_create("[1]test.nc", NC_NETCDF4, out ncid);
> Handle(res);
> res = nc_def_var(ncid, "time", NC_DOUBLE, new int[] { }, out vtime);
> Handle(res);
> res = nc_def_dim(ncid, "time", 10, out dtime);
> Handle(res);
> res = nc_close(ncid);
> Handle(res); // error: res == -101
> In the opposite order it works; also it works in any order for different
> names.
> Though such use case looks weird, it is still possible for an
> inexperienced user to write similar code.
> Regards,
> Dmitry.
What are you using for the dimid of the variable?
Thanks,
Ed
--
Ed Hartnett -- ed@xxxxxxxxxxxxxxxx