Recommendation:

We recommend that user-defined group, variable, and attribute names follow the Climate and Forecast (CF) convention's specification. The names shall comply with this regular expression: [A-Za-z][A-Za-z0-9_]* . Exempt are system-defined names for any of these objects that are required by various APIs or conventions.

Recommendation Details: Character sets for naming objects in HDF5 or netCDF files differ. The most permissive is the HDF5 character set while most restrictive is the CF character set, hence, we recommend the CF rules to achieve the largest possible naming interoperability. Below are excerpts from the HDF5 and netCDF users guides, as well as the CF convention.

HDF5 User’s Guide:

A path name is a string of components separated by “/”. Each component is the name of a link or the special character “.” for the current group. Link names (components) can be any string of Unicode characters not containing “/” (except the string “.” which is reserved). However, users are advised to avoid the use of punctuation and non-printing characters because they may create problems for other software.

NetCDF User Guide (NUG):

The names of dimensions, variables and attributes (and, in netCDF-4 files, groups, user-defined types, compound member names, and enumeration symbols) consist of arbitrary sequences of alphanumeric characters, underscore “_”, period “.”, plus “+”, hyphen “-”, or at sign “@”, but beginning with an alphanumeric character or underscore. However, names commencing with underscore are reserved for system use.

Beginning with versions 3.6.3 and 4.0, names may also include UTF-8 encoded Unicode characters as well as other special characters, except for the character “/”, which may not appear in a name. Names that have trailing space characters are also not permitted.

CF Metadata Conventions:

Variable, dimension and attribute names should begin with a letter and be composed of letters, digits, and underscores. Note that this is in conformance with the COARDS conventions but is more restrictive than the netCDF interface which allows use of the hyphen character. The netCDF interface also allows leading underscores in names, but the NUG states that this is reserved for system use.