Merging GRIB variables with different time definitions without creating a new dimension
Added by Guido Cioni about 2 months ago
I'm trying to merge two GRIB files with instantaneous pressure variables
File format : GRIB2
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name
1 : ECMWF unknown v instant 10 1 1038240 1 P16 : pv
2 : ECMWF unknown v instant 10 1 1038240 1 P16 : z
3 : ECMWF unknown v instant 10 1 1038240 1 P16 : t
4 : ECMWF unknown v instant 10 1 1038240 1 P16 : q
5 : ECMWF unknown v instant 10 1 1038240 1 P16 : w
6 : ECMWF unknown v instant 10 1 1038240 1 P16 : u
7 : ECMWF unknown v instant 10 1 1038240 1 P16 : v
Grid coordinates :
1 : lonlat : points=1038240 (1440x721)
lon : 0 to 359.75 by 0.25 degrees_east circular
lat : 90 to -90 by -0.25 degrees_north
Vertical coordinates :
1 : pressure : levels=10
plev : 10000 to 100000 by 10000 Pa
Time coordinate :
time : 1 step
RefTime = 2025-09-09 00:00:00 Units = hours Calendar = proleptic_gregorian
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
2025-09-09 02:00:00
and accumulated radiation variables
File format : GRIB2
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name
1 : ECMWF unknown v accum 1 1 1038240 1 P16 : ssrd
2 : ECMWF unknown v accum 1 2 1038240 1 P16 : ttr
Grid coordinates :
1 : lonlat : points=1038240 (1440x721)
lon : 0 to 359.75 by 0.25 degrees_east circular
lat : 90 to -90 by -0.25 degrees_north
Vertical coordinates :
1 : surface : levels=1
2 : top_of_atmosphere : levels=1
Time coordinate :
time : 1 step
RefTime = 2025-09-09 00:00:00 Units = hours Calendar = proleptic_gregorian
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
2025-09-09 02:00:00
When merging the two files, even if they have the same validity time, two different time dimensions are created ( time and time1 ) I guess because of the different time definitions.
Is it a requirement for GRIB files? Unfortunately the parser we're using at work does not like the fact that there are two time dimensions in the same file... Is there any workaround?
Replies (4)
RE: Merging GRIB variables with different time definitions without creating a new dimension - Added by Uwe Schulzweida about 2 months ago
Hello Guido,
When merging GRIB files, the content of the GRIB records is not changed. This means that the content remains exactly the same as before the merge, if the output format is not changed.
However, problems may arise in CDO when reading the result of the merge, as the inventory must be recreated every time.
If you make the GRIB files available, I will take a look at them.
Cheers,
Uwe
RE: Merging GRIB variables with different time definitions without creating a new dimension - Added by Guido Cioni about 2 months ago
To be fair I don't know if this is an issue with CDO but rather an issue with GRIB files per se, I'm just trying to understand whether there's way, with CDO, to force merge these two files without needing an extra time dimension 
I'm attaching the files (just a SMIDGE below the maximum upload limit), but they're just IFS GRIB2 files.
RE: Merging GRIB variables with different time definitions without creating a new dimension - Added by Guido Cioni about 2 months ago
Here is the surface one
RE: Merging GRIB variables with different time definitions without creating a new dimension - Added by Uwe Schulzweida about 2 months ago
Thanks for the data! I couldn't find any problems with CDO here.