Given an ncid and group name (NULL or "" gets root group), return ncid of the named group.
int nc_inq_ncid(int ncid, char *name, int *grp_ncid);
ncidnamegrp_ncidNC_NOERRNC_EBADIDNC_ENOTNC4NC_ESTRICTNC3NC_EHDFERR int root_ncid, child_ncid;
char file[] = "nc4_test.nc";
/* Open the file. */
if ((res = nc_open(file, NC_NOWRITE, &root_ncid)))
return res;
/* Get the ncid of an existing group. */
if ((res = nc_inq_ncid(root_ncid, "group1", &child_ncid)))
return res;