CDO do not recognises some variables anymore
Added by Nikolaus Groll 5 days ago
Recently I encounter a problem that CDO do not longer find some variables in a netcdf file, while NCO and ncview still show them. I could use the CDOs some time ok without any problems!?
with CDO I get:
$ cdo showvar MNB.gridinfo.nc
cdi warning (cdf_set_var): Inconsistent variable definition for lat!
cdi warning (cdf_set_var): Inconsistent variable definition for lon!
delta depth
cdo showname: Processed 2 variables [0.01s 23MB]
with ncdump -h I get
netcdf MNB.gridinfo {
dimensions:
rlat = 245 ;
rlon = 427 ;
variables:
float delta(rlat, rlon) ;
delta:units = "degree" ;
delta:_FillValue = 1.e+30f ;
delta:long_name = "angle of re-rotation back onto geographical grid" ;
delta:coordinates = "lon lat" ;
float depth(rlat, rlon) ;
depth:units = "m" ;
depth:_FillValue = 1.e+30f ;
depth:long_name = "water depth in WAM simualtion" ;
depth:coordinates = "lon lat" ;
float lat(rlat, rlon) ;
lat:units = "degrees_north" ;
lat:long_name = "geographical latitude" ;
lat:standard_name = "latitude" ;
lat:coordinates = "lon lat" ;
float lon(rlat, rlon) ;
lon:units = "degrees_east" ;
lon:long_name = "geographical longitude" ;
lon:standard_name = "longitude" ;
lon:coordinates = "lon lat" ;
double rlat(rlat) ;
rlat:units = "degrees" ;
rlat:long_name = "rotated latitude" ;
rlat:standard_name = "grid_latitude" ;
double rlon(rlon) ;
rlon:units = "degrees" ;
rlon:long_name = "rotated longitude" ;
rlon:standard_name = "grid_longitude" ;
Until now the warning messages " Inconsistent variable definition for ..." was never a problem, maybe now?
Does someone have an idea how to fix this?
If it helps to find the problem I uploaded the file.
Kind regards
Nikolaus
MNB.gridinfo.nc (1.6 MB) MNB.gridinfo.nc |
Replies (2)
RE: CDO do not recognises some variables anymore - Added by Uwe Schulzweida about 11 hours ago
The attribute coordinates="lon lat" causes lon and lat to be handled as coordinate variables. This means that lon and lat are no longer available as data variables in CDO. Without the attribute, lon and lat are treated as data variables.
RE: CDO do not recognises some variables anymore - Added by Nikolaus Groll about 9 hours ago
Thanks for your help. The funny thing is that it worked fine a few months ago.
However, I solved the problem by duplicating the variables and changing their names to 'lon2' and 'lat2'. I then used these as coordinates, meaning that I can still use 'lon' and 'lat' as variables.
Just in case someone has the same issue as me.
Best regards Nik