Project

General

Profile

cdo remapbil problem: bad record length written in new file?

Added by Francesco De Biasio almost 13 years ago

Hello,
I'm facing a problem with cdo-transformed grib files, and I would like to draw your attention to the problem, in case someone has already encountered this particular problem OR finds out some error in my procedure.

Using the remapbil on a ECMWF grib file (containing 6 parameters at the same instant), it appears that one of the records has a bad length written in the octets 5 to 7: the actual record length differs by 2 bytes.
Here is the wgrib inventory:
$ wgrib ICD201106290000062912001
1:0:d=11062900:10V:kpds5=166:kpds6=1:kpds7=0:TR=0:P1=12:P2=0:TimeU=1:sfc:12hr fcst:NAve=0
2:19032:d=11062900:SSTK:kpds5=34:kpds6=1:kpds7=0:TR=0:P1=12:P2=0:TimeU=1:sfc:12hr fcst:NAve=0
3:44376:d=11062900:MSL:kpds5=151:kpds6=1:kpds7=0:TR=0:P1=12:P2=0:TimeU=1:sfc:12hr fcst:NAve=0
4:63408:d=11062900:2T:kpds5=167:kpds6=1:kpds7=0:TR=0:P1=12:P2=0:TimeU=1:sfc:12hr fcst:NAve=0
5:82440:d=11062900:2D:kpds5=168:kpds6=1:kpds7=0:TR=0:P1=12:P2=0:TimeU=1:sfc:12hr fcst:NAve=0
6:101472:d=11062900:10U:kpds5=165:kpds6=1:kpds7=0:TR=0:P1=12:P2=0:TimeU=1:sfc:12hr fcst:NAve=0

and here is the record lengths written in the 5-to-7 first two octets of the remapped file:
record 1: data length: 19028
record 2: data length: 25342

the second length should be 25340, if I am not wrong, because

4+19028+4+25340 = 44376,

which is exactly where the third record is supposed to start, given the wgrib inventory.

Instead, the third record is declared to start from byte 44378, and the GRIB mark of the third record gets lost.

my CDO version is:

$ cdo -V
Climate Data Operators version 1.5.0 (http://code.zmaw.de/projects/cdo)
Compiler: gcc -std=gnu99 -g -O2
version: gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
with: PTHREADS Z
Compiled: by venezia on celd01 (i686-pc-linux-gnu) Mar 16 2011 16:47:51
CDI library version : 1.5.0 of Mar 16 2011 16:47:44
CGRIBEX library version : 1.5.0 of Feb 15 2011 10:23:39
SERVICE library version : 1.3.0 of Mar 16 2011 16:47:34
EXTRA library version : 1.3.0 of Mar 16 2011 16:47:29
IEG library version : 1.3.0 of Mar 16 2011 16:47:32
FILE library version : 1.7.1 of Mar 16 2011 16:47:29

in attachment you find the remapped grib file (ICD201106290000062912001)
along with the original ECMWF (IGD06290000062912001) file from which I got the remapped file using the grid definition contained in the third attached file (grid0250.conf).

The command I use is:

"$ cdo remapbil,grid0250.conf IGD06290000062912001 ICD201106290000062912001".

If I can provide any other information about the case, please let me know

regards

Francesco


Replies (1)

RE: cdo remapbil problem: bad record length written in new file? - Added by Uwe Schulzweida almost 13 years ago

Its not clear for me where the second 4 comes from. The actual offset of the third record is only 2 bytes:

4+19028+2+25342 = 44376

    (1-1/1)