Skip to content

Commit 884688b

Browse files
Merge pull request #636 from JonathanGregory/issue620
Clarify the prohibition of numerical factors and offsets in `units`
2 parents 25d076b + 49ef33b commit 884688b

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

ch03.adoc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ The COARDS conventions prohibit the unit `degrees` altogether, but this unit is
2626
The unit `degrees` is also allowed on coordinate variables such as the latitude and longitude coordinates of a transformed grid.
2727
In this case the coordinate values are not true latitudes and longitudes, which must always be identified using the more specific forms of `degrees` as described in <<latitude-coordinate>> and <<longitude-coordinate>>.
2828

29+
See <<units-multiples>> concerning the use of scale factors and offsets for units and data.
30+
2931

3032
[[dimensionless-units, Section 3.1.1, "Dimensionless units"]]
3133
==== Dimensionless units
@@ -45,10 +47,6 @@ Information describing a dimensionless physical quantity itself (e.g.
4547
As an exception, to maintain backwards compatibility with COARDS, the text strings `level`, `layer`, and `sigma_level` are allowed in the **`units`** attribute, in order to indicate dimensionless vertical coordinates.
4648
This use of **`units`** is not compatible with UDUNITS, and is deprecated by these conventions because conventions for more precisely identifying dimensionless vertical coordinates are available (see <<dimensionless-vertical-coordinate>>).
4749

48-
The UDUNITS syntax that allows scale factors and offsets to be applied to a unit is not supported by these conventions, except for case of specifying reference time, see section <<time-coordinate>>.
49-
The application of any scale factors or offsets to data should be indicated by the **`scale_factor`** and **`add_offset`** attributes.
50-
Use of these attributes for data packing, which is their most important application, is discussed in detail in <<packed-data>>.
51-
5250

5351
[[temperature-units, Section 3.1.2, "Temperature units"]]
5452
==== Temperature units
@@ -113,11 +111,14 @@ For instance, when temperature is on-scale, a value in `kg degree_C m-2` can be
113111
==== Scale factors and offsets
114112

115113
UDUNITS recognises the <<SI>> prefixes shown in <<table-supported-units, Table 3.1>> for decimal multiples and submultiples of units, and allows them to be applied to non-SI units as well.
116-
UDUNITS offers a syntax for indicating arbitrary scale factors and offsets to be applied to a unit.
117-
(Note that this is different from the scale factors and offsets used for converting between **`units`**, as discussed for temperature in <<temperature-units>>.)
118-
This UDUNITS syntax for arbitrary transformation of **`units`** is not supported by the CF conventions, except for the case of specifying reference time (<<time-coordinate>>).
119-
The application of any scale factors or offsets to data should be indicated by the **`scale_factor`** and **`add_offset`** attributes.
120-
Use of these attributes for data packing, which is their most important application, is discussed in detail in <<packed-data>>.
114+
115+
UDUNITS offers a syntax of its own for indicating arbitrary scale factors and offsets to be applied to a unit of measure named in the **`units`** attribute.
116+
(Note that this facility is not related to the scale factors and offsets used for converting between different units of measure, as discussed for temperature in <<temperature-units>>.)
117+
The UDUNITS syntax allows dimensionless numbers to appear in **`units`**, as multiplicative factors before the name of the unit and as additive offsets to the named unit (following `@` or various keywords).
118+
This UDUNITS syntax for arbitrary transformation of **`units`** must not be used with the CF conventions, except for offsets following **`since`** for specifying reference time (<<time-coordinate>>.
119+
120+
The application of any scale factors or offsets to the data values, without altering the **`units`**, should be indicated by the **`scale_factor`** and **`add_offset`** attributes.
121+
Use of these attributes for data compression, which is their most important application, is discussed in detail in <<packed-data>>.
121122

122123
[[table-supported-units]]
123124
.Prefixes for decimal multiples and submultiples of units

conformance.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ References can be absolute, relative or with no path, in which case, the variabl
183183
* The **`units`** attribute is required for all variables that represent dimensional quantities (except for boundary variables defined in https://cfconventions.org/cf-conventions/cf-conventions.html#cell-boundaries[section 7.1] and climatology boundary variables defined in https://cfconventions.org/cf-conventions/cf-conventions.html#climatological-statistics[section 7.4]).
184184
* The type of the **`units`** attribute is a string that must be recognizable by the UDUNITS package.
185185
Exceptions are the units **`level`**, **`layer`**, and **`sigma_level`**.
186+
* The **`units`** string must not contain literal numbers (integer or real) as factors or offsets to a named unit of measure.
187+
An equivalent statement, using the syntax and terms of the link:$$https://docs.unidata.ucar.edu/udunits/current/udunits2lib.html#Grammar$$[UDUNITS Unit Grammar], is that **`INT`** or **`REAL`** are not allowed in a **`units`** string that contains **`ID`**, except for the specification of a reference time in the units of time coordinates.
186188
* Dimensionless units for volume fractions defined by UDUNITS (**`ppv`**, **`ppmv`**, **`ppbv`**, **`pptv`**, **`ppqv`**) are not allowed in the **`units`** attribute of any variable which also has a **`standard_name`** attribute.
187189
* If present, the **`units_metadata`** attribute must have one of these values: `temperature: on_scale`, `temperature: difference`, `temperature: unknown`, `leap_seconds: none`, `leap_seconds: utc`, or `leap_seconds: unknown`.
188190
* The **`units`** of a variable that specifies a **`standard_name`** must be physically equivalent to the canonical units given in the standard name table, as modified by the **`standard_name`** modifier, if there is one, according to Appendix C, and then modified by all the methods listed in order by the **`cell_methods`** attribute, if one is present, according to Appendix E.

history.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77

88
=== Version 1.14-draft
99

10+
* {issues}610[Issue #610]: Clarify the CF prohibition of the UDUNITS syntax for scale factors and additive offsets to units
1011
* {issues}635[Issue #635]: Revision of section 4.3 to improve its clarity
11-
* {issues}623[Issue #623]: Consistently refer to "CF conventions" and use of impersonal from.
12+
* {issues}623[Issue #623]: Consistently refer to "CF conventions" and use of impersonal form
1213

1314
=== Version 1.13 (17 December 2025)
1415

0 commit comments

Comments
 (0)