netCDF
4.2.1.1
|
NetCDF-4 added support for hierarchical groups within netCDF datasets. More...
NetCDF-4 added support for hierarchical groups within netCDF datasets.
Groups are identified with a ncid, which identifies both the open file, and the group within that file. When a file is opened with nc_open or nc_create, the ncid for the root group of that file is provided. Using that as a starting point, users can add new groups, or list and navigate existing groups.
All netCDF calls take a ncid which determines where the call will take its action. For example, the nc_def_var function takes a ncid as its first parameter. It will create a variable in whichever group its ncid refers to. Use the root ncid provided by nc_create or nc_open to create a variable in the root group. Or use nc_def_grp to create a group and use its ncid to define a variable in the new group.
Variable are only visible in the group in which they are defined. The same applies to attributes. “Global” attributes are associated with the group whose ncid is used.
Dimensions are visible in their groups, and all child groups.
Group operations are only permitted on netCDF-4 files - that is, files created with the HDF5 flag in nc_create(). Groups are not compatible with the netCDF classic data model, so files created with the NC_CLASSIC_MODEL file cannot contain groups (except the root group).