<div dir="ltr"><div><div><div>I still find your question and the code confusing.<br><br></div>It takes time to look at code and determine what is happening. It is your responsibility to pose clear questions and, if appropriate, a clean, minimal script that illustrates the issue(s). We answer questions on a volunteer basis. Our time is valuable too! You must help us help you!<br><br></div><div>Please read the addfiles and adfiles documentation.<br><br><a target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>addfiles.shtml</a><br><a target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>addfile.shtml</a><br><br></div><div>With addfiles ... please look at examples 1 and 2. <br><br>Note the difference between &#39;cat&#39; (the default) and &#39;join&#39; (alternate approach)
</div><div><br><br></div><div>---<br></div><div>Create a script that contains *only* this part of your code. <br><br></div></div><br><div>;---Read var1 <br>      dir    = &quot;/home/kunal/&quot;<br>      fnames = systemfunc(&quot;ls &quot; + dir + &quot;DAY_*.nc&quot;)<br><br>      print(fnames)<br>      nfil = dimsizes(fnames)<br>      print(&quot;nfil=&quot;+nfil)<br></div><div>      print(&quot;---&quot;)<br></div><div>      <br>       a      = addfiles(fnames,&quot;r&quot;)<br>       data = a[:]-&gt;bcfire(0,:,:)        ; only one timestep<br></div><div>       printVarSummary(data)        ; *****look at the structure ****  and sizes <br><br></div><div><br></div><div><pre>   <font size="2">DATA = a[:]-&gt;bcfire<br>   printVarSummary(data)  ; *****look at the structure ****   </font></pre><pre><font size="2">DATA should have something like (time,lat,lon) where <br></font></pre><pre><font size="2">dimsizes(time) &gt;1<br><br><br></font></pre><pre> <br></pre><pre><br><br></pre><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 31, 2017 at 11:01 AM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@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"><div><div>Sorry for creating the confusion. <br><br></div>I changed the script as you suggested me and then run the attached script. But after running this, I am getting the file only of the single day instead of all 30 files separately. <br><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><br></font></span></div><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_-6708397670434253343gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio &amp; Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br></div><div>India<br></div><div><br></div><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div></font></span><div><div class="h5">
<br><div class="gmail_quote">On Fri, Mar 31, 2017 at 10:15 PM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@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 class="gmail_default" style="font-size:small">Kunal,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;m a little confused by what you are asking for.  You said you wanted to extract all 30 days of data instantly, which is what the previous &quot;addfiles&quot; example was meant to show.  You don&#39;t need a loop to extract all the data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Did you actually try my suggestion of changing your script to use &quot;addfiles&quot; instead of &quot;addfile&quot;?  If so, and you are still having a problem, then it would help to see the new version of your script.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Maybe my confusion is with what you want to do with the data after you extract all 30 days of data. Please be more specific if possible.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="m_-6708397670434253343HOEnZb"><div class="m_-6708397670434253343h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 10:19 PM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@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"><div><div>Dear Mary,<br><br></div>Thanks for the suggestions. <br></div>But still, it&#39;s extracting one file at a time, not extracting all the 30-day files separately of UK and NEP (as mentioned in the script). <br><span class="m_-6708397670434253343m_-5808586647480170277HOEnZb"><font color="#888888"><div><div><div><br><br></div></div></div></font></span><div class="gmail_extra"><span class="m_-6708397670434253343m_-5808586647480170277HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div></font></span><div><div class="m_-6708397670434253343m_-5808586647480170277h5">
<br><div class="gmail_quote">On Fri, Mar 31, 2017 at 3:09 AM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@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 style="font-size:small">Kunal,</div><div style="font-size:small"><br></div><div style="font-size:small">You should be able to use &quot;addfiles&quot; to open all your files, and then read your data using the special [:] syntax:</div><div style="font-size:small"><br></div><div style="font-size:small"><div><font face="monospace, monospace">  dir    = &quot;/home/kunal/&quot;</font></div><div><font face="monospace, monospace">  fnames = systemfunc(&quot;ls &quot; + dir + &quot;DAY_*.nc&quot;)</font></div><div><font face="monospace, monospace">  a      = addfiles(fnames,&quot;r&quot;)<br><span class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313gmail-s1">  data = a[:]</span><span class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313gmail-s2">-&gt;</span><span class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313gmail-s1">bcfire</span></font></div></div><div style="font-size:small"><br></div><div style="font-size:small">For more information see our addfiles examples page:</div><div style="font-size:small"><br></div><div><a href="http://www.ncl.ucar.edu/Applications/addfiles.shtml" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/addfiles.shtml</a><br></div><div><br></div><div>--Mary</div><div><br></div><div style="font-size:small"><p class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313gmail-p1"><span class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313gmail-s1"><br></span></p><p class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313gmail-p1"><span class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313gmail-s1"><br></span></p></div><div style="font-size:small"><br></div><div style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032h5">On Thu, Mar 30, 2017 at 12:42 PM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@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_-6708397670434253343m_-5808586647480170277m_372109147063714032h5"><div dir="ltr"><div>Dear NCL users<br><br><br></div>I have the data of 30 days. I want to extract this data with the loop.The attached script is based on to extract the data of a single day. So it&#39;s a tedious job to extract all the 30 days data one by one. So could anyone tell me that how to start the loop in the attached file so the I can get 30 days extracted data instantly. <br><br>Thank You<br><br>Regards<span class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313HOEnZb"><font color="#888888"><br clear="all"><div><div><div><div class="m_-6708397670434253343m_-5808586647480170277m_372109147063714032m_8302767070546682313m_2756078572688045071gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div>
</div></div></font></span></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></div></div></div></div>
<br>______________________________<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>
</div></div></blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>