<div dir="ltr">Hello, I am trying to write a script in which a loop is used to compile 
raw data values for each month in years 1906-2010 for a specific pair of
 lat-long coordinates.  Below is the code I am using.....<br><br>


















<p><span> </span>&#39;reinit&#39;</p>

<p>* </p>

<p>&#39;sdfopen
<a href="http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/dai_pdsi/pdsi.mon.mean.selfcalibrated.nc" target="_blank">http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/dai_pdsi/pdsi.mon.mean.selfcalibrated.nc</a>&#39;</p>



<p>*</p>

<p><span> </span>&#39;enable print
grads.outfile&#39;</p>

<p><span>  </span>say &#39;** OUTPUT
FILE: grads.outfile&#39;</p>

<p><span> </span>&#39;clear&#39;</p>

<p><span> </span>&#39;set grads off&#39;</p>

<p><span> </span>&#39;set mpdset
lores&#39; </p>

<p><span> </span>&#39;set lon 110W
112.5W&#39;</p>

<p><span> </span>&#39;set lat 32N
34.5N&#39;</p>

<p> </p>

<p>arg=(pdsi.1,t=673,t=1932,t=1)</p>

<p>var=subwrd(arg,1)</p>

<p>start=subwrd(arg,2)</p>

<p>end=subwrd(arg,3)</p>

<p>by=subwrd(arg,4)</p>

<p>if (by=’’)</p>

<p>by=1</p>

<p>endif</p>

<p>say var ‘=’ start‘ to ‘ end ‘ step ‘ by</p>

<p>*get grads commands</p>

<p>ncmd=0</p>

<p>flag=1</p>

<p>while (flag=1)</p>

<p><span>  </span>say ‘enter
command:’</p>

<p><span>  </span>pull command.ncmd</p>

<p><span>  </span>if
(command.ncmd = ‘ ‘)</p>

<p><span>   
</span>flag=0</p>

<p><span>  </span>else</p>

<p><span>   
</span>ncmd=ncmd+1</p>

<p><span>  </span>endif</p>

<p>endwhile</p>

<p>*</p>

<p>i=start</p>

<p>while (i&lt;= end)</p>

<p><span>   
</span>‘set ‘ var ‘ ‘ i</p>

<p><span>   
</span>‘clear’</p>

<p><span>   
</span>‘set grads off’</p>

<p><span>   
</span>j=0</p>

<p><span>   
</span>while (j&lt; ncmd)</p>

<p><span>      </span>command.j</p>

<p><span>      </span>j=j+1</p>

<p><span>   
</span>endwhile</p>

<p><span>   
</span>‘draw title ‘ var ‘=’ i</p>

<p><span>   
</span>say var ‘=’ i ‘ enter &lt;cr&gt; for next’</p>

<p><span>   
</span>pull x</p>

<p><span>   
</span>i=i+by</p>

<p>endwhile</p>

<p>exit </p>





<br> I keep getting an error message for line 13.  Could someone please tell me what is wrong.<br>Thanks,<div><div dir="ltr"><span style="color:rgb(106,168,79)"><b>Emily P. Wilson, Intern</b></span><br><span style="color:rgb(61,133,198)">Research and Conservation Department<br>
Denver Botanic Gardens<br>1007 York St.<br>Denver, CO 80206<br>720-865-3593</span></div></div>
</div>