Grads 2.0 with grib2 files

Oliver König oliver at WINDFINDER.COM
Thu Feb 7 10:07:11 EST 2008


Hello Jennifer,
I applied the patch. I still get an error when trying to display data. Here is
what I did on a x86_AMD64 with Debian testing (64 bit):

Installation of grads 2.0 binaries
----------------------------------
# cd /usr/local/bin
# wget ftp://iges.org/grads/2.0/grads-bin-2.0.a0-RHEL5-x86_64.tar.gz
# tar xvfz grads-bin-2.0.a0-RHEL5-x86_64.tar.gz
# mv grads-2.0.a0/bin/* .

Installation of wgrib2 (all supplibs except szip, g2c, udunits are already
installed with Debian package manager apt-get)
----------------------
# wget ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
# tar xvfz wgrib2.tgz
# cd grib2/
# patch g2clib-1.0.5/seekgb.c /home/user/detect_end_grib2_record.patch
# make
# cp wgrib2/wgrib2 /usr/local/bin/

Installation of grads data files
--------------------------------
$ cd /usr/local/lib/
$ mkdir grads
$ cd grads
$ wget ftp://iges.org/grads/data.tar.Z
$ tar xvfz data.tar.Z

Test Grib2
-------------
# cd /home/user/grads/skripts
# wget
ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.2008020706/gfs.t12z.sfluxgrbf12.grib2
# g2ctl.pl -verf gfs.t12z.sfluxgrbf12.grib2 > gfs2.ctl
# gribmap -i gfs2.ctl

# grads
ga-> open gfs2.ctl
ga-> q file
ga-> d tmpsfc
Cannot contour grid - all undefined values

Thanks for your help!
--
Oliver

On Thursday 07 February 2008 13:30:37 Jennifer Adams wrote:
> There is a bug in g2clib that causes it to fail to detect the end of
> a grib2 record if sizeof(g2int) != 4 (i.e. on 64-bit systems). You
> need the following patch to seekgb.c in g2clib:
>
> 39d38
> <       int hdr;
> 69,70c68,69
> <             k4=fread(&hdr,4,1,lugb);                //hard-coded 4
> instead of sizof(g2int)
> <             if (k4 == 1 && hdr == 926365495) {      //GRIB message
> found
> ---
>
>  >             k4=fread(&end,sizeof(g2int),1,lugb);
>  >             if (k4 == 1 && end == 926365495) {      //GRIB message
>
> found
>
> I have patched g2clib-1.0.5 and posted the new src tarball on our ftp
> server:
> ftp://grads.iges.org/grads/Supplibs/2.0/src/g2clib-1.0.5.tar.gz
>
> If implementing this patch and rebuilding the library and relinking
> with grads doesn't fix your problem, please let me know.
> Jennifer
>
> On Feb 7, 2008, at 2:40 AM, Oliver König wrote:
> > On Thursday 07 February 2008 01:36:30 Jennifer Adams wrote:
> >>> $ gribmap -i gfs2.ctl
> >>
> >> What is the output from gribmap if you use the -v option?
> >> --
> >> Jennifer M. Adams
> >
> > $ gribmap -iv gfs2.ctl
> > grib2map: scanning GRIB2 file: gfs.t12z.sfluxgrbf12.grib2
> > grib2map: Writing out the index file
> > $ ls -l gfs.t12z.sfluxgrbf12.grib2.idx
> > -rw-r--r-- 1 user users 1416 2008-02-07 08:35
> > gfs.t12z.sfluxgrbf12.grib2.idx
> >
> > --
> > Oliver König
>
> --
> Jennifer M. Adams
> IGES/COLA
> 4041 Powder Mill Road, Suite 302
> Calverton, MD 20705
> jma at cola.iges.org



--
Oliver König

Windfinder.com
Knorrstr. 24 Hinterhaus
24106 Kiel
GERMANY
phone: +49 431 8008643
VoIP: +49 431 5569222
fax:  +49 431 8008644
cell: +49 177 4933362
Skype: windfinder.com
www.windfinder.com
oliver at windfinder.com

VAT-Identification No.: DE256259408



More information about the gradsusr mailing list