<div dir="ltr"><div><div><div><div><div>THX.<br><br></div>So .... your directory structure had each &#39;Date&#39; in a different directory (diri = DATADir+Date)? <br>This was not clear (to me) in the original message.<br><br></div>I thought it was embedded in the individual file names: eg<br><br>   nam_xxx_20130208_yyyy_zzz.grb<br><br>Hence,<br>    Date = &quot;20130208/&quot;<br><br></div>    files = systemfunc(&quot;ls nam_xxx_&quot;+Date+&quot;*grb)<br><br></div>Cheers<br></div>D<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 12:11 PM, Barry Lynn <span dir="ltr">&lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.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">Dennis, thank you.<div><br></div><div>Here is the sequence of calls to produce the list, for reference of list users.</div><div><br></div><div><div>begin</div><div>; <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>systemfunc.shtml</a></div><div>; to retrieve a list of files from another directory</div><div> Date = &quot;20130208/&quot;</div><div> DATADir = &quot;/data1/wrf/NAM/&quot;</div><div> diri = DATADir+Date</div><div> all_files = systemfunc(&quot;ls &quot; + diri + &quot;nam*grb&quot;) ; notice quotes around ls as well.</div><div> n_files = dimsizes(all_files)</div><div> print(&quot;n_files = &quot; + n_files)</div><div> do n=0,n_files -1</div><div>   print(&quot;all_files(n) = &quot; + all_files(n))</div><div>  filename = all_files(n)</div><div>  print (&quot;filename&quot; + filename)</div><div>  a = addfile(filename,&quot;r&quot;)</div><div>  nc_file = a</div><div>  MY_PRES = nc_file-&gt;PRMSL_218_MSL</div><div>  print(&quot;MY_PRES&quot; + MY_PRES(5,5))</div><div>  end do</div><div>end</div></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 5:51 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</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>Maybe:<br><br>Date = &quot;20130208&quot;<br></div><div><br></div><div>all_files = systemfunc (&quot;ls nam*&quot;+Date+&quot;*grb&quot;&quot;)  ; GRIB file in current directory<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_6884118342299020681h5">On Mon, Nov 21, 2016 at 7:28 AM, Barry Lynn <span dir="ltr">&lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6884118342299020681h5"><div dir="ltr"><div>Hello:</div><div><br></div><div>On: <a href="https://www.ncl.ucar.edu/Applications/addfiles.shtml" target="_blank">https://www.ncl.ucar.edu/Appli<wbr>cations/addfiles.shtml</a></div><div><br></div><div>there is the command:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">all_files = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">systemfunc</strong></a> (&quot;ls /fs/cgd/data0/casguest/CLASS/a<wbr>nn*.nc&quot;)</pre><div>I want to include a variable in the all_files line.</div><div><br></div><div>Date = &quot;20130208&quot;<br></div><div><br></div><div>all_files = systemfunc (&quot;ls 20130208/nam*grb&quot;&quot;)<br></div><div><br></div><div>Such that it includes the variable &quot;Date.&quot;</div><div><br></div><div>--&gt; all_files = systemfunc (&quot;ls Date + &quot;nam*grb&quot;&quot;)</div><div><br></div><div>However, the line immediately above gives an syntax error and anything</div><div>else I have tried is the same.</div><div><br></div><div>Thank you,</div><div><br></div><div>Barry</div><div><br></div><div><br></div>-- <br><div class="m_6884118342299020681m_-9027867968692981078m_-7513214583638157239m_-6715655608601859055gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:914%20432%203108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_6884118342299020681gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:914%20432%203108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div>
</div></div></blockquote></div><br></div>