<div dir="ltr">Mike, <div><br></div><div>You may be better looking into the list functionality.   Take a look at the ncl-talk email from k griffin a few days back, and the echo function that was posted.  You could push the variable into a list and add the station name to it as well.   Then retrieve it back out of the list based on the station name.  </div><div><br></div><div>The other way would be rather than having new variables, add the data as an attribute to another variable. </div><div><br></div><div>alldata = True</div><div>alldata@$<span style="font-size:12.8000001907349px">station+&quot;_MaxT&quot;$ = new((/dimsizes(dates(i*k:i*k+</span><span style="font-size:12.8000001907349px">i))/), &quot;float&quot;)</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">however you can&#39;t have attributes on attributes so not all of that would be transferable.  </span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Why do you want uniquely and logically named variables inside the code? </span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Good luck buddy. </span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 10:48 AM, Michael Ventrice <span dir="ltr">&lt;<a href="mailto:mventrice@wsi.com" target="_blank">mventrice@wsi.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"><div><br></div><div>Hi all,</div><div><br></div><div>Is it possible to call in a string from an array in order to build a new variable name using part of the string that was called in? I put a mock example at the bottom that I&#39;d think would be a way to do it... but obviously it doesn&#39;t work :)</div><div><br></div><div>Thanks in advance,</div><div>Mike V.</div><br clear="all"><div><br></div><div><div><br></div><div>  statID_array = (/&quot;KALB&quot;,&quot;KLGA&quot;/)</div><div><br></div><div><br></div><div>do i = 0, dimsizes(statID_array)-1</div><div>station = statID(i)</div><div><br></div><div>  k = 294</div><div><br></div><div>  station+&quot;_MaxT&quot; = new((/dimsizes(dates(i*k:i*k+i))/), &quot;float&quot;)</div><div>  station+&quot;_MaxT&quot;!0 = &quot;time&quot;</div><div>  station+&quot;_MaxT&quot;&amp;time = dates(i*k:i*k+i)</div><div>  station+&quot;_MaxT&quot;&amp;time@units = dates@units</div><div>  station+&quot;_MaxT&quot; = (/maxT(i*k:i*k+i)/)</div><div> </div></div><div>end do</div><div><br></div><div>;-----------------------------</div><div>; for i=0:</div><div>;KALB_MaxT = new((/dimsizes(dates(i*k:i*k+i))/), &quot;float&quot;)</div><div>;KALB_MaxT!0 = &quot;time&quot;</div><div>;KALB_MaxT&amp;time = dates(i*k:i*k+i)</div><div>;KALB_MaxT&amp;time@units = dates@units</div><div>;KALB__MaxT&quot; = (/maxT(i*k:i*k+i)/)</div><div><br></div><div><div>; for i=1:</div><div>;KLGA_MaxT = new((/dimsizes(dates(i*k:i*k+i))/), &quot;float&quot;)</div><div>;KLGA_MaxT!0 = &quot;time&quot;</div><div>;KLGA_MaxT&amp;time = dates(i*k:i*k+i)</div><div>;KLGA_MaxT&amp;time@units = dates@units</div><div>;KLGA__MaxT&quot; = (/maxT(i*k:i*k+i)/)</div></div><div><br></div><div><br></div><div>etc...</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><font size="4" face="trebuchet ms, sans-serif" color="#000000"><strong> Michael </strong><strong>Ventrice, Ph.D.  </strong><b>|</b> <b>Operational Scientist</b></font><span style="font-family:arial,helvetica,sans-serif;font-size:14px"><span style="color:rgb(64,64,65);margin-left:5px"></span></span><br>
<span style="font-family:arial,helvetica,sans-serif"><span style="margin-left:5px"><span style="font-size:12px"><font color="#000000"><strong><span style="font-size:8px"> </span>w:</strong> <a href="tel:978-983-6786" value="+19789836786" target="_blank">978-983-6786</a></font></span><span style="font-size:12px"><font color="#000000">      <strong>e:</strong></font><font color="#696969"> </font><a href="mailto:michael.ventrice@weather.com" target="_blank"><font color="#0000ff">michael.ventrice@weather.com</font></a></span></span></span><br>
<img alt="" src="http://s.imwx.com/ads/creatives/weather/sigs/TheWeatherCompany_2014EmailSignature.jpg" style="width:342px;min-height:78px"><br></div></div>
</font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>