2011 Unidata NetCDF Workshop > Using Groups and NetCDF-4 Types
16.1 What are Groups?
NetCDF-4 files can organize variables, dimensions, and attributes in
hierarchical groups.
- Groups are like directories in a file system, except they are all
within a file.
- Group IDs are analogous to netCDF IDs. In programs, the IDs of
all groups in open files are distinct,
and depend on the order in which files are opened. So group IDs may
differ between different openings of the same file.
- Every file contains at least the root group. The ncid of the root
groups is returned on an open or create.
- Groups (other than the root group) are part of the enhanced
model. Using groups means that netCDF software linked to a netCDF-3
library will not be able to read the file.
- Use of Groups is
optional, with backward compatibility maintained by putting everything
in the top-level unnamed Group.
- A "global" attribute is now global to the group, not the file.
- Recursion is one way to handle nested groups. The nccopy utility
uses a simpler way to iterate through all groups in a netCDF file.
- Unlike HDF5, netCDF-4 requires
that Groups form a strict hierarchy.
- In netCDF-4, dimensions are scoped such that they can be seen in
all child groups.
2011 Unidata NetCDF Workshop > Using Groups and NetCDF-4 Types