⇐ ⇒

[CF-metadata] "Andrew Clegg": udunits 1 or 2 for CF?

From: Steve Emmerson <steve>
Date: Thu, 04 Mar 2010 11:06:09 -0700

Nan,

Because the potential set of input unit strings to both packages is
infinite, I concentrated on trying to keep the interpretation algorithm
in the UDUNITS-2 package compatible with that of the UDUNITS-1 package
so that the UDUNITS-2 package would interpret any string the same way
the UDUNITS-1 package does. I can't guarantee that I was successful,
however, especially when it comes to "fringe" unit specification. For
example, the UDUNITS-1 package will interpret a bare prefix "unit" like
"k" as 1000; whereas, the UDUNITS-2 package rejects such "units".
Fortunately, people tend to not shoot themselves in the foot that way.

Regards,
Steve Emmerson

On 03/04/2010 08:11 AM, Nan Galbraith wrote:
> Hi Steve -
>
> Are all the terms in the new vocabulary backwards compatible, other
> than non-ASCII characters and log units?
> I just spent some time looking on the unidata web site to see if I could
> find any information on changes to basic units names - additions or
> otherwise. I'd thought there might be some new basic units, e.g. PSU
> for salinity. There doesn't seem to be any way to compare the two
> versions, as they're in very different formats. (The new xml list is
> great, by the way.)
>
> Lots of people and systems, including the CF spec, use the vocabulary
> for basic units from udunits, so when and if these terms change, it would
> be helpful to have a description of those changes. The v2 manual doesn't
> mention any additions, other than new support for non-ASCII and log
> units.
>
>
> In 10/2006, Alison wrote:
>
>> It emerged that there are already some units that have been identified
>> as being useful for CF that are not currently part of udunits.
>> Jonathan wrote:
>>
>>> > sverdrup = 1e6 m3 s-1 (we can't use the usual abbrev Sv though as it
>>> > already has another definition)
>>> > PSU and psu = 1e-3 (practical salinity unit, effectively mass
>>> > fraction)
>>>
>> There is also decibel (dB).
>
>
> Thanks -
>
> Nan Galbraith
>
>
>>> I'm running into some problems regarding units in CF-compliant files.
>>> Up until now I've been using udunits 1 to check units, but I recently
>>> tried the CF checker which uses udunits2. There are some unit strings
>>> which are valid in one but not the other. In particular, I am dealing
>>> with milligrams per cubic meter. In udunits1, I used 'ukg m-3', which
>>> udunits2 rejects as invalid. udunits2 accepts 'mg m-3' (which is much
>>> better!), but udunits1 interprets this as to do with gravity. Because
>>> of this, I can't include a unit string which is generally compatible >
>>>
>> ...
>> The UDUNITS-1 library had a bug in it. The bug was that "g" was
>> interpreted as meaning "gravity" (i.e., "standard_free_fall") rather
>> than "gram". This was corrected in version 1.12.10 of the UDUNITS-1
>> package, which was released on 2009-09-17.
>>
>> ...
>>
>> Applications that use the UDUNITS-1 library prior to version 1.12.10 can
>> be easily modified to interpret "g" as "gram" by removing the following
>> entry from the UDUNITS-1 database ($prefix/etc/udunits.dat):
>>
>> g S gravity # approx. should ...
>>
>> I hope this helps.
>>
>> Regards,
>> Steve Emmerson
>> UDUNITS developer
>> _______________________________________________
>> CF-metadata mailing list
>> CF-metadata at cgd.ucar.edu
>> http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata
>>
>>
>
>
Received on Thu Mar 04 2010 - 11:06:09 GMT

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

⇐ ⇒