Project

General

Profile

CDO reverses lat axis order

Added by Augusto Sanabria almost 11 years ago

I have noticed that CDO reverses the order of the latitude axis in my netCDF files, this creates problems for me whenever I compare results.
The normal order of my latitude axis is in increasing order (starting with min lat, say - 37.753, [southern hemisphere]) but after using any CDO tool the order is reversed (and I have to use 'invertlat' to get to my original order), this is problematic when a large number of netCDF files are generated. Is this something which can be fixed in a future version of CDO? Thanks.

Regards,

Augusto


Replies (11)

RE: CDO reverses lat axis order - Added by Jaison-Thomas Ambadan almost 11 years ago

Hi,

try the "invertlat" operator (inline with other operators which cause the problem). See the CDO doc section 2.6.7 for more details: https://code.zmaw.de/embedded/cdo/1.5.9/cdo.html#x1-1780002.6.7

Cheers,
J

RE: CDO reverses lat axis order - Added by Carolin Helbig almost 11 years ago

Hi,

I have got a very similar problem: If I use any cdo method, my eta-levels are reversed. I tried invertlev to get the orginal order, but it doesen't change anything.

Can somebody help me?

Greetings,
Carolin.

RE: CDO reverses lat axis order - Added by Jaison-Thomas Ambadan almost 11 years ago

Hi,

I guess the invertlev only works for pressure levels but I'm not sure.

It may be possible to reverse the z-axis using "setzaxis"

cdo zaxisdes ifile > myzaxis

then edit the "myzaxis" manually, ie reverse the axis then

cdo setzaxis,myzaxis ifile ofile

This may work - but you've to try it out

Cheers,
J

RE: CDO reverses lat axis order - Added by Carolin Helbig almost 11 years ago

Thanks for your response.

I've looked up the z-axis-description before and after modifying the file with cdo and it is the same... I got the reverse axis when I visualize the file with ParaView. Maybe cdo changes something that makes ParaView confused. Have you an idea what this could be?

Greetings,
Carolin.

RE: CDO reverses lat axis order - Added by Jaison-Thomas Ambadan almost 11 years ago

I've no other suggestion. Did you try to visualize using "ncview" or "Panoply"? Anyway, may be Uwe/Ralf could help you with more info. Also, you may upload your input file here.

Cheers,
J

RE: CDO reverses lat axis order - Added by Carolin Helbig almost 11 years ago

In Panoply the levels have the right order.

I uploaded my files:
1. nc-file where the timesteps were merged with cdo and the eta-levels are reverse in ParaView
2. nc-file where the timesteps were merged with nco and the eta-levels are in the right order

cdo_mergetime.nc (174 KB) cdo_mergetime.nc nc-file, timesteps merged with cdo

RE: CDO reverses lat axis order - Added by Carolin Helbig almost 11 years ago

2:

merge_nco.nc (174 KB) merge_nco.nc nc-file, timesteps merged with nco

RE: CDO reverses lat axis order - Added by Jaison-Thomas Ambadan almost 11 years ago

Hi,

I think the problem is that your NetCDF file contains both pressure level variables as well as eta levels. CDO is not very good at handling NetCDF files which contains variables of mixed attributes. CDO may produce the right results if you "select" the required variable of one particular vertical level type, and apply the "invertlev"

Cheers,
J

RE: CDO reverses lat axis order - Added by Carolin Helbig almost 11 years ago

Hi,

now I extracted a variable (rh_e) so that there is only the eta level and no more pressure levels. but the problem is already there.

interlev will not help, because the z-axis-description is the same as before. so the problem must be somewhere else, I guess.

RE: CDO reverses lat axis order - Added by Carolin Helbig almost 11 years ago

I found the problem! cdo somehow deletes the eta-attribute positive = "down" that is needed to visualize it the right way in paraview. for all who have a similar problem: you can simply add the missing attribute with nco's ncatted

:-)

RE: CDO reverses lat axis order - Added by Uwe Schulzweida almost 11 years ago

Hi Carolin,

Thanks for this information! This problem will be fixed in the next CDO release.

Cheers,
Uwe

    (1-11/11)