<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=357344306-19062006>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>hopefully I have
made a simple mistake and this is an easy fix...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV>
<DIV><SPAN class=357344306-19062006><FONT face=Arial><FONT size=2>I have a grib
and ctl file (see attached). with a 2.5X2.5 grid, 145 lons, 73 lats,
time=312<SPAN class=455272207-19062006><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=357344306-19062006><FONT face=Arial><FONT size=2><SPAN
class=455272207-19062006></SPAN></FONT></FONT></SPAN> </DIV>
<DIV><SPAN class=357344306-19062006><FONT face=Arial><FONT color=#0000ff
size=2><SPAN class=455272207-19062006>couldnt attach grib file as too big but
this is the output from a wgrib -V call on the last
record: </SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=357344306-19062006><FONT face=Arial><FONT color=#0000ff
size=2><SPAN class=455272207-19062006> </SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=357344306-19062006><FONT face=Arial><FONT size=2><FONT
color=#0000ff><SPAN class=455272207-19062006> </SPAN>rec 312:6613726:date
2004120100 APCP kpds5=61 kpds6=1 kpds7=0 levels=(0,0) grid=255 sfc
anl:<BR> APCP=Total precipitation [kg/m^2]<BR> timerange 10 P1 0 P2
0 TimeU 1 nx 145 ny 73 GDS grid 0 num_in_ave 0 missing 0<BR> center
54 subcenter 0 process 45 Table 2<BR> latlon: lat -90.000000 to
90.000000 by 2.500000 nxny
10585<BR> long 0.000000 to
360.000000 by 2.500000, (145 x 73) scan 64 mode 136 bdsgrid 1<BR> min/max
data -1 1557.09 num bits 16 BDS_Ref -1e+06 DecScale 6 BinScale
15<BR></FONT></DIV></FONT></FONT></SPAN>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>I want the output in
binary format for reading into fortran. I have a simple script to do
this:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006>---------------------------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>'set gxout
fwrite'<BR>'set fwrite
pcpn_xie_arkin_1979_2005_2.5x2.5_ms.dat'</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>'set y 1 73'<BR>'set
x 1 145'</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>tvar=1<BR>while
(tvar<=312)<BR>'set t 'tvar<BR>'d
apcpsfc'<BR>tvar=tvar+1<BR>endwhile</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>'disable
fwrite'</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006>-----------------------------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>and my ctl file for
the binary data is this:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006><SPAN
class=455272207-19062006>-----------------------------------------------------------------------------------</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>DSET
pcpn_xie_arkin_1979_2005_2.5x2.5_ms.dat<BR>TITLE xie arkin surf total precip
kg/m^2 3mon avg<BR>OPTIONS sequential<BR>UNDEF 99999.9<BR>XDEF 145 LINEAR 0.0
2.5<BR>YDEF 73 LINEAR -90.000 2.5<BR>ZDEF 1 LINEAR 1 1<BR>TDEF 312 LINEAR
JAN1979 1mo<BR>VARS 1<BR>prp 1 99 DMP output
variable<BR>ENDVARS</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006><SPAN
class=455272207-19062006>-----------------------------------------------------------------------------------</SPAN></SPAN></FONT></DIV></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>When I run the
script it all looks fine but unfortunately when I examine the
resultant binary file, at each time step the grid shifts slightly in
the x direction. So at a later time step e.g. set t 200, when compared with the
original grib data, though the binary displays the same pattern it is quite
obviously shifted in the x direction. I was thinking it may have something to do
with the 145 lons - as the zero is repeated twice
(0/360)??</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>I would really
appreciate any suggestions as I have also tried decoding with wgrib and again it
looks like it does everything correctly but the outputted binary pattern at the
various time steps, though on the correct grid this time, displays a
different pattern to the original grib data. So again I would welcome
any suggestions from anyone more familiar with grib. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>Thankyou for your
time.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006>Regards,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=357344306-19062006>Lyn
Bettio</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=357344306-19062006></SPAN></FONT> </DIV></BODY></HTML>