[gradsusr] mysterious scripting error

Jeff Duda jeffduda319 at gmail.com
Thu Dec 29 14:52:16 EST 2016


Gary,
Thanks for your reply.

Yes, it is my own personal script. Here is the code for assigning the
arrays:

'set gxout print'
'set prnopts %g 1'
'd 2.5e6*qvapor'
tt = 1
while (tt <= nt)
 lvq.tt = sublin(result,blank_lines+tt)
 say tt" "lvq.tt" "nt
 tt = tt + 1
endwhile
'd 1005*(t+300)'
tt = 1
while (tt <= nt)
 CpT.tt = sublin(result,blank_lines+tt)
 say tt" "CpT.tt" "nt
 tt = tt + 1
endwhile

Output from this portion is shown as:

1 43504.7  13
2 43400.9  13
3 44271.9  13
4 42382.9  13
5 42426  13
6 40946.4  13
7 37313.4  13
8 32887.1  13
9 30245.9  13
10 30008.8  13
11 28724.1  13
12 29439.1  13
13 28436.3  13
1 302984  13
2 303499  13
3 304544  13
4 306799  13
5 307953  13
6 309824  13
7 311769  13
8 313546  13
9 314621  13
10 315541  13
11 316056  13
12 316285  13
13 316526  13

so in this script instance, nt is set to 13 (and I checked the code to make
sure nt doesn't get changed later on in the script, and it doesn't), and
CpT.nt = CpT.13 = 316526. I added
say CpT.nt
just before the code line where the crash is occurring. It prints
accurately. However, the very next line...Grads just doesn't like it.

I'm running the pre-compiled version 2.1.a3 on Linux. Not sure if it's the
CentOS5.9 or the i686 compilation, though.

Jeff

On Thu, Dec 29, 2016 at 1:35 PM, Love, Mr. Gary, Contractor, Code 7542 <
gary.love.ctr at nrlmry.navy.mil> wrote:

> Hi Jeff,
>
>
>
> Your script must be local to you. I could not find it at
> ftp://cola.gmu.edu/grads/scripts/
>
>
>
> Anyway I made a simple test script shown below that works fine, so there
> must be an assignment problem in you script probably with CpT.1 or CpT.nt.
>
>
>
> function main()
>
> nt=10
>
> CpT.1=302984
>
> CpT.nt=316526
>
> a=CpT.1
>
> b=CpT.nt
>
> say a
>
> say b
>
> deltatheta=b-a
>
> say deltatheta
>
> return
>
>
>
> Gary
>
>
>
> *From:* gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces@
> gradsusr.org] *On Behalf Of *Jeff Duda
> *Sent:* Thursday, December 29, 2016 10:55 AM
> *To:* GrADS Users Forum
> *Subject:* [gradsusr] mysterious scripting error
>
>
>
> I have this snippet of code:
>
> a = CpT.1
> b = CpT.nt
> say a
> say b
> *deltatheta = b-a*
> say deltatheta
>
> where CpT.1 and CpT.nt have been previously defined.  When I run the
> script, I get this output
>
> 302984
> 316526
> Non-numeric args to numeric operation
>   Error occurred on line 62
>   In file mixing_diagram.gs
>
> Line 62 is underlined and in bold in the code above. Why is this error
> occurring?
>
> Jeff Duda
>
>
> --
>
> Jeff Duda
> Post-doctoral research fellow
> University of Oklahoma School of Meteorology
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Post-doctoral research fellow
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20161229/3ab7ce86/attachment-0001.html 


More information about the gradsusr mailing list