⇐ ⇒

[CF-metadata] axis attribute on aux coord variables

From: Bentley, Philip <philip.bentley>
Date: Thu, 24 Feb 2011 14:43:29 -0000

Hi Ros,
 
This has prompted me to mention a CF compliance issue that I spotted
last week in connection with the netCDF files we're producing for the
CMIP5 project using the latest CMOR-2 library. When I validated one of
these files against the latest online version of the CF-checker utility
(using version CF-1.4 which is the value that CMOR assigns to the
conventions attribute), the validation fails with the following error
message:
 
CHECKING NetCDF FILE: /tmp/22294.nc
=====================
Using CF Checker Version 2.0.2
Using Standard Name Table Version 16 (2010-10-11T12:16:51Z)
Using Area Type Table Version 1 (5 December 2008)
 
[snip]
 
------------------
Checking variable: height
------------------
ERROR (4): Axis attribute is not allowed for auxillary coordinate
variables.
 
[snip]
 
ERRORS detected: 1
WARNINGS given: 0
INFORMATION messages: 0
======================

The relevant bits of CDL from the netCDF header of my test file are
shown at the end of this message. In essence, it's objecting to the
axis = "Z" attribute on the height scalar coordinate variable.
 
For some reason I'd had it in my head that use of the 'axis' attribute
was to be permitted for auxiliary/scalar coordinate variables as of
CF-1.4. CF ticket 62 refers to the discussion
(https://cf-pcmdi.llnl.gov/trac/ticket/62), though I can't now see
specific mention of a CF version at which this proposed revision would
apply. Perhaps I'm looking in the wrong place!
 
I was wondering, therefore, if you were planning to retro-fit support
for the axis attribute at version CF-1.4 ? (If not then we may have a
wee bit of a problem, as there are now many thousands of CMIP5 netCDF
files in circulation which are not strictly speaking CF compliant.
Though I'm fairly confident that most netcdf apps will still read them
okay.)
 
Regards,
Phil
 
And here's the fragment of my netCDF header (with lots of CMOR
attributes removed):
 
dimensions:
        lat = 145 ;
        bnds = 2 ;
        lon = 192 ;
        time = UNLIMITED ; // (12 currently)
variables:
        double height ;
                height:units = "m" ;
                height:positive = "up" ;
                height:long_name = "height" ;
                height:standard_name = "height" ;
                height:axis = "Z" ; *** THIS ATTRIBUTE IS THE CULPRIT
***
        double lat(lat) ;
                lat:bounds = "lat_bnds" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:standard_name = "latitude" ;
        double lat_bnds(lat, bnds) ;
        double lon(lon) ;
                lon:bounds = "lon_bnds" ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
                lon:standard_name = "longitude" ;
        double lon_bnds(lon, bnds) ;
        float tas(time, lat, lon) ;
                tas:standard_name = "air_temperature" ;
                tas:long_name = "Near-Surface Air Temperature" ;
                tas:comment = "near-surface (usually, 2 meter) air
temperature." ;
                tas:units = "K" ;
                tas:cell_methods = "time: mean" ;
                tas:coordinates = "height" ;
        double time(time) ;
                time:bounds = "time_bnds" ;
                time:units = "days since 1859-12-01" ;
                time:calendar = "360_day" ;
                time:axis = "T" ;
                time:standard_name = "time" ;
        double time_bnds(time, bnds) ;

// global attributes:
                :Conventions = "CF-1.4" ;
                :cmor_version = "2.5.0" ;

 


________________________________

        From: cf-metadata-bounces at cgd.ucar.edu
[mailto:cf-metadata-bounces at cgd.ucar.edu] On Behalf Of Rosalyn Hatcher
        Sent: 24 February 2011 10:40
        To: Brian Eaton
        Cc: aparna Radhakrishnan; cf-metadata at cgd.ucar.edu; Kyle Olivo;
Doutriaux,Charles; Jonathan Gregory; Karl Taylor
        Subject: Re: [CF-metadata] CF Standards
        
        
        Hi All,
        
        I have recently made some changes to the checker (which I
haven't released yet) that fix a few issues with the checks on presence
of the unit attribute.
        
        Kyle - if you could send me the netcdf file header (ncdump -c)
I'll run it through my development version of the checker and see if the
issues raised on this thread have been fixed and if not will look at
doing so.
        
        Regards,
        Ros.
        
        
        On 24/02/11 02:32, Brian Eaton wrote:

                Hi Karl,
                
                I agree with all your comments on this thread. In
particular, the checker
                shouldn't complain that a, b, a_bnds, and b_bnds don't
have units when it
                doesn't have any information that indicates they are
dimensional
                quantities.
                
                As an aside though, I do think there would be value in
having the CF
                checker be made to recognize when variables are part of
the definition of a
                dimensionless vertical coordinate via the formula_terms
attribute. In the
                example below, there are two variables called out by
formula_terms, p0 and
                ps, which do need to have units in order for the formula
to be evaluated
                correctly. The checker could make that check.
                
                Best,
                Brian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cgd.ucar.edu/pipermail/cf-metadata/attachments/20110224/c9914318/attachment-0001.html>
Received on Thu Feb 24 2011 - 07:43:29 GMT

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

⇐ ⇒