Help to read grib files

Wesley Ebisuzaki Wesley.Ebisuzaki at NOAA.GOV
Wed Apr 12 09:51:53 EDT 2006


oluseun idowu wrote:

>Dear Diane,
>Many thanks for your help. I gave the command
>
>[oluseun at b129pc124 ~]$ gribmap -v -i sample_grib_file.ctl
>
>This is the error message
>
>Open Error:  Missing or invalid dimension increment value
>  --> The invalid description file record is:
>  --> xdef 432 linear 340.000000 -32.767000
>
>  The data file was not opened.
>File name is:  sample_grib_file.ctl
>
>Anyway as you suggested, I attach the file to this email and again, the data was received from UK Met Office
>from their limited area model
>
>I will expect your reply. Thanks once more!
>
>Idowu
>
Idowu,

    Your sample grib file has a bad grid definition section.

rec 1:0:date 2006032018 PVORT kpds5=4 kpds6=205 kpds7=1 levels=(0,1)
grid=255  48hr fcst:
  PVORT=Pot. vorticity [km^2/kg/s]
  timerange 0 P1 48 P2 0 TimeU 1  nx 432 ny 432 GDS grid 0 num_in_ave 0
missing 0
  center 74 subcenter 2 process 1 Table 160 scan: WE:SN winds(N/S)
  latlon: lat  -37.500000 to 40.080000 by 0.000000  (**** 0 is not right
***)  nxny 186624
          long 340.000000 to 57.580000 by 0.000000, (*** 0 is not right
*** ) (432 x 432) scan 64 mode 0 bdsgrid 1
  min/max data 269.25 314.125  num bits 24  BDS_Ref 269.25  DecScale 0
BinScale -18

Because of the error in the grib file, grib2ctl.pl will not produce a
valid xdef/ydef lines.
In addition, the grib table is not included in wgrib (center 74-2 table
160), so wgrib uses
the names from the NCEP table (PVORT) which is probably wrong.  You need
to used a user defined grib table

        ftp://ftpprd.ncep.noaa.gov/pub/cpc/wd51we/wgrib/usertables.txt

So you should fix the grib file and make a user grib table.  Until then,
here
is a working ctl file.

------------------------- junk.ctl -------------------------
dset ^sample_grib_file.grib
index ^sample_grib_file.grib.idx
undef 9.999E+20
title sample_grib_file.grib
*  produced by grib2ctl v0.9.12.5p36 with some modification because of a
bad grib file
dtype grib 255
ydef 432 linear -37.500000 .1795
xdef 432 linear 340.000000 .1795
tdef 2 linear 18Z22mar2006 6hr
zdef 1 linear 1 1
vars 1
unknown 0 4,205,1  ** some unknown variable
ENDVARS
---------------------- end junk.ctl ------------------------------

% gribmap -i junk.ctl





            Wesley Ebisuzaki



More information about the gradsusr mailing list