Project

General

Profile

ymonadd (Abort): Month index 5 already allocated!

Added by Mikko Strahlendorff almost 4 years ago

I am trying to bias adjust a 51 member ensemble:

seq 0 50 | parallel -j 16 --compress --tmpdir tmp/ cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf_$year${month}_all-24h-eu-{}.grib ens/ec-bsf_$year${month}_t+sw+sd-24h-eu-{}.grib

it fails with an error that I don't understand. year=2020 and month=06, so it goes across month 12 to 1. Is this tricky for cdo?

Please help.

Cheers Mikko


Replies (9)

RE: ymonadd (Abort): Month index 5 already allocated! - Added by Ralf Mueller almost 4 years ago

hi Mikko!
it's hard to say without the whole script and the error.

cheers
ralf

RE: ymonadd (Abort): Month index 5 already allocated! - Added by Mikko Strahlendorff almost 4 years ago

It is a one-liner so all code is in there. The bash parameters year and month I gave as well.

RE: ymonadd (Abort): Month index 5 already allocated! - Added by Ralf Mueller almost 4 years ago

I print the command line rathen than executing them because I don't have the data:

cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-0.grib ens/ec-bsf__t+sw+sd-24h-eu-0.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-1.grib ens/ec-bsf__t+sw+sd-24h-eu-1.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-2.grib ens/ec-bsf__t+sw+sd-24h-eu-2.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-3.grib ens/ec-bsf__t+sw+sd-24h-eu-3.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-4.grib ens/ec-bsf__t+sw+sd-24h-eu-4.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-5.grib ens/ec-bsf__t+sw+sd-24h-eu-5.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-6.grib ens/ec-bsf__t+sw+sd-24h-eu-6.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-7.grib ens/ec-bsf__t+sw+sd-24h-eu-7.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-8.grib ens/ec-bsf__t+sw+sd-24h-eu-8.grib
cdo --eccodes ymonadd era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d,2t,rsn,sd,stl1,swvl1,swvl2,swvl3,swvl4 ens/ec-sf__all-24h-eu-9.grib ens/ec-bsf__t+sw+sd-24h-eu-9.grib
....

So what I see is that '{}' is replaced by the integers upto 50, but '$year${month}' is left untouched. That's why I thought these variables must be set somewhere else. You could add '-v' to the parallel options to see which CDO call fails. then we can debug this call.

RE: ymonadd (Abort): Month index 5 already allocated! - Added by Ralf Mueller almost 4 years ago

sorry - I missed the year/month values from the text

RE: ymonadd (Abort): Month index 5 already allocated! - Added by Ralf Mueller almost 4 years ago

cdo --eccodes -ymonadd -selname,2d era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib -remapbil,era5-eu-grid -selvar,2d ec-sf_202006_all-24h-eu-6.grib o.grib
perfectly reproduces your error. the inputs lool ok to me, so I think this is a bug in CDO.

RE: ymonadd (Abort): Month index 5 already allocated! - Added by Uwe Schulzweida almost 4 years ago

The second input file of ymonadd must contain the monthly mean values. The input streams must therefore be swapped:

cdo --eccodes -ymonadd -remapbil,era5-eu-grid -selvar,2d ec-sf_202006_all-24h-eu-6.grib -selname,2d era5-ecsf_2000-2019_t+sw+sd-monthly-eu-bias.grib o.grib

RE: ymonadd (Abort): Month index 5 already allocated! - Added by Ralf Mueller almost 4 years ago

ah, right. THIS addition is not commutative! :)

now it works out-of-the-box

    (1-9/9)