<div dir="ltr"><div><div><div>Gary,<br></div>I decided to use the valnum() function to see what was going on. It confirmed that the values I was assigning to CpT.xx were not considered integers. I figured that might have been the result of using 'set gxout print' to obtain the values. While it doesn't make sense that the gxout setting should make the difference, I nonetheless tried using a different gxout setting and fixed the time so that displaying the field would still give me a printed value. For whatever reason, that worked. Seems really picky of the language, but I guess that's what you have to do.<br><br></div>Thanks for your guidance, sir. Helps to have someone to bounce ideas off of.<br><br></div>Jeff <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 29, 2016 at 2:19 PM, Love, Mr. Gary, Contractor, Code 7542 <span dir="ltr"><<a href="mailto:gary.love.ctr@nrlmry.navy.mil" target="_blank">gary.love.ctr@nrlmry.navy.mil</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div class="m_-2062130145221000675WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Jeff,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m running version 2.1.a2 on Linux we compiled here at NRL. Here are the stats:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">grads: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’d try another version of Grads, especially v1.9 since I have encountered bugs in v2.1.a2. Grads creates link lists of variables when they are subscripted, i.e., CpT.nt. There may be a problem following the links and retrieving the value.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Gary<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a> [mailto:<a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@<wbr>gradsusr.org</a>] <b>On Behalf Of </b>Jeff Duda<br><b>Sent:</b> Thursday, December 29, 2016 11:52 AM<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> Re: [gradsusr] mysterious scripting error<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><div><div><p class="MsoNormal">Gary,<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">Thanks for your reply.<u></u><u></u></p></div><p class="MsoNormal">Yes, it is my own personal script. Here is the code for assigning the arrays:<br><br>'set gxout print' <br>'set prnopts %g 1'<br>'d 2.5e6*qvapor'<br>tt = 1 <br>while (tt <= nt) <br> <a href="http://lvq.tt" target="_blank">lvq.tt</a> = sublin(result,blank_lines+tt)<u></u><u></u></p></div><p class="MsoNormal"> say tt" "<a href="http://lvq.tt" target="_blank">lvq.tt</a>" "nt<u></u><u></u></p><div><p class="MsoNormal"> tt = tt + 1 <br>endwhile <br>'d 1005*(t+300)'<br>tt = 1<br>while (tt <= nt)<br> CpT.tt = sublin(result,blank_lines+tt)<u></u><u></u></p></div><div><p class="MsoNormal"> say tt" "CpT.tt" "nt<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"> tt = tt + 1<br>endwhile <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Output from this portion is shown as:<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">1 43504.7 13<br>2 43400.9 13<br>3 44271.9 13<br>4 42382.9 13<br>5 42426 13<br>6 40946.4 13<br>7 37313.4 13<br>8 32887.1 13<br>9 30245.9 13<br>10 30008.8 13<br>11 28724.1 13<br>12 29439.1 13<br>13 28436.3 13<br>1 302984 13<br>2 303499 13<br>3 304544 13<br>4 306799 13<br>5 307953 13<br>6 309824 13<br>7 311769 13<br>8 313546 13<br>9 314621 13<br>10 315541 13<br>11 316056 13<br>12 316285 13<br>13 316526 13<u></u><u></u></p></div><div><p class="MsoNormal">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<u></u><u></u></p></div><div><p class="MsoNormal">say CpT.nt<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">just before the code line where the crash is occurring. It prints accurately. However, the very next line...Grads just doesn't like it.<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">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.<u></u><u></u></p></div><div><p class="MsoNormal">Jeff<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Thu, Dec 29, 2016 at 1:35 PM, Love, Mr. Gary, Contractor, Code 7542 <<a href="mailto:gary.love.ctr@nrlmry.navy.mil" target="_blank">gary.love.ctr@nrlmry.navy.mil</a><wbr>> wrote:<u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Jeff,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Your script must be local to you. I could not find it at <a href="ftp://cola.gmu.edu/grads/scripts/" target="_blank">ftp://cola.gmu.edu/grads/<wbr>scripts/</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">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.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">function main()</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">nt=10</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">CpT.1=302984</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">CpT.nt=316526</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">a=CpT.1</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">b=CpT.nt</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">say a</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">say b</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">deltatheta=b-a</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">say deltatheta</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">return</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Gary</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a> [mailto:<a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@<wbr>gradsusr.org</a>] <b>On Behalf Of </b>Jeff Duda<br><b>Sent:</b> Thursday, December 29, 2016 10:55 AM<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> [gradsusr] mysterious scripting error</span><u></u><u></u></p><div><div><p class="MsoNormal"> <u></u><u></u></p><div><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">I have this snippet of code:<br><br>a = CpT.1 <br>b = CpT.nt <br>say a <br>say b<br><b><u>deltatheta = b-a</u></b><br>say deltatheta<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">where CpT.1 and CpT.nt have been previously defined. When I run the script, I get this output<br><br>302984 <br>316526 <br>Non-numeric args to numeric operation<br> Error occurred on line 62<br> In file <a href="http://mixing_diagram.gs" target="_blank">mixing_diagram.gs</a><u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">Line 62 is underlined and in bold in the code above. Why is this error occurring?<u></u><u></u></p></div><p class="MsoNormal">Jeff Duda<br clear="all"><u></u><u></u></p><div><div><div><div><div><p class="MsoNormal"><br>-- <u></u><u></u></p><div><div><div><div><div><p class="MsoNormal">Jeff Duda<br>Post-doctoral research fellow<br>University of Oklahoma School of Meteorology<u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><u></u><u></u></p></div><p class="MsoNormal"><br><br clear="all"><br>-- <u></u><u></u></p><div><div><div><div><div><p class="MsoNormal">Jeff Duda<br>Post-doctoral research fellow<br>University of Oklahoma School of Meteorology<u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div><br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research fellow<br>University of Oklahoma School of Meteorology<br></div></div></div></div></div>
</div>