Project

General

Profile

Error when using "timselavg"

Added by Jia Wang 3 months ago

I have 3 files, for which I want to calculate the average. These are the steps I have taken:

Put all 3 files into a single file:
grib_copy 10.grb 11.grb 12.grb total.grb

Calculate the average:
cdo --timestat_date last -mulc,1 -timselavg,3 total.grb avg.grb

Then I got the error:
cdo(1) timselavg: Process started
cdi warning (gribapiScanTimestep2): Record 3 (name=tp id=8.1.0 lev1=0 lev2=0) timestep 2: Parameter not defined at timestep 1!
cdo(1) timselavg: Open failed on >total.grb<
Unsupported file structure

The variable "tp" exists in all three files. So why is this error?

12.grb (375 KB) 12.grb
11.grb (1.03 MB) 11.grb
10.grb (1.03 MB) 10.grb
total.grb (2.43 MB) total.grb

Replies (3)

RE: Error when using "timselavg" - Added by Uwe Schulzweida 3 months ago

The third file 12.grb has a different GRIB dataType, so this record is interpreted as a different variable in CDO.
Try cdo copy:

cdo copy 10.grb 11.grb 12.grb total.grb

RE: Error when using "timselavg" - Added by Jia Wang 3 months ago

Thanks.

I noticed that for "10.grb" and "11.grb", the data type (Dtype from the "cdo sinfo") is P13, and for "12.grb", the data type is P20.

Am I able to change the data type so that I could use the "grib_copy" command?

RE: Error when using "timselavg" - Added by Uwe Schulzweida 3 months ago

I mean the dataType key from ecCodes which seems to be missing for 10.grb and 11.grb:

grib_ls 12.grb 
12.grb
edition  centre   date       dataType  gridType     typeOfLevel  level  stepRange  shortName  packingType  
2        kwbc     20210105   an        polar_stere  surface      0      0-24       tp         grid_complex_spatial_differencing 

    (1-3/3)