CF Canonical Units and UCUM Units- Best Practice Issues
Discussion of issues concerning Tethys recommendation for Best Practice regarding choice of units to use in SOS implementations.
The Issue
The Best Practices report from the OceansIE Phase 1 report recommends using CF definitions for phenomena:
http://www.oostethys.org/best-practices/propertiesandphenomena
Questions have arisen based on CF conventions, which associate a term called "Canonical Units" to every definition. The concern was that the use of of a CF standard definition mandated the use of the Canonical Unit associated with that definition. From email discussions and further digging into the CF docs (shown in "Supporting Documentation" section), it seems that the use of CD Standard names and terms does not mandate the use of the Canonical Units associated with that term.
The current movement in SWE has been to adapt UCUM (Unified Code for Units of Measure) as the standard for specifying units. In recent telecons, OceansIE2 has informally agreed to move towards using UCUM units in future SOS implementations and Cookbook releases. We may need to clarify our position on which Units standard we intend to advocate as we move forward with Oceans IE2.
Supporting documentation
UCUM website:
CF Standard Table, with definitions and associated Canonical Units listed:
http://cf-pcmdi.llnl.gov/documents/cf-standard-names/standard-name-table/11/standard-name-table
From an OOSTethys email thread associated with this issue, John Graybeal wrote:
The role of canonical units is to (further) define what kind of thing you have (that is, whether it is really numerically comparable to something else). So the CF rule is that you have to be able to convert your units to the canonical units (e.g., feet to meters), not that they are described in the canonical units. Just specify the units in the appropriate attribute for the variable. Of course, a CF-aware application may still be confused by that, but it won't be because you aren't being compliant.
and later:
Meanwhile, there are absolutely no rules about how to use CF names in any other environment. But I would say it is a highly recommended practice to use them consistently with the canonical names -- that is, if the CF name is aligned with canonical units m/kg, don't use that name for something that has units m/m**3, for several reasons: 1) If anyone tries to put your data into a CF file they will find it is non-conforming with the CF requirements (and can't be conformed without some additional knowledge), 2) It likely represents confusion on the part of the person labeling the data/providing the name. 3) The less breakage of the existing conventions, the more interoperability in the long term. There is no conflict represented by the use of UCUM units in OOSTethys.
And taken from the CD Metadata Conventions Guide, version 1.4, Section 3.3:
canonical units Representative units of the physical quantity. Unless it is dimensionless, a variable with a standard_name attribute must have units which are physically equivalent (not necessarily identical) to the canonical units, possibly modified by an operation specified by either the standard name modifier (see below and Appendix C, Standard Name Modifiers) or by the cell_methods attribute (see Section 7.3, “Cell Methods” and Appendix E, Cell Methods).
To determine of units are "physically equivalent", it has been recommended on the CF Mailing List to use the UDUnits package provided by UCAR:
http://www.unidata.ucar.edu/software/udunits/
Here is the reference thread:
From j.m.gregory at reading.ac.uk Thu Nov 20 11:58:29 2008 From: j.m.gregory at reading.ac.uk (Jonathan Gregory) Date: Thu, 20 Nov 2008 18:58:29 +0000 Subject: [CF-metadata] physically equivalent units Message-ID: <20081120185829.GB4102@met.reading.ac.uk> Dear Phil Units can be interconverted if they differ only because of purely numerical factors. Apart from such factors all units can be translated into a product of a set of "base units" raised to various powers. In SI the base units are metre m length kilogram kg mass second s time ampere A electric current kelvin K thermodynamic temperature candela cd luminous intensity mole mol amount of substance Thus, for instance, a newton N is kg m s-2, a joule J=N m=kg m2 s-2 and a pascal is Pa=N m-2=kg m-1 s-2. Dimensionally, Pa and J m-3 are equivalent. K, degC and degF are all equivalent. A practical way to see whether two units are equivalent is to try to use udunits to convert between them. $ udunits You have: degF You want: K <K> = <degF>*0.555556 + 255.372 <K> = <degF>/1.8 + 255.372 You have: Pa You want: J m-3 <J m-3> = <Pa>*1 <J m-3> = <Pa>/1 You have: K You want: kg udunits: Units are incompatible Cheers Jonathan

