<div dir="ltr">Stephen,<div><br></div><div>I&#39;ll try as you suggested. I had &#39;q dims&#39; in there initially, so I may have forgotten to change that line. I will get back to you.</div><div><br></div><div>-Justin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 5, 2016 at 11:59 AM, Stephen McMillan <span dir="ltr">&lt;<a href="mailto:smcmillan@planalytics.com" target="_blank">smcmillan@planalytics.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Justin,<div><br></div><div>It appears there may be other problems with your sample script.  For example,</div><div><br></div><div>&#39;q time&#39; should yield only one line, not five.  Perhaps you intended to get the results of &#39;q dim&#39; instead?  That one does produce five lines, and your subwrd(rectime,6) would indeed give you a date.</div><div><br></div><div>Also, after your &#39;d aave(maskout...&#39; in the while loop, you have &quot;evap = sublin(result,2)&quot; which I believe produces only a single line in the result, not two as you code suggests.  For the subsequent line, would you not want &quot;evap = subwrd(evap,4)&quot;?</div><div><br></div><div>Stephen Mc</div></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Jul 5, 2016 at 11:13 AM, Justin Hicks <span dir="ltr">&lt;<a href="mailto:jhicks2014@gmail.com" target="_blank">jhicks2014@gmail.com</a>&gt;</span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">GrADS users,<div><br></div><div>I am running a script that should output values into a 2 column table. The first column will be the time (monthly in the form of 00Z01JAN1979) and the second column will be the value of the variable (evap) at that time. After running the code below, I receive an error saying &quot;Unable to locate ENDWHILE statement for the WHILE statement at line 18.&quot;</div><div><br></div><div>This is the script I&#39;m running; everything before the while statement is setting up a mask (in this case, the mask only outputs values for Africa):</div><div><br></div><div><div>&#39;reinit&#39;</div><div>&#39;open /data2/control/Region15_AFR_mask_TEST.nc&#39;</div><div>&#39;set t 1 last&#39;</div><div>&#39;set dfile 1&#39;</div><div>&#39;set lon -179.5 179.5&#39;</div><div>&#39;set lat -89.5 89.5&#39;</div><div>&#39;open /data2/control/GLDAS_VIC10_M.ctl&#39;</div><div>&#39;set dfile 2&#39;</div><div>&#39;set lon -179.5 179.5&#39;</div><div>&#39;set lat -89.5 89.5&#39;</div><div>&#39;set time 00Z01JAN1979 00Z01JAN2016&#39;</div><div>&#39;set dfile 1&#39;</div><div>&#39;d aave(maskout(evap.2,mask.1(time=00Z01JAN1979)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)&#39;</div><div>&#39;set gxout print&#39;</div><div>&#39;set prnopts %6.2f 1 1&#39;</div><div>nmonths = 428</div><div>i = 1</div><div>while (i &lt;= nmonths)</div><div> &#39;set t &#39;i</div><div> &#39;q time&#39;</div><div>rectime = sublin(result,5)</div><div>recdate = subwrd(rectime,6) </div><div> &#39;d aave(maskout(evap.2,mask.1(time=00Z01JAN1979)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)&#39;</div><div>evap = sublin(result,2)</div><div>evap = subwrd(evap,1)</div><div>string = rectime&#39; &#39;evap</div><div> &#39;write(&#39;GLDAS_MASK_DATA.txt&#39; ,  string ,append)&#39;</div><div> i = i + 1</div><div>endwhile</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>I&#39;m not sure why GrADS is giving me this error.</div><span><font color="#888888"><div><br></div><div>-Justin</div></font></span></div>
<br></div></div><span class="">_______________________________________________<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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></span></blockquote></div><br></div>
<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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>