Index: /cf-checker/trunk/test_files/CRM041.check =================================================================== --- /cf-checker/trunk/test_files/CRM041.check (revision 54) +++ /cf-checker/trunk/test_files/CRM041.check (revision 81) @@ -1,7 +1,8 @@ +ncvarget: ncid 4; varid 0: Index exceeds dimension bound CHECKING NetCDF FILE: CRM041.nc ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/complex.check =================================================================== --- /cf-checker/trunk/test_files/complex.check (revision 54) +++ /cf-checker/trunk/test_files/complex.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Warning: bounds variable not found in complex.nc: bounds_lat2d @@ -47,5 +47,4 @@ ------------------ WARNING (3): No standard_name or long_name attribute specified -ERROR (4): Axis attribute is not allowed for auxillary coordinate variables. ------------------ @@ -76,4 +75,5 @@ ------------------ WARNING (3): No standard_name or long_name attribute specified +WARNING (3.1): units attribute should be present ------------------ @@ -98,4 +98,5 @@ ------------------ WARNING (3): No standard_name or long_name attribute specified +WARNING (3.1): units attribute should be present ------------------ @@ -112,4 +113,4 @@ ------------------ -ERRORS detected: 7 -WARNINGS given: 14 +ERRORS detected: 6 +WARNINGS given: 16 Index: /cf-checker/trunk/test_files/GregRappa.check =================================================================== --- /cf-checker/trunk/test_files/GregRappa.check (revision 56) +++ /cf-checker/trunk/test_files/GregRappa.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/badc_units.check =================================================================== --- /cf-checker/trunk/test_files/badc_units.check (revision 54) +++ /cf-checker/trunk/test_files/badc_units.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (7.1): Data for variable time lies outside cell boundaries Index: /cf-checker/trunk/test_files/Trac022.check =================================================================== --- /cf-checker/trunk/test_files/Trac022.check (revision 54) +++ /cf-checker/trunk/test_files/Trac022.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (2.6.1): No 'Conventions' attribute present Index: /cf-checker/trunk/test_files/cell_measures.check =================================================================== --- /cf-checker/trunk/test_files/cell_measures.check (revision 54) +++ /cf-checker/trunk/test_files/cell_measures.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) ERROR (7.1): Incorrect dimensions for boundary variable: lon_vertices Index: /cf-checker/trunk/test_files/CRM021_test1.check =================================================================== --- /cf-checker/trunk/test_files/CRM021_test1.check (revision 54) +++ /cf-checker/trunk/test_files/CRM021_test1.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/CRM024_test1.check =================================================================== --- /cf-checker/trunk/test_files/CRM024_test1.check (revision 54) +++ /cf-checker/trunk/test_files/CRM024_test1.check (revision 81) @@ -3,8 +3,8 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) ERROR (2.6.1): This netCDF file does not appear to contain CF Convention data. -WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF version 1.0 +WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF 1.0 ERROR (5.6): MSLP - Invalid syntax for 'grid_mapping' attribute @@ -32,5 +32,6 @@ ------------------ WARNING (3): No standard_name or long_name attribute specified +WARNING (3.1): units attribute should be present ERRORS detected: 2 -WARNINGS given: 5 +WARNINGS given: 6 Index: /cf-checker/trunk/test_files/UpgradeVn.pl =================================================================== --- /cf-checker/trunk/test_files/UpgradeVn.pl (revision 54) +++ /cf-checker/trunk/test_files/UpgradeVn.pl (revision 81) @@ -15,7 +15,7 @@ #-------------------------------------------------------------------------- $checkerVN="1.10"; -$standardNameVN="7 (2007-11-20T02:00:00Z)"; +$standardNameVN="11 (2008-11-11T11:00:00Z)"; -$TEST_FILES_DIR="/home/ros/SRCE_projects/CF_Checker_W/main/Test_Files"; +$TEST_FILES_DIR="/home/ros/cf-checker/trunk/test_files"; chdir $TEST_FILES_DIR or die "Failed to cd to $TEST_FILES_DIR: $!\n"; Index: /cf-checker/trunk/test_files/CRM026_test2.check =================================================================== --- /cf-checker/trunk/test_files/CRM026_test2.check (revision 54) +++ /cf-checker/trunk/test_files/CRM026_test2.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/CRM027_test1.check =================================================================== --- /cf-checker/trunk/test_files/CRM027_test1.check (revision 54) +++ /cf-checker/trunk/test_files/CRM027_test1.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (7.1): Data for variable time lies outside cell boundaries Index: /cf-checker/trunk/test_files/Trac020_test1.check =================================================================== --- /cf-checker/trunk/test_files/Trac020_test1.check (revision 54) +++ /cf-checker/trunk/test_files/Trac020_test1.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/CRM027_test2.check =================================================================== --- /cf-checker/trunk/test_files/CRM027_test2.check (revision 54) +++ /cf-checker/trunk/test_files/CRM027_test2.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (7.1): Data for variable time lies outside cell boundaries Index: /cf-checker/trunk/test_files/CRM028_test1.check =================================================================== --- /cf-checker/trunk/test_files/CRM028_test1.check (revision 54) +++ /cf-checker/trunk/test_files/CRM028_test1.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (2.6.1): No 'Conventions' attribute present Index: /cf-checker/trunk/test_files/Trac020_test2.check =================================================================== --- /cf-checker/trunk/test_files/Trac020_test2.check (revision 54) +++ /cf-checker/trunk/test_files/Trac020_test2.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/tests.sh =================================================================== --- /cf-checker/trunk/test_files/tests.sh (revision 38) +++ /cf-checker/trunk/test_files/tests.sh (revision 81) @@ -7,4 +7,6 @@ mkdir $outdir +export PYTHONPATH=/home/ros/software/python/cdat-lite:/home/ros/software/python/udunits +std_name_table=http://cf-pcmdi.llnl.gov/documents/cf-standard-names/current/cf-standard-name-table.xml for file in `ls *.nc` do @@ -12,12 +14,16 @@ then # Check --badc option (Note: Need to set path to badc_units.txt in cfchecks.py) - ../src/cfchecks.py --badc $file > $outdir/$file.out 2>&1 + ../src/cfchecks.py --badc $file -s $std_name_table > $outdir/$file.out 2>&1 elif test $file == "stdName_test.nc" then # Check --cf_standard_names option ../src/cfchecks.py --cf_standard_names ./stdName_test_table.xml $file > $outdir/$file.out 2>&1 + elif test $file == "CF_1_2.nc" + then + # CF-1.2 + ../src/cfchecks.py -s $std_name_table -v 1.2 $file > $outdir/$file.out 2>&1 else # Run the checker on the file - ../src/cfchecks.py $file > $outdir/$file.out 2>&1 + ../src/cfchecks.py -s $std_name_table -v 1.0 $file > $outdir/$file.out 2>&1 fi # Check the output against what is expected Index: /cf-checker/trunk/test_files/cell_methods.check =================================================================== --- /cf-checker/trunk/test_files/cell_methods.check (revision 54) +++ /cf-checker/trunk/test_files/cell_methods.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) ERROR (7.1): Incorrect dimensions for boundary variable: lon_vertices Index: /cf-checker/trunk/test_files/hfogo_O1_labelVariable_KT.check =================================================================== --- /cf-checker/trunk/test_files/hfogo_O1_labelVariable_KT.check (revision 54) +++ /cf-checker/trunk/test_files/hfogo_O1_labelVariable_KT.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/CRM035.check =================================================================== --- /cf-checker/trunk/test_files/CRM035.check (revision 54) +++ /cf-checker/trunk/test_files/CRM035.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (2.6.1): No 'Conventions' attribute present Index: /cf-checker/trunk/test_files/CRM037.check =================================================================== --- /cf-checker/trunk/test_files/CRM037.check (revision 54) +++ /cf-checker/trunk/test_files/CRM037.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/CRM038.check =================================================================== --- /cf-checker/trunk/test_files/CRM038.check (revision 54) +++ /cf-checker/trunk/test_files/CRM038.check (revision 81) @@ -1,7 +1,8 @@ +ncvarget: ncid 4; varid 0: Index exceeds dimension bound CHECKING NetCDF FILE: CRM038.nc ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) @@ -13,4 +14,5 @@ Checking variable: xc ------------------ +WARNING (3.1): units attribute should be present ERROR (5): co-ordinate variable 'xc' not monotonic @@ -18,4 +20,5 @@ Checking variable: yc ------------------ +WARNING (3.1): units attribute should be present ERROR (5): co-ordinate variable 'yc' not monotonic @@ -37,3 +40,3 @@ ERRORS detected: 2 -WARNINGS given: 0 +WARNINGS given: 2 Index: /cf-checker/trunk/test_files/formula_terms.check =================================================================== --- /cf-checker/trunk/test_files/formula_terms.check (revision 54) +++ /cf-checker/trunk/test_files/formula_terms.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (7.1): Data for variable lat lies outside cell boundaries Index: /cf-checker/trunk/test_files/CF_1_0_OK.check =================================================================== --- /cf-checker/trunk/test_files/CF_1_0_OK.check (revision 54) +++ /cf-checker/trunk/test_files/CF_1_0_OK.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) Index: /cf-checker/trunk/test_files/CRM032_test1.check =================================================================== --- /cf-checker/trunk/test_files/CRM032_test1.check (revision 54) +++ /cf-checker/trunk/test_files/CRM032_test1.check (revision 81) @@ -3,8 +3,8 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) ERROR (2.6.1): This netCDF file does not appear to contain CF Convention data. -WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF version 1.0 +WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF 1.0 ERROR (5.6): MSLP - Invalid syntax for 'grid_mapping' attribute @@ -32,8 +32,8 @@ Checking variable: rgrid ------------------ -ERROR (3.1): Units are not consistent with those given in the standard_name table. +WARNING (3.1): units attribute should be present ERROR (8.2): values of rgrid must be in the range 0 to 14639 ERROR (5): co-ordinate variable 'rgrid' not monotonic -ERRORS detected: 6 -WARNINGS given: 4 +ERRORS detected: 5 +WARNINGS given: 5 Index: /cf-checker/trunk/test_files/CRM033_test1.check =================================================================== --- /cf-checker/trunk/test_files/CRM033_test1.check (revision 54) +++ /cf-checker/trunk/test_files/CRM033_test1.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (2.6.1): No 'Conventions' attribute present Index: /cf-checker/trunk/test_files/CRM018_test1.check =================================================================== --- /cf-checker/trunk/test_files/CRM018_test1.check (revision 54) +++ /cf-checker/trunk/test_files/CRM018_test1.check (revision 81) @@ -3,5 +3,5 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) WARNING (2.6.1): No 'Conventions' attribute present Index: /cf-checker/trunk/test_files/stdName_test.check =================================================================== --- /cf-checker/trunk/test_files/stdName_test.check (revision 54) +++ /cf-checker/trunk/test_files/stdName_test.check (revision 81) @@ -3,6 +3,7 @@ ===================== Using CF Checker version 1.10 -Using Standard Name Table Version 7 (2007-11-20T02:00:00Z) +Using Standard Name Table Version 2 (2006-09-26T18:12:43Z) +WARNING: Inconsistency - The conventions attribute is set to CF-1.0, but you've requested a validity check against CF 1.2 ERROR (7.1): Boundary var time_bnds has inconsistent std_name to time WARNING (7.1): Data for variable time lies outside cell boundaries @@ -35,3 +36,3 @@ ERRORS detected: 3 -WARNINGS given: 1 +WARNINGS given: 2 Index: /cf-checker/trunk/src/cfchecks.py =================================================================== --- /cf-checker/trunk/src/cfchecks.py (revision 55) +++ /cf-checker/trunk/src/cfchecks.py (revision 81) @@ -9,8 +9,10 @@ # Date: February 2003 # -# Version: 1.10 +# File Revision: $Revision$ +# +# CF Checker Version: 1.10 # #------------------------------------------------------------- -''' cfchecker [-s|--cf_standard_names standard_names.xml] [-u|--udunits udunits.dat] file1 [file2...] +''' cfchecker [-s|--cf_standard_names standard_names.xml] [-u|--udunits udunits.dat] [-v|--version CFVersion] file1 [file2...] Description: @@ -26,4 +28,6 @@ -h or --help: Prints this help text. + -v or --version: CF version to check against. + ''' @@ -36,6 +40,6 @@ STANDARDNAME="./standard_name.xml" checkerVersion="1.10" -CFVersions=['CF-1.0','CF-1.1'] -Versions=[1.0,1.1] +CFVersions=['CF-1.0','CF-1.1','CF-1.2'] +Versions=[1.0,1.1,1.2] #----------------------------------------------------------- @@ -238,5 +242,7 @@ allCoordVars=coordVars[:] allCoordVars[len(allCoordVars):]=auxCoordVars[:] + self.setUpFormulas() + axes=self.f.axes.keys() @@ -599,5 +605,5 @@ self.err = self.err+1 - #------------------------------------------ + #-----------------------x1------------------- # Is there a grid_mapping variable? #------------------------------------------ @@ -631,4 +637,8 @@ 'stereographic','transverse_mercator'] + if self.version >= 1.2: + # Extra grid_mapping_names at vn1.2 + validNames[len(validNames):] = ['latitude_longitude','vertical_perspective'] + if var.grid_mapping_name not in validNames: print "ERROR (5.6): Invalid grid_mapping_name:",var.grid_mapping_name @@ -685,5 +695,5 @@ ,'f(j,i)=0.5*(z1+z2)+0.5*(z1-z2)*tanh(2*a/(z1-z2)*(depth(j,i)-href))'] - + #---------------------------------------- def parseBlankSeparatedList(self, list): @@ -710,5 +720,5 @@ if conventions != 'CF-'+str(self.version): - print "WARNING: Inconsistency - The conventions attribute is set to "+conventions+", but you've requested a validity check against CF version",self.version + print "WARNING: Inconsistency - The conventions attribute is set to "+conventions+", but you've requested a validity check against CF",self.version self.warn = self.warn+1 @@ -1143,5 +1153,5 @@ rc=1 var=self.f[varName] - + if self.badc: rc = self.chkBADCUnits(var) @@ -1150,5 +1160,6 @@ return rc - if var.attributes.has_key('units'): + # Test for blank since coordinate variables have 'units' defined even if not specifically defined in the file + if var.attributes.has_key('units') and var.attributes['units'] != '': # Type of units is a string units = var.attributes['units'] @@ -1219,7 +1230,7 @@ print "WARNING (3.1): units attribute should be present" self.warn = self.warn+1 - elif not var.attributes.has_key('positive') and not var.attributes.has_key('formula_terms'): - print "WARNING (3.1): units attribute should be present" - self.warn = self.warn+1 + elif not var.attributes.has_key('positive') and not var.attributes.has_key('formula_terms'): + print "WARNING (3.1): units attribute should be present" + self.warn = self.warn+1 return rc