From grib file to binary file

Anelise Baur anelisebaur at YAHOO.COM.BR
Thu Jul 17 16:04:11 EDT 2008


Hello grads users!
 
I’m trying to write a single binary file, the first records from two different grib files (nww3.UGRD.grb and nww3.VGRD.grb, from NOAA’s site). When I open this new file in GRADS I keep getting errors, particularly for the second variable. Can someone help me?
My procedures were:
 
1º I’ve created the .ctl files (nww3.UGRD.ctl and nww3.VGRD.ctl) with grib2ctl.pl; I’ve obtained the following files:
 
dset ^nww3.UGRD.grb
index ^nww3.UGRD.grb.idx
undef 9.999E+20
title nww3.UGRD.grb
* produced by grib2ctl v0.9.12.5p39c
dtype grib 233
options yrev
ydef 157 linear -78.000000 1
xdef 288 linear 0.000000 1.250000
tdef 61 linear 12Z28apr2008 3hr
zdef 1 linear 1 1
vars 1
UGRDsfc 0 33,1,1 ** surface u wind [m/s]
ENDVARS
 
 

dset ^nww3.vgrd.grb
index ^nww3.vgrd.grb.idx
undef 9.999E+20
title nww3.vgrd.grb
* produced by grib2ctl v0.9.12.5p39c
dtype grib 233
options yrev
ydef 157 linear -78.000000 1
xdef 288 linear 0.000000 1.250000
tdef 61 linear 12Z28apr2008 3hr
zdef 1 linear 1 1
vars 1
VGRDsfc 0 34,1,1 ** surface v wind [m/s]
ENDVARS
 
2º I’ve created the grb.idx files (nww3.UGRD.grb.idx and nww3.VGRD.grb.idx) with grib2ctl.pl and gribmap.
 
3º I’ve opened nww3.UGRD.ctl and nww3.VGRD.ctl in the GRADS.
 
4º I did ‘set gxout fwrite’, then ‘d UGRDsfc’ and ‘d VGRDsfc’. I’ve obtained the binary file grads.fwrite (with 354kb).
 
5º Then, I’ve created a .ctl file for the file grads.fwrite, called teste.ctl:
 
dset ^grads.fwrite
undef 9.999E+20
title teste20_06
ydef 158 linear -78.000000 1
xdef 289 linear 0.000000 1.250000
tdef 1 linear 12Z28apr2008 3hr
zdef 1 linear 1 1
vars 2
u 0 99 ** surface v wind [m/s]
v 0 99 ** surface v wind [m/s]
ENDVARS
 
6º I’ve opened teste.ctl in the GRADS, and I’ve written ‘set gxout shaded’, then ‘d u’, without problems. The problem appears when I display the next variable,v. GRADS doesn’t recognize v. The error is:
 
 
Low Level I/O Error: Read error on data file 
Data file name = e:/swan_pendrive/02_07/25_06/25_06/grads.fwrite 
Error reading 289 bytes at location 90457 
Data Request Error: Error for variable 'v'
Error ocurred at column 1
DISPLAY error: Invalid expression 
Expression = v
 
 
It indicates a problem with the binary file grads.fwrite. 
 
Thanks in advance,
 
Anelise Pereira Baur
Universidade Federal do Rio Grande do Sul
Instituto de Matemática
anelisebaur at yahoo.com.br 


      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080717/45ae56e9/attachment.html 


More information about the gradsusr mailing list