Previous: nc_rename_dim, Up: Dimensions
In netCDF-4 files, it's possible to have multiple unlimited dimensions. This function returns a list of the unlimited dimension ids visible in a group.
Dimensions are visible in a group if they have been defined in that group, or any ancestor group.
int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp);
ncidnunlimdimspunlimdimidspNC_NOERRNC_EBADIDNC_ENOTNC4NC_ESTRICTNC3NC_EHDFERR int root_ncid, num_unlimdims, unlimdims[NC_MAX_DIMS];
char file[] = "nc4_test.nc";
int res;
/* Open the file. */
if ((res = nc_open(file, NC_NOWRITE, &root_ncid)))
return res;
/* Find out if there are any unlimited dimensions in the root
group. */
if ((res = nc_inq_unlimdims(root_ncid, &num_unlimdims, unlimdims)))
return res;
printf("nc_inq_unlimdims reports %d unlimited dimensions\n", num_unlimdims);