Project

General

Profile

Ignoring case of variables during diffn

Added by Matt Thompson over 10 years ago

All,

I was wondering if there is an easy way to ignore case of variable names when doing a "cdo diffn"? This is mainly to avoid a warning, so it's not crucial, but I wondered about it.

I ask because I'm doing some timing benchmark investigations of subsetting (sellatlonbox) using NCO, CDO, and lats4d (from GrADS). Now, the common input file has variables like SLP, PS, PHIS, etc. When I do the subsetting with NCO and CDO, the resulting file has variables SLP, PS, PHIS, etc. but the lats4d one has slp, ps, phis, etc., i.e., it has lowercased the variable names!

This is annoying, but not fatal, but still when I run cdo diffn I get a warning:

$ cdo diffn subset.cdo.zip1.nc4 subset.lats4d.zrev.gzip1.nc4
cdo diffn (Warning): Input streams have different parameters!
  0 of 1011 records differ
cdo diffn: Processed 10312200 values from 34 variables over 2 timesteps ( 17.71s )

It seems to have given me the answer I expect (no diff), but warnings should be investigated. So, if I do an epic stringing of about 20 "chname,slp,SLP -chname,ps,PS -chname,phis,PHIS ...", the cdo diffn is happier:

$ cdo diffn subset.cdo.zip1.nc4 subset.lats4d.zrev.gzip1.UPPERCASE.nc4
  0 of 1011 records differ
cdo diffn: Processed 10312200 values from 34 variables over 2 timesteps ( 17.41s )

So, I was wondering if there was a simple option/environment variable I might be missing to just "workaround" the warning? Like ignore case of variable names?

Or, similarly, a cdo command that can change the case of all the variable names in one shot?

Thanks,
Matt

PS: As for the timings, the result is that CDO is quite a bit slower (12.51 s) than NCO (3.47 s) and lats4d (3.97 s) mainly because the original input file is zipped, it seems.


Replies (1)

RE: Ignoring case of variables during diffn - Added by Uwe Schulzweida over 10 years ago

Hi Matt,

There is no workaround for this problem.
In the next CDO release the operator diffn will ignore the case of variable name.

Thanks for your suggestion,
Uwe

    (1-1/1)