I believe I've found a bug with getvardims and NetCDF4 files. If a
file is created using the NetCDF4 format and then getvardims is
called on another variable that has named dimensions, subsequent
calls of getvardims on the file handle will report the dimension
names of the variable rather than reporting missing. I was able to
reproduce this with the following short test code (also attached):
setfileoption( "nc", "Format", "NetCDF4" )
outfile = addfile( "getvardim_bug.nc", "c" )
a = ispan(0,4,1)
print( getvardims(outfile) )��� ; missing, as expected
dummy = getvardims( a )��� ���� ; without dim name, has no
effect
print( getvardims(outfile) )��� ; still missing
delete(dummy)
a!0 = "test"
a&test = ispan(0,40,10)
print( getvardims(outfile) )��� ; missing, as expected
dummy = getvardims( a )��� ���� ; test
print( getvardims(outfile) )��� ; erroneously prints test
The same code works as expected if the first line is commented
out (which uses the older NetCDF format). This bug was found
using v 6.1.2, but I didn't see any notes about a fix in the
notes for v 6.2.0 (though it could be part of "Numerous
improvements and bug fixes have been made to the NetCDF-4 file
I/O").
- Walter Kolczynski
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jul 18 04:50:20 2014