Project

General

Profile

diffn not relying on variable names

Added by Sylvaine Ferrachat about 10 years ago

Hi,

When comparing several variables in 2 files, diffn is not reliable when variables are stored in different order. I get a warning message:

cdo diffn (Warning): Input streams have different parameters!

and the result is wrong.

In contrast, when explicitly extracting 1 variable out of each of the 2 files, diffn works properly.

I attach 2 files and the corresponding example to highlight the problem:

cdo diffn test_ham2.nc test_debugs.nc   #--> prints the above warning, and shows an erroneous result
cdo diffn -selname,RWETAS test_ham2.nc -selname,RWETAS test_debugs.nc  #--> no warning and the result is correct
cdo diffn -selname,RWETAI test_ham2.nc -selname,RWETAI test_debugs.nc    #--> no warning and the result is correct

I suspect that in the second case it only works because the pre-selection of the variable automatically sets the var code to 1 in both files, which implies that diffn actually relies on variable codes and not on variable names.

My cdo version: 1.6.2rc5

Is this a bug?


Replies (3)

RE: diffn not relying on variable names - Added by Jaison-Thomas Ambadan about 10 years ago

try using "-Q" option which alphanumerically sort the NetCDF parameter names.

cdo -Q diffn test_ham2.nc test_debugs.nc

Cheers,
J

RE: diffn not relying on variable names - Added by Jaison-Thomas Ambadan about 10 years ago

Jaison-Thomas Ambadan wrote:

try using "-Q" option which alphanumerically sort the NetCDF parameter names.

[...]

Cheers,
J

PS: I haven't tried with your files

RE: diffn not relying on variable names - Added by Sylvaine Ferrachat about 10 years ago

Thanks! It indeed worked. [but I keep thinking that diffn is a bit of a misnomer, if -Q is necessary...]

Cheers
Sylvaine

    (1-3/3)