[gradsusr] what am i doing wrong

Jeffrey Duda jdduda at iastate.edu
Wed Aug 10 18:22:27 EDT 2011


I can think of two possible errors:
1) Your control file doesn't properly open the .dat files
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.

Jeff Duda

On Wed, Aug 10, 2011 at 4:01 PM, Krishna Santhanam <KSanthanam at everpower.com
> wrote:

> I am trying to fetch average monthly values for the following.
>
> 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
>
> dset ^fname_%y4-%m2-%d2_%h2_%n2.dat
>
> I have a grads script with the following
>
> function main()
> 'open fname.ctl'
> cntx=32
> while(cntx<=121)
>  cnty=17
> while(cnty<=110)
> 'set x 'cntx
> 'set y 'cnty
> 'define wind=sqrt(umet*umet+vmet*vmet)'
> 'define mwind=ave(wind,t=1,t=4460)'
> 'd mwind'
> dum1=sublin(result,2)
> lrn=subwrd(dum1,4)
> w=write(tmp1.dat,lrn)
> cnty=cnty+1
> endwhile
> cntx=cntx+1
> endwhile
>
> I have a file written with nothing in that, could someone tell me what is
> wrong?
>
> Thanks,
> Krishna
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>



-- 
Jeff Duda
Iowa State University
Meteorology Graduate Student
3134 Agronomy Hall
www.meteor.iastate.edu/~jdduda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110810/ee79167f/attachment-0003.html 


More information about the gradsusr mailing list