⇐ ⇒

[CF-metadata] same attribute name in variable and in global

From: John Graybeal <jbgraybeal>
Date: Wed, 2 Oct 2019 20:44:43 -0700

Chris,

I think your approach (keeping the distinction) is the way it is meant to work, in that both can exist. I think people were looking for a way to say which value a client should use if both exist. The language ?overwrite? applies only in the ?local memory? sense of which value to use, not whether the model still contains both variables.

For example, in the simple example of when a variable was last updated, it is tempting to say ?use variable attribute if there, and global attribute if no variable attribute??except that?s quite often untrue for that type of attribute, for example because some variable-level update times weren?t captured.

I concur that keeping both is best, and that if we want to specify which takes precedence, we should do so thoughtfully for every attribute in the standard, and document it in a more precise way. Since I?m not volunteering to take that on, a grain of salt is probably in order.

John


---------------------------------------
John Graybeal


> On Apr 4, 2019, at 18:44, Chris Barker - NOAA Federal <chris.barker at noaa.gov> wrote:
>
> Maybe it?s way too late now, but why does the data model have to allow only one attribute: global or variable?
>
> Why not simply keep the distinction between variable and global attributes? That is, global attributes apply to the entire dataset, and variable attributes apply to each variable.
>
> So if there is a global attribute ?global1?, it applies to variable_a, but you don?t say that variable_a has that attribute at all.
>
> -CHB
>
>
>
> On Mar 15, 2019, at 5:48 AM, B?rring Lars <Lars.Barring at smhi.se <mailto:Lars.Barring at smhi.se>> wrote:
>
>> Dear all,
>>
>> I have come across many CMIP5 files that have the same attribute [name] attached to the data variable as found in the globals.
>>
>> In particular it seems that CMOR was writing variable processing history attached to the variable, and more general file processing in the global history.
>>
>> I have also seen that "comment" sometimes occur both as global and as variable attribute.
>>
>> If such a duplication occurs, CF writes:
>> "When an attribute appears both globally and as a variable attribute, the variable?s version has precedence."
>>
>> My interpretation of this is that if there are contradictory information then the variable's attribute has precedence, but otherwise it does not invalidate or overshadows what is in the global attribute.
>>
>> However, the data model presented in the GMD paper (https://www.geosci-model-dev.net/10/4619/2017/ <https://www.geosci-model-dev.net/10/4619/2017/> page 4629, [page 11], under "4.1 The field construct") presents a more restrictive interpretation:
>> "In the data model, we consider that netCDF global file attributes apply to every data variable in the file, except where they are superseded by netCDF data variable attributes with the same name."
>>
>> I understand this to mean that if the same attributes (e.g. comment or history) is present both as global and variable attribute, then the global attribute is overshadowed (as if it did not exist at all)?
>>
>> Is this correct? If so, is this the best solution?
>>
>> Would not concatenating the information contained in each (putting the variable text first) be a more appropriate way to resolve the situation (and thus specify in the data model)?
>>
>>
>> Kind regards,
>> Lars
>>
>> --
>> Lars B?rring
>>
>> FDr, Forskare
>> PhD, Research Scientist
>>
>> SMHI / Swedish Meteorological and Hydrological Institute
>> Rossby Centre
>> SE - 601 76 NORRK?PING
>> http://www.smhi.se <http://www.smhi.se/>
>>
>> E-post / Email: lars.barring at smhi.se <mailto:lars.barring at smhi.se>
>> Tel / Phone: +46 (0)11 495 8604
>> Fax: +46 (0)11 495 8001
>> Bes?ksadress / Visiting address: Folkborgsv?gen 17
>> _______________________________________________
>> 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 <http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata>
> _______________________________________________
> CF-metadata mailing list
> 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/20191002/9b1547e3/attachment.html>
Received on Wed Oct 02 2019 - 21:44:43 BST

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

⇐ ⇒