<html><font size="4">Dear Muhammad,<br><br>I think in your loop you have given the condition&nbsp; (m&lt;=353), you try by giving only m&lt;353 because everytime when loop ends it increment the m by 1so and the loop goes upto 353 so the last point it takes is 354 and it is not existing that why may be ??<br><br>Just check out if it works</font><br><div><font color="#0000ff" face="Verdana" size="2"></font>&nbsp;</div>
<blockquote style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;"><font face="Tahoma" size="2">-----Original Message-----<br><b>From:</b> Muhammad Rahiz [mailto:muhammad.rahiz@OUCE.OX.AC.UK]<br><b>Sent:</b> Friday, June 26, 2009 11:40 PM<br><b>To:</b> GRADSUSR@LIST.CINECA.IT<br><b>Subject:</b> Data request warning: Request beyond file limits<br><br></font>I'm trying to get monthly averages from daily data (6hr intervals) from a
master file which contains 353 months and 42,985 time steps.

I ran the following script but got the error - Data request warning: Request
beyond file limits.

Can anyone point out where the mistake is?

Muhammad Rahiz
GrADS v1.9b4 @ Fedora 10
---------------------------

'open rf.tmp.ctl'
'set lon 46.25 114.26'
'set lat -5.07 45.6'
'set t 1'
'set gxout fwrite'
* total number of months
mtot = 353
* month index
m = 1
while(m&lt;=mtot)
res = read('timeseries.txt')
say t1' 't2
t1 = sublin(res,1)
t2 = sublin(res,2)
* calculate the four digit year
yyyy = 1960
* calculate the two digit month
mm = 10
fout = 'tmp.'yyyy''mm'.bin'
'set fwrite 'fout
'define tmon = ave(t,t='t1',t='t2')'
'disable fwrite'
m = m + 1
endwhile

-----------------------------
DSET ^rf.tmp
UNDEF -1.e34
XDEF 303 LINEAR 46.25 0.225198675496689
YDEF 226 LINEAR -5.07 0.2252
ZDEF 1 LEVELS 1008.23
TDEF 42985 LINEAR 06Z01OCT1960 360mn
VARS 1
t 0 99 t
ENDVARS
</blockquote></html>