3. NetCDF3 Encoding¶
In the NetCDF3 classic data model, semantic containers are encoded using container variables. Container variables are identified by their use of the attribute container_type and their lack of any data. A container variable may not reference any dimensions nor contain any data payload.
A NetCDF3 specific attribute is defined, container_members, which is only valid if used with a container variable. This contains a space separated list of variable names which exist is the file.
Specific container types may define attributes which reference variables within the scope of the semantic group, those referenced by the container_members attribute, enabling variables, inculding further semantic container variables to be given specific roles within the scope of the semantic container.
3.1. Variable Names¶
The variable name of a container variable name is a convenient string to use for disambiguation of variable names in netCDF3 files. The containing variable’s name may be prepended to the contained variable’s name, linked by a triple underscore ___.
3.2. Dimension Names¶
Similarly, the variable name of a container variable name is a convenient string to use for disambiguation of dimension names in netCDF3 files. The containing variable’s name may be prepended to the contained dimension’s name, linked by a triple underscore ___.
3.2.1. Degeneracy¶
There is a degenerate case where the container_type is defined as simple and no roles are defined.
In this case, the semantic container variable is semantically identical to a standard NetCDF 4 group. Interchange between these encodings does not change the meaning of the metadata at all.
When transforming to netCDF4 encoding, amended variable names will be stripped of their leading container names if used. These are identified by the triple underscore.