Project

General

Profile

DWD ICON EPS ensemble statistics

Added by Sebastian Müller 3 months ago

Ciao everyone,

when examining a DWD ensemble forecast, like the file attached, cdo ens"stat" does not work. Instead I need to use vars"stat" for ensemble statistics. Now I am missing vars"median", which does not exist, so the equivalent to ens"median". Can anybody see a way to work this out?

Cheers and thanks in advance
Sebastian


Replies (5)

RE: DWD ICON EPS ensemble statistics - Added by Sebastian Müller 3 months ago

in case the version matters:

cdo -V
Climate Data Operators version 2.5.0 (https://mpimet.mpg.de/cdo)
System: x86_64-conda-linux-gnu
....
CDI library version : 2.5.0
cgribex library version : 2.3.1
ecCodes library version : 2.44.0
NetCDF library version : 4.9.3 of Sep 15 2025 22:55:31 $
exse library version : 2.0.0
FILE library version : 1.9.1

RE: DWD ICON EPS ensemble statistics - Added by Karin Meier-Fleischer 3 months ago

Due to the fact of a missing varsmedian operator I guess you have to use a workaround (but maybe I miss something). I wrote a short shell script that converts the GRIB file to netCDF, splits the variables into single files, so we are able to use ensmedian here.

#!/bin/bash

infile=$HOME/Downloads/icon-eu-eps_europe_icosahedral_single-level_2025110300_072_snow_gsp.grib2

varname=$(cdo -s -t ecmwf showname $infile | sed -e 's/[[:space:]]\+/ /g' | cut -d ' ' -f 2)

cdo -s -f nc -copy $infile infile.nc
cdo -s -splitname infile.nc var_

nens=$(cdo -s showname $infile | wc -w)
for i in $(seq 1 $nens)
do
    if [ $i != 1 ]; then
        ifile=var_${varname}_${i}.nc
        name=$(cdo -s -showname $ifile)        
        cdo -s -chname,${varname}_${i},${varname} $ifile tmp.nc
        mv tmp.nc $ifile
    fi
done

cdo -O -ensmedian var_*.nc outfile.nc

RE: DWD ICON EPS ensemble statistics - Added by Sebastian Müller 3 months ago

Dear Karin,
thanks for providing this workaround. It is not the elegant solution I was hoping for and I will have to see how I can get this operational in my routine.
If anybody else knows how to do this without splitting the file, most welcome!
Thanks anyway!
Sebastian

RE: DWD ICON EPS ensemble statistics - Added by Uwe Schulzweida 3 months ago

Hello Sebastian,

The next CDO release 2.6.0 comes with the operator varsmedian. A prerelease for testing is available on levante:/home/m/m214003/local/bin/cdo.

Cheers,
Uwe

RE: DWD ICON EPS ensemble statistics - Added by Sebastian Müller 3 months ago

Ciao Uwe,

thank you for your response and for these great news. I am very much looking forward to the new release then!

Best regards
Sebastian

    (1-5/5)