<div dir="ltr">Dear NCL-Talk:<div><br></div><div>I added delete(filename) to the program, but now I have another obscure (for me) error.</div><div><br></div><div>Thank you for your help.</div><div><br></div><div><div>fatal:Could not coerce values for operation</div><div>fatal:[&quot;Execute.c&quot;:8578]:Execute: Error occurred at or near line 56 in file define_dir.ncl</div></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 26, 2016 at 4:28 PM, Rick Brownrigg <span dir="ltr">&lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Barry,<div><br></div><div>Barry, in your case, the error is telling you exactly what the deal is...left-hand-side and right-hand-side of the assignment are of incompatible types.  Specifically, the call to addfiles() at line 54 returns a variable of type FileVariable. However, previously you had set the type of the variable &quot;filename&quot; as a string, at around line 19. NCL is strongly typed -- you don&#39;t have to declare the type of a variable in advance, but once fixed (in both data-type and array shape), it sticks, unless you do one of two things:  i) use the delete statement, ex: delete(filename) in your case, or ii) use the reassignment operator &quot;:=&quot;, ex, filename := addfile(....)</div><div><br></div><div>Mohammad, you seemingly had two questions, the second of which I never really understood (about looping over the lat/lon values).  For the first one, regarding multiple directories, it looks like there&#39;s a missing &quot;/&quot; between the directory pathname and the wrf filenames.   Also, I don&#39;t believe addfiles takes a a wildcard pathname, but rather an array of filenames that may be relative or absolute pathnames.  Dennis&#39;s script shows how to do that, but NOTE, there may be missing a &quot;/&quot; between the parent directory and the &quot;runXXX&quot; directories.  You&#39;ll want to look carefully at the constructed filenames.</div><div><br></div><div>Hope that helps...</div><div>Rick</div><div><br></div><div><span style="font-family:menlo;font-size:14px;background-color:rgb(254,250,207)"><br></span></div><div><span style="font-family:menlo;font-size:14px;background-color:rgb(254,250,207)"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="gmail-h5">On Wed, Oct 26, 2016 at 1:23 AM, Muhammad Omer Mughal <span dir="ltr">&lt;<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.<wbr>edu.au</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5">




<div dir="ltr">
<div id="gmail-m_-3767702292847913940m_-1365830910131879300divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif">
<div id="gmail-m_-3767702292847913940m_-1365830910131879300divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif">
<p>Hi Bary </p>
<p><br>
</p>
<p>I am in the same sort of problem.  I told you before when I try to run the attached script, it is unable to find wrfout_d04 files in all folders </p>
<p>run6</p>
<p>run7</p>
<p>run 8 and</p>
<p>run9 </p>
<p><br>
</p>
<p>I tried to be as clear as possible in NCL help but I may not have explained properly. If you understand my problem please reply me. I see the following errors when  I run the script.</p>
<p><br>
</p>
<p><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Variable: dirWRF</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Type: string</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Total Size: 32 bytes</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">            4 values</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Number of Dimensions: 1</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Dimensions and sizes:    [4]</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Coordinates: </span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">(0)    /media/mughal/Seagate/ECMWF_</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">WR<wbr>F_RUNS2/run6</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">(1)    /media/mughal/Seagate/ECMWF_</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">WR<wbr>F_RUNS2/run7</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">(2)    /media/mughal/Seagate/ECMWF_</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">WR<wbr>F_RUNS2/run8</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">(3)    /media/mughal/Seagate/ECMWF_</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">WR<wbr>F_RUNS2/run9</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">fatal:[&quot;FileSupport.c&quot;:2859]:_</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><wbr>NclVerifyFile:
 Requested file &lt;/media/mughal/Seagate/ECMWF_</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">W<wbr>RF_RUNS2/run6wrfout_d04*&gt; or
 &lt;/media/mughal/Seagate/ECMWF_</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">W<wbr>RF_RUNS2/run6wrfout_d&gt; does not exist</span><br>
</p>
<p><br>
</p>
<p>Even when I change the script wrf_script_r4 to wrf_script_r5 recommended by Dennis I still am not able to solve the problem. I would appreciate if you would be able to help me out</p>
<p><br>
</p>
<div id="gmail-m_-3767702292847913940m_-1365830910131879300Signature">
<div id="gmail-m_-3767702292847913940m_-1365830910131879300divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
<div style="font-family:tahoma;font-size:13px">
<div style="font-family:tahoma;font-size:13px"><b><br>
</b></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:11pt">Muhammad Omer Mughal</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:8pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">PhD  Research Scholar</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Remote Sensing and Satellite Research Group</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt"><br>
Curtin University</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt"><br>
</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:11pt"><br>
</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt">Curtin University</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Tel |</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 7962</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Calibri,sans-serif" size="1" color="#1F497D"><span style="font-size:7pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Fax |</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 2377</span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Mobile |</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt">0470 237 525</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt">  </span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Email |</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" id="gmail-m_-3767702292847913940m_-1365830910131879300LPNoLP" target="_blank"><font face="Arial,sans-serif" size="2"><span style="font-size:9pt">m.mughal1@postgrad.curtin.ed<wbr>u.au</span></font></a><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Web |</span></font><font face="Calibri,sans-serif" size="2" color="#AB8303"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" id="gmail-m_-3767702292847913940m_-1365830910131879300LPNoLP" target="_blank"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif" size="2"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Calibri,sans-serif" size="1" color="#1F497D"><span style="font-size:7pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Calibri,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt"></span></font><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt">Curtin University is a trademark of Curtin University of Technology. </span></font><br>
</div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt">CRICOS Provider Code 00301J (WA), 02637B (NSW)</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,&quot;segoe ui&quot;,&quot;segoe wp&quot;,tahoma,arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-3767702292847913940m_-1365830910131879300divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> <a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a> &lt;<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>&gt; on behalf of Barry Lynn &lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>&gt;<br>
<b>Sent:</b> Wednesday, 26 October 2016 2:48:25 PM<br>
<b>To:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> [ncl-talk] Defining directories</font>
<div> </div>
</div><div><div class="gmail-m_-3767702292847913940h5">
<div>
<div dir="ltr">Hi:
<div><br>
</div>
<div>I&#39;d like to define multiple directories.  I assume that I am almost &quot;there.<br>
<div><br>
</div>
<div>I am getting an error I don&#39;t understand.</div>
<div><br>
</div>
<div>
<div>
<div>(0)<span class="gmail-m_-3767702292847913940m_-1365830910131879300gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>dirWRF(n) = /data1/wrf/01_23_2016/GEFS/GEF<wbr>S_00</div>
<div>fatal:[&quot;NclVar.c&quot;:1390]:Assign<wbr>ment type mismatch, right hand side can&#39;t be coerced to type of left hand side</div>
<div>fatal:[&quot;Execute.c&quot;:8578]:Execu<wbr>te: Error occurred at or near line 54 in file define_dir.ncl</div>
</div>
<div><br>
</div>
<div>I know that this file exists.</div>
<div><br>
</div>
<div>/data1/wrf/01_23_2016/GEFS/GEF<wbr>S_00/wrfout_d02_2016-01-23_00:<wbr>00:00<br>
</div>
<div><br>
</div>
<div>But, I cannot execute the line (see error above):</div>
<div><br>
</div>
<div>filename = addfiles(dirWRF(n)+&quot;/&quot;+&quot;wrfout<wbr>_d02_2016-01-23_00:00:00&quot;, &quot;r&quot;)<br>
</div>
<div><br>
</div>
<div>Thank you.</div>
<div><br>
</div>
<div><br>
</div>
-- <br>
<div class="gmail-m_-3767702292847913940m_-1365830910131879300gmail_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>
</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="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></div>