Project

General

Profile

do ensavg get different multi-year averaged climates from nces

Added by Dill Land almost 3 years ago

I calculated averaged radiation for 15 years. all files are renamed as t_1.nc, t_2.nc......t_15.nc. Then I use commands as follows:

cdo ensavg t_[1-15].nc t_1-15a.nc

Just for validation, I use nco to do the same thing and rename files as t_01.nc, t_02.nc....t_15.nc

nces -n 15,2,1 t_01.nc t_1-15b.nc

Then I just another software that can put all input nc files together and check values at the grid level. I found results from cdo and nces are different and it seems results from cdo are not correct.

Does anyone have an idea on this issue?

Thanks,

Dill


Replies (5)

RE: do ensavg get different multi-year averaged climates from nces - Added by Dill Land almost 3 years ago

Here is the thing:

I found 'cdo ensavg t_[1-15].nc t_1-15a.nc did not calculate averages for 15 years at all. The results are same as t_1.nc.

Anyone can help on this issue?

Thanks,

Dill

RE: do ensavg get different multi-year averaged climates from nces - Added by Uwe Schulzweida almost 3 years ago

Hello Dill,

Which CDO version do you use (cdo -V)?
The NCO tool nces is similar to the CDO operator ensmean. I got binary identical results with my testdata.
If the data doesn't contain any missing values ensavg does the same as ensmean.
If your data has missing values, read chapter Mean and average

Cheers,
Uwe

RE: do ensavg get different multi-year averaged climates from nces - Added by Dill Land almost 3 years ago

Hi, Uwe,

I am using CDO version 2.0.0rc7.

I just wonder if my usage is correct:

When I do cdo ensavg t_[1-9].nc t_1-9.nc, cdo works correctly. However, when I instead do cdo ensavg t_[1-15], the results are not correct. So I am thinking if the way I named all files is wrong.

Thanks,

Dill

RE: do ensavg get different multi-year averaged climates from nces - Added by Uwe Schulzweida almost 3 years ago

Hi Dill,

Thats right, t_[1-15].nc is wrong syntax to select the files. Check it with ls:

ls t_[1-15].nc
result: t_1.nc t_5.nc
Correct is:
ls t_[1-9].nc t_1[0-5].nc
result: t_1.nc  t_10.nc t_11.nc t_12.nc t_13.nc t_14.nc t_15.nc t_2.nc  t_3.nc  t_4.nc  t_5.nc  t_6.nc  t_7.nc  t_8.nc  t_9.nc
Cheers,
Uwe

RE: do ensavg get different multi-year averaged climates from nces - Added by Dill Land almost 3 years ago

I got it. Thanks for your help!

Cheers,

Dill

    (1-5/5)