<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
Hi Bill,
<div><br>
</div>
<div>Thank you so much for your suggestion. Here are some of the screenshot of my file.</div>
<div>First I have addfiles of these two files:</div>
<div><img size="13336" contenttype="image/jpeg" id="img379355" style="max-width: 99.9%; -webkit-user-select: none;" tabindex="0" src="cid:37031a61-6b37-45b5-96d6-420ea4f1ab68"><br>
</div>
<div>Then I printed all times:</div>
<div><img size="17328" contenttype="image/jpeg" id="img331771" style="max-width: 99.9%; -webkit-user-select: none;" tabindex="0" src="cid:ef05eaba-261d-4e70-a95d-15d217a6633a"><br>
</div>
<div><img size="39207" contenttype="image/jpeg" id="img198" style="max-width: 99.9%; -webkit-user-select: none;" tabindex="0" src="cid:403a76c4-5318-4235-84e0-0f48bd2cfde8"><br>
</div>
<div>My loop looks like below:</div>
<div><img size="42491" contenttype="image/jpeg" id="img182660" style="max-width: 99.9%; -webkit-user-select: none;" tabindex="0" src="cid:5ae5fc2d-46df-485c-a2a6-4fb1721a6fc5"><br>
</div>
<div>And here is the ncdump -h results:</div>
<div><img size="21984" contenttype="image/jpeg" id="img762778" style="max-width: 99.9%; -webkit-user-select: none;" tabindex="0" src="cid:bc85c89e-a66d-48f8-8fc8-f669a4d2c82e"><br>
</div>
<div>I think the error&nbsp;(out of range) I get is at line from the loop:</div>
<div>&gt;&nbsp;<span>contour_psl = wrf_contour(a[it],wks,slp(it,:,:),opts_psl) when it = 12</span></div>
<div><span><br>
</span></div>
<div>Hope this information can help me better solve this problem. Thank you so much for all your help.</div>
<div><br>
</div>
<div>Best,</div>
<div><br>
</div>
<div>Jade</div>
<div><span><br>
</span></div>
<div><span><br>
</span></div>
<div><br>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Bill Ladwig &lt;ladwig@ucar.edu&gt;<br>
<b>Sent:</b> Wednesday, June 15, 2016 11:36:37 AM<br>
<b>To:</b> Wang,Yu; NCL<br>
<b>Subject:</b> Re: [ncl-talk] NCL wrf_contour use for multiple files</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">Hi Jade,
<div><br>
</div>
<div>Please include ncl-talk in your replies so that it posts to the email list.&nbsp; The error you're getting is most likely due to 'it' being out of the bounds for your 'a' list variable.&nbsp; This leads me to believe there aren't actually 12 timesteps in that second
 file.&nbsp; Have you looked at the file?&nbsp; Never assume it's what you think it is, always check.&nbsp; Please do an 'ncdump -h wrfout_d01_2005-08-25_06:00:00' and report back the result.&nbsp; Until I know what's really in that second file, it's hard to guess what might be
 going wrong.&nbsp; Also, if you can print the 'times' result from 'times = wrf_user_getvar(a, &quot;times&quot;, -1)', that would be helpful too.</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Bill</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jun 14, 2016 at 6:29 PM, Wang,Yu <span dir="ltr">
&lt;<a href="mailto:wangyu8722@ufl.edu" target="_blank">wangyu8722@ufl.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>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Thank you so much for your help.&nbsp;</p>
<p><br>
</p>
<p>I think I will put my question in a different way maybe it is more clear.</p>
<p><br>
</p>
<p>I have two&nbsp;nc files wrfout_d01_<font face="Calibri, Arial, Helvetica, sans-serif">2005-08-25_00:00:00 and&nbsp;</font><span style="font-family:Calibri,Arial,Helvetica,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols;font-size:16px">wrfout_d01_</span><font face="Calibri, Arial, Helvetica, sans-serif">2005-08-25_06:00:00,
 each of them have 12 time steps, whic means they have 30 minutes interval. I put them together using a addfiles command. And using a timestep of 2 to loop over to calculate the hourly precipitation tendency by using a later time minus an&nbsp;earlier&nbsp;one, for example,
 using the 5th time step&nbsp;(<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">2005-08-25_02:00:00</span>) of the first file minus the 3rd time step&nbsp;(<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">2005-08-25_01:00:00</span>)
 to calculate the tendency between 01Z to 02Z.&nbsp;</font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><br>
</font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif">When I was trying to plot the tendency from 2005-08-25_05:00:00&nbsp;(which is the 11th time&nbsp;step of the first file as well as the 11th of the addfiles resulted list) to&nbsp;<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">2005-08-25_06:00:00(which
 is the 3rd time step of the second file, and the 13th time step of the addfiles list) using the line below:&nbsp;</span></font></p>
<pre style="word-wrap:break-word;white-space:pre-wrap">&gt; contour_psl = wrf_contour(a[it],wks,slp(it,:,:),opts_psl)</pre>
And get the error of&nbsp;<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">fatal:ListSelect: Index out of range.</span>
<p></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">If this still does not make any sense. Could you give
 me some suggestion about how to use wrf_contour to plot the difference between the last time&nbsp;step of one wrf output file and the first time step of the second file? Can it be done or I have to use some other functions.</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Hope this explain better of my question.&nbsp;</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Thanks again for your help.</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Best,</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</span></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Jade</span></span></font></p>
</div>
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Bill Ladwig &lt;<a href="mailto:ladwig@ucar.edu" target="_blank">ladwig@ucar.edu</a>&gt;<br>
<b>Sent:</b> Tuesday, June 14, 2016 6:21:11 PM<br>
<b>To:</b> Wang,Yu<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>;
<a href="mailto:wrfhelp@ucar.edu" target="_blank">wrfhelp@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] NCL wrf_contour use for multiple files</font>
<div>&nbsp;</div>
</div>
<div>
<div class="h5">
<div>
<div dir="ltr">Hi Jade,<br>
<div><br>
</div>
<div>Can you do an &quot;ncdump -h wrf_file&quot; or an ncl_filedump and report back the number of times for each file?&nbsp; With WRF, sometimes the last file has less times than the other files.&nbsp; In this case, it might be only 1.&nbsp; With a tend_int greater than 1, you might
 be jumping past the last time.&nbsp; Without seeing the data, it's hard to say.</div>
<div><br>
</div>
<div>Bill</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jun 14, 2016 at 2:53 PM, Wang,Yu <span dir="ltr">
&lt;<a href="mailto:wangyu8722@ufl.edu" target="_blank">wangyu8722@ufl.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:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;margin-top:0px;margin-bottom:0px">
Dear ncl_talk and wrfhelp,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;margin-top:0px;margin-bottom:0px">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;margin-top:0px;margin-bottom:0px">
Hope everything goes well with everyone.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;margin-top:0px;margin-bottom:0px">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;margin-top:0px;margin-bottom:0px">
I am having a problem with ncl when I wanted to plot hourly&nbsp;precipitation tendencies multiple files. I used the example from the wrf website as below&nbsp;</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;margin-top:0px;margin-bottom:0px">
<a href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/PRECIP/wrf_Precip_multi_files.ncl" title="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/PRECIP/wrf_Precip_multi_files.ncl
Ctrl&#43;Click or tap to follow the link" target="_blank">http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/PRECIP/wrf_Precip_multi_files.ncl</a>.
 All I did is to change the input file. I have 2 domain 1 files, including 6&nbsp;hours with 30 mins interval in each file. The script works perfectly when it was processing the first file as below:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;margin-top:0px;margin-bottom:0px">
&nbsp;</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">(0) &nbsp; &nbsp; Working on time: 2005-08-25_01:00:00</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">(0) &nbsp; &nbsp; Working on time: 2005-08-25_02:00:00</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">(0) &nbsp; &nbsp; Working on time: 2005-08-25_03:00:00</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">(0) &nbsp; &nbsp; Working on time: 2005-08-25_04:00:00</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">(0) &nbsp; &nbsp; Working on time: 2005-08-25_05:00:00</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">But when it get to calculate the next hour which should use both files, the script starts to have trouble and give me an error of&nbsp;
<div>fatal:ListSelect: Index out of range</div>
<div>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 89 in file wrf_Precip_multi_files.ncl</div>
<div>Is this because of my output file or there is something I should change in the script?</div>
<div><br>
</div>
<div>Hope some one can provide some help. I would really appreciate any help. Thank you so much.</div>
<div><br>
</div>
<div>Best,</div>
<div><br>
</div>
<div>Jade</div>
</div>
<br>
<p></p>
</div>
</div>
<br>
_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>