<div dir="ltr">Dennis:<div><br></div><div>This was confusing because the subdirectory with the files has a date in its subdirectory name, and the files themselves have a date (but of slightly different format). </div><div><br></div><div>If I need to sub-divide the individual files according to date than I will need to follow your instructions.</div><div><br></div><div>It is unclear to me why ls has Quotes around it since it seems to be a command, while the "nam*grb*" has Quotes around it as well (but is a filename).</div><div><br></div><div>Barry</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 9:25 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></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><div><div><div><div>THX.<br><br></div>So .... your directory structure had each 'Date' 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 = "20130208/"<br><br></div> files = systemfunc("ls nam_xxx_"+Date+"*grb)<br><br></div>Cheers<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">D<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 12:11 PM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>></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/Docume<wbr>nt/Functions/Built-in/systemfu<wbr>nc.shtml</a></div><div>; to retrieve a list of files from another directory</div><div> Date = "20130208/"</div><div> DATADir = "/data1/wrf/NAM/"</div><div> diri = DATADir+Date</div><div> all_files = systemfunc("ls " + diri + "nam*grb") ; notice quotes around ls as well.</div><div> n_files = dimsizes(all_files)</div><div> print("n_files = " + n_files)</div><div> do n=0,n_files -1</div><div> print("all_files(n) = " + all_files(n))</div><div> filename = all_files(n)</div><div> print ("filename" + filename)</div><div> a = addfile(filename,"r")</div><div> nc_file = a</div><div> MY_PRES = nc_file->PRMSL_218_MSL</div><div> print("MY_PRES" + MY_PRES(5,5))</div><div> end do</div><div>end</div></div><div><br></div></div><div class="m_-7244482390687659969HOEnZb"><div class="m_-7244482390687659969h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 5:51 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></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 = "20130208"<br></div><div><br></div><div>all_files = systemfunc ("ls nam*"+Date+"*grb"") ; GRIB file in current directory<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-7244482390687659969m_6884118342299020681h5">On Mon, Nov 21, 2016 at 7:28 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>></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_-7244482390687659969m_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> ("ls /fs/cgd/data0/casguest/CLASS/a<wbr>nn*.nc")</pre><div>I want to include a variable in the all_files line.</div><div><br></div><div>Date = "20130208"<br></div><div><br></div><div>all_files = systemfunc ("ls 20130208/nam*grb"")<br></div><div><br></div><div>Such that it includes the variable "Date."</div><div><br></div><div>--> all_files = systemfunc ("ls Date + "nam*grb"")</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_-7244482390687659969m_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_-7244482390687659969m_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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_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 914 432 3108<br></div></div></div>
</div>