read text

Mary Jo Nath Mary-Jo.Nath at NOAA.GOV
Thu Dec 14 15:05:38 EST 2006


I think you have a few syntax errors. Try this:

Instead of

        sxy=1

which defines a script variable named "sxy" = 0, use

        'define sxy=0.'

which defines a GrADS variable = 0.


Instead of

        'set t 'n''
use
        'set t 'n

Instead of

        'define sxy=sxy+x.n*y'n''

use
        'define sxy=sxy+x.'n'*y'n




lorna nayagam wrote:
> hello all,
> i tried the method told by u poeple but got the
> following problem, when i did the following script.
>
> **********************
> ***     script    ****
> **********************
>
> flag=1
> i=1
> while(flag!=2)
>     file = read(tmp.dat)
>     line = sublin(file,2)
>     x.i = subwrd(line,1)
>     flag = sublin(file,1)
>     flag = subwrd(flag,1)
>     i=i+1
> endwhile
>
> 'open sst.ctl'
>
> sxy=0
> n=1
> while(n<=600)
> 'set t 'n''
> 'define y'n'=sst(t='n')'
> 'define sxy=sxy+x.n*y'n''
> n=n+1
> endwhile
>
> *****************************
> **         error           **
> *****************************
>
> Syntax error: Bad file number for variable x
>   Error ocurred at column 5
> DEFINE error:  Invalid expression.
> Segmentation fault
>
>
> i could not understand why this happen. Thanks for
> your help and time.
>
> Ms. Lorna R. Nayagam,
> Junior Research Fellow,
> Department of Atmospheric Sciences,
> Cochin University of Science and Technology,
> Finearts Avenue, Cochin 682016
>
>
>
>
> ____________________________________________________________________________________
> Cheap talk?
> Check out Yahoo! Messenger's low PC-to-Phone call rates.
> http://voice.yahoo.com
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mary-Jo.Nath.vcf
Type: text/x-vcard
Size: 217 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20061214/9369e100/attachment.vcf 


More information about the gradsusr mailing list