3.8 Find a Group's Parent: NF_INQ_GRP_PARENT
Given ncid, find the ncid of the parent group.
When used with the root group, this function returns the NF_ENOGRP
error (since the root group has no parent.)
Usage
INTEGER FUNCTION NF_INQ_GRP_PARENT(INTEGER NCID, INTEGER PARENT_NCID)
NCID- The group id.
PARENT_NCID- The ncid of the parent group will be copied here.
Errors
NF_NOERR- No error.
NF_EBADID- Bad group id.
NF_ENOGRP- No parent group found (i.e. this is the root group).
NF_ENOTNC4- Attempting a netCDF-4 operation on a netCDF-3 file. NetCDF-4
operations can only be performed on files defined with a create mode
which includes flag HDF5. (see NF_OPEN).
NF_ESTRICTNC3- This file was created with the strict netcdf-3 flag, therefore
netcdf-4 operations are not allowed. (see NF_OPEN).
NF_EHDFERR- An error was reported by the HDF5 layer.
Example
This example is from nf_test/ftst_groups.F.
C Check the parent ncid.
retval = nf_inq_grp_parent(grpids(1), grpid_in)
if (retval .ne. nf_noerr) call handle_err(retval)