Project

General

Profile

Different dimensions having same length disappears with CDO merge

Added by Pallav Kumar Shrestha almost 4 years ago

Hi

With reference to the attachment, I have four netCDF files. Each of them varies with a specific dimension as follows -

#11 - values (4)
#12 - terciles (3)
#13 - quintiles (5)
#14 - extremes (3)

The length of the dimensions are given in the parenthesis.

When I run cdo merge on the four files, all data is merged into one file but the dimension "terciles" is replaced on-the-fly by "extremes". The only reason over I see is that both the dimensions have same length. But this "disappearing"/ auto-replacement of dimension is unwanted. Is there a solution to this issue in CDO?

Pallav
UFZ, Leipzig


Replies (3)

RE: Different dimensions having same length disappears with CDO merge - Added by Ralf Mueller almost 4 years ago

hi Pallav!

CDO is not a general netCDF-editor, it supports CF-conform netcdf input/output. your input use the dimensions mentioned above without any associated data variable (region btw has a data variable.)
Hence these dimensions have no semantics despite their size, that can be used to differentiate one from the other. So why not common names for common things?

If you want to keep the names, you can use NCO for merging.

I personally think it is a bad practice to rely on dimension names in netcdf files, but that's just me.

cheers
ralf

RE: Different dimensions having same length disappears with CDO merge - Added by Pallav Kumar Shrestha almost 4 years ago

Hi Ralf,

Thanks for the prompt response!

Noted. So the dimensions should have associated variables (like region) to be differentiated in CDO.

Yup, NCO worked (ncks -A -h) for the task without having to add associated vars.

CDO is so good that sometimes I expect it to do everything in the (netCDF) world :). You are right - I need to understand the scope of CDO and need to give it some slack.

Cheers
Pallav

    (1-3/3)