Project

General

Profile

cdo merge - duplicate variables

Added by Antonio Neves over 9 years ago

Dear all,

I hope this question is not a duplicate (as my variables)...

I'm using cdo to merge the inputs used in my simulations which are 3 netcdf files containing, respectively, zonal_currents, meridional_currents and surface_temperature. The files are organized in the same way, with variables time, lon, lat and property (t,u or v).

My problem: when I merge then, cdo does identify that i have duplicated variable names (lon, lat and time) and automatically changes their names (lon_2,lat_2 for the 2nd file, lon_3,lat_3 for the 3rd). Well, my problem is that lon and lat are identical among my files. Interestingly enough, CDO does not replicate my time variable... (maybe because it is also a dimension of my nc file)

I've found the SKIP_SAME_TIME=1 trick, but I couldnt find anything like "SKIP_SAME_PARAMETER=1". Is there something similar available?

Thank you very much for your attention and time!

all the best
augusto


Replies (1)

RE: cdo merge - duplicate variables - Added by Ilja Mal over 8 years ago

HI

I ended up with a similar problem when merging multiple files that weren't handled similarly.

I received "new" dimension called lon_2 after merging files where lon dimensional variable had different datatype.
i.e in file1 lon was double variable and in file2 lon had float datatype. After cdo merge both lon and lon_2 were turned into floats ...

In my case it turned out that one external netcdf application did not preserve double for both coordinate variables. Afterwards, when using -setmissingvalue operator for only file2, lon variable was set to float. Solution was to apply -setmissingvalue also for file1 and have float type for lon variable in both files.

I hope it helps :)

Antonio Neves wrote:

Dear all,

I hope this question is not a duplicate (as my variables)...

I'm using cdo to merge the inputs used in my simulations which are 3 netcdf files containing, respectively, zonal_currents, meridional_currents and surface_temperature. The files are organized in the same way, with variables time, lon, lat and property (t,u or v).

My problem: when I merge then, cdo does identify that i have duplicated variable names (lon, lat and time) and automatically changes their names (lon_2,lat_2 for the 2nd file, lon_3,lat_3 for the 3rd). Well, my problem is that lon and lat are identical among my files. Interestingly enough, CDO does not replicate my time variable... (maybe because it is also a dimension of my nc file)

I've found the SKIP_SAME_TIME=1 trick, but I couldnt find anything like "SKIP_SAME_PARAMETER=1". Is there something similar available?

Thank you very much for your attention and time!

all the best
augusto

    (1-1/1)