⇐ ⇒

[CF-metadata] Using units with a scale factor

From: Taylor, Karl E. <taylor13>
Date: Thu, 1 Nov 2018 16:58:08 +0000

Hi Martin,

I think the main point of the relevant paragraph in section 3.1, which reads

"The Udunits syntax that allows scale factors and offsets to be applied to a unit is not supported by this standard. The application of any scale factors or offsets to data should be indicated by the scale_factor and add_offset attributes. Use of these attributes for data packing, which is their most important application, is discussed in detail in Section 8.1, "Packed Data"<http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html#packed-data>."

is that if you want to pack the data, the proper way to do that is through scale_factor and add_offset, not through the scale and offset options allowed by udunits in the units attribute. In general I find the "scale_factor" and "add_offset" attributes much easier to interpret than the scale and offset udunits options. I would therefore:

1) continue to forbid (or strongly discourage?) use of offset and scale in the units attribute (and modify the conformance document to be consistent with this).

2) replace the scaled units in the CMIP6 data request with units that might be less user friendly, but include equivalent prefix (e.g., replace "1e6 J" with "MJ")

3) replace in the standard names table all non-conforming units with conforming units. I don't think the new units need to be identical to the old (e.g., I would replace "1e-3 kg m-2" with "kg m-2", not "g m-2").

Regarding this last point, note that the so-called "Canonical units" in the standard names table are there to provide guidance on what the quantity represents (e.g., W m-2 indicates the quantity is a flux density, not a flux). CF does not recommend a particular unit among all equivalent (e.g., "kg" might appear in the canonical units, but "g" would be just as acceptable).

Do others have opinions about this?

best regards,
Karl


On 10/29/18 7:45 AM, Martin Juckes - UKRI STFC wrote:

Hello Karl, Alison,


As part of a separate discussion on 'months since' and 'years since' in time units<http://mailman.cgd.ucar.edu/pipermail/cf-metadata/2018/020648.html><http://mailman.cgd.ucar.edu/pipermail/cf-metadata/2018/020648.html>, Klaus pointed out the use of numerical scale factors in units strings, although allowed by Udunits, is prohibited by the CF convention in section 3.1. I'm raising this here because there are 3 standard names which make use of such scale factors in their canonical units, and a number of CMIP6 variables. The CF conformance document diverges from the standard and allows any string which is accepted by Udunits, and hence accepts such factors. The CF checker implements the version according to the conformance document, as does the cf-python code (and hence checks on the CMIP6 variables using cf-python didn't detect this problem).


The CF standard names are:

integral_wrt_depth_of_product_of_sea_water_density_and_salinity : 1e-3 kg m-2

ocean_salt_x_transport, ocean_salt_y_transport: 1e-3 kg s-1


In the CMIP6 data request, we have:

1.e6 J m-1 s-1 for atmospheric energy transport (intuadse, intvadse);

1e-3 kg m-2 for integral wrt depth of density and salinity (somint);

1e-6 m s-1 for saturated hydraulic conductivity;

1e3 km3 for sea ice volumes (sivoln, sivols);

1e6 km2 for sea ice areas (siarean, siareas, siextentn, siextents);


Should we stick to the statement in the standards document ... and bring the conformance document etc into line, or could the standards document be interpreted more loosely?


These scale factors could be replaced by prefixes, but I think there is some loss of legibility in some cases:

1e-3 kg --> g

1e6 J --> MJ

1e-6 m --> um

1e3 km3 --> hm3

1e6 km2 --> Mm2


(here "um" is a micrometer, "hm" a hectometer and "Mm" a megameter).


regards,

Martin


_______________________________________________
CF-metadata mailing list
CF-metadata at cgd.ucar.edu<mailto:CF-metadata at cgd.ucar.edu>
http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cgd.ucar.edu/pipermail/cf-metadata/attachments/20181101/7eccb26d/attachment.html>
Received on Thu Nov 01 2018 - 10:58:08 GMT

This archive was generated by hypermail 2.3.0 : Tue Sep 13 2022 - 23:02:43 BST

⇐ ⇒