Next: , Previous: NF90_INQ_GRP_PARENT, Up: Groups


3.9 Find a Group by Name: NF90_INQ_GRP_NCID

Given a group name an an ncid, find the ncid of the group id.

Usage

       function nf90_inq_grp_ncid(ncid, name, grpid)
         integer, intent(in) :: ncid
         character (len = *), intent(in) :: name
         integer, intent(out) :: grpid
         integer :: nf90_inq_grp_ncid
     
         nf90_inq_grp_ncid = nf_inq_grp_ncid(ncid, name, grpid)
       end function nf90_inq_grp_ncid
NCID
The group id to look in.
GRP_NAME
The name of the group that should be found.
GRP_NCID
This will get the group id, if it is found.

Return Codes

The following return codes may be returned by this function.

NF90_NOERR
No error.
NF90_EBADID
Bad group id.
NF90_EINVAL
No name provided or name longer than NF90_MAX_NAME.
NF90_ENOGRP
Named group not found.
NF90_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 NF90_OPEN).
NF90_ESTRICTNC3
This file was created with the strict netcdf-3 flag, therefore netcdf-4 operations are not allowed. (see NF90_OPEN).
NF90_EHDFERR
An error was reported by the HDF5 layer.

Example

This example is from test program nf_test/f90tst_grps.f90.

       ! Get the group ids for the newly reopened file.
       call check(nf90_inq_grp_ncid(ncid, GRP1_NAME, grpid1))
       call check(nf90_inq_grp_ncid(grpid1, GRP2_NAME, grpid2))
       call check(nf90_inq_grp_ncid(grpid2, GRP3_NAME, grpid3))
       call check(nf90_inq_grp_ncid(grpid3, GRP4_NAME, grpid4))