Find all varids for a location.
int nc_inq_varids(int ncid, int *varids);
ncidvaridsNC_NOERRNC_EBADIDNC_ENOTNC4NC_ESTRICTNC3NC_EHDFERR int root_ncid, numvars;
int *varids;
char file[] = "nc4_test.nc";
/* Open the file. */
if ((res = nc_open(file, NC_NOWRITE, &root_ncid)))
return res;
/* Get a list of varids for the root group. (That is, find out of
there are any groups already defined. */
if ((res = nc_inq_nvars(root_ncid, &numvars)))
return res;
varids = malloc(sizeof(int) * numvars);
if ((res = nc_inq_grps(root_ncid, NULL, varids)))
return res;