I can think of two possible errors:<br>1) Your control file doesn't properly open the .dat files<br>2) When a variable is defined within Grads, sometimes the output from displaying that variable occurs on only one line, so trying to grab data from the second line of output would give you nothing. Try putting in a print statement there to see if that is happening.<br>
<br>Jeff Duda<br><br><div class="gmail_quote">On Wed, Aug 10, 2011 at 4:01 PM, Krishna Santhanam <span dir="ltr"><<a href="mailto:KSanthanam@everpower.com">KSanthanam@everpower.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am trying to fetch average monthly values for the following.<br>
<br>
I have a ctl file which opens about 8496 files (.dat grads file every 10 minutes for 2 months) the data set is defined as<br>
<br>
dset ^fname_%y4-%m2-%d2_%h2_%n2.dat<br>
<br>
I have a grads script with the following<br>
<br>
function main()<br>
'open fname.ctl'<br>
cntx=32<br>
while(cntx<=121)<br>
cnty=17<br>
while(cnty<=110)<br>
'set x 'cntx<br>
'set y 'cnty<br>
'define wind=sqrt(umet*umet+vmet*vmet)'<br>
'define mwind=ave(wind,t=1,t=4460)'<br>
'd mwind'<br>
dum1=sublin(result,2)<br>
lrn=subwrd(dum1,4)<br>
w=write(tmp1.dat,lrn)<br>
cnty=cnty+1<br>
endwhile<br>
cntx=cntx+1<br>
endwhile<br>
<br>
I have a file written with nothing in that, could someone tell me what is wrong?<br>
<br>
Thanks,<br>
Krishna<br>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/~jdduda">www.meteor.iastate.edu/~jdduda</a><br>