<p dir="ltr">Along with the suggested changes simply press enter button once at ending line of your script.</p>
<div class="gmail_quote">On 5 Jul 2016 8:45 pm, "Justin Hicks" <<a href="mailto:jhicks2014@gmail.com">jhicks2014@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 "Unable to locate ENDWHILE statement for the WHILE statement at line 18."</div><div><br></div><div>This is the script I'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>'reinit'</div><div>'open /data2/control/Region15_AFR_mask_TEST.nc'</div><div>'set t 1 last'</div><div>'set dfile 1'</div><div>'set lon -179.5 179.5'</div><div>'set lat -89.5 89.5'</div><div>'open /data2/control/GLDAS_VIC10_M.ctl'</div><div>'set dfile 2'</div><div>'set lon -179.5 179.5'</div><div>'set lat -89.5 89.5'</div><div>'set time 00Z01JAN1979 00Z01JAN2016'</div><div>'set dfile 1'</div><div>'d aave(maskout(evap.2,mask.1(time=00Z01JAN1979)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)'</div><div>'set gxout print'</div><div>'set prnopts %6.2f 1 1'</div><div>nmonths = 428</div><div>i = 1</div><div>while (i <= nmonths)</div><div> 'set t 'i</div><div> 'q time'</div><div>rectime = sublin(result,5)</div><div>recdate = subwrd(rectime,6) </div><div> 'd aave(maskout(evap.2,mask.1(time=00Z01JAN1979)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)'</div><div>evap = sublin(result,2)</div><div>evap = subwrd(evap,1)</div><div>string = rectime' 'evap</div><div> 'write('GLDAS_MASK_DATA.txt' , string ,append)'</div><div> i = i + 1</div><div>endwhile</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>I'm not sure why GrADS is giving me this error.</div><div><br></div><div>-Justin</div></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>