Opened 12 years ago
Closed 12 years ago
#39 closed defect (fixed)
Error in check of units attribute for coordinate variables
Reported by: | ros | Owned by: | cf-checker@… |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | cf-checker | Version: | |
Keywords: | units | Cc: |
Description
3.1 of the convention states that "The units attribute is required for all variables that represent dimensional quantities."
Yet a Netcdf file like the following does not generate errors indicating that the units attribute is missing for any of the coordinate variables.
dimensions: longitude = 144 ; latitude = 91 ; press = 10 ; species = 6 ; rec = UNLIMITED ; // (12 currently) word = 13 ; variables: float concentrations(rec, species, press, latitude, longitude) ; concentrations:long_name = "CFC concentrations" ; concentrations:Units = "pptv" ; float longitude(longitude) ; float latitude(latitude) ; float press(press) ; float species(species) ; species:long_name = "species" ; species:coord_labels = "species" ; species:selection_category = "NULL" ; float rec(rec) ; rec:long_name = "month" ; rec:coord_labels = "month" ; rec:selection_category = "NULL" ; char const_labels(species, word) ; const_labels:selection_category = "NULL" ; char month(rec, word) ; month:selection_category = "NULL" ; }
Change History (1)
comment:1 Changed 12 years ago by ros
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
It seems that in cdms all coordinate variables automatically have the 'units' attribute set, albeit to the empty string.
E.g.
So chkUnits was passing any variable for which var.attributes.has_key('units') is true. Modified this routine to check for the empty string.
Fix lodged at r81
Test cases updated for standard_name table 11 too.