<div dir="ltr">Actually, I had a test script for &#39;calculate_daily_values&#39; that used WRF data. Specifically: 1-and-3 hrly WRF files. It does what Mary suggested. I added a lot of print and printVarSummary for pedantic purposes. I suggest looking at script and the generated output.<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 19, 2017 at 1:47 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">The calculate_xxxx_values functions expect the time dimension of the variable you&#39;re trying to average to have a time coordinate array attached to it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">WRF-ARW data does not have a time coordinate array, but I think you can create one.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Before calling calculate_daily_values, try this:</div><div class="gmail_default" style="font-size:small"><p class="m_6988442595647793008gmail-p1">  x&amp;Time :=  <span class="m_6988442595647793008gmail-s2">wrf_times_c</span><span class="m_6988442595647793008gmail-s1">(a[:]-</span><span class="m_6988442595647793008gmail-s3">&gt;</span><span class="m_6988442595647793008gmail-s1">Times, 0)  </span><span class="m_6988442595647793008gmail-s4">; convert to &quot;hours since&quot;     </span>                                                                             </p></div><div class="gmail_default" style="font-size:small">You may need to load this file at the top of your script, since it defines the &quot;wrf_times_c&quot; function:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">







<p class="m_6988442595647793008gmail-p1"><span class="m_6988442595647793008gmail-s1">load</span><span class="m_6988442595647793008gmail-s2"> </span><span class="m_6988442595647793008gmail-s3">&quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRF_<wbr>contributed.ncl&quot;</span></p><p class="m_6988442595647793008gmail-p1"><span class="m_6988442595647793008gmail-s3">--Mary</span></p><p class="m_6988442595647793008gmail-p1"><span class="m_6988442595647793008gmail-s3"><br></span></p></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jun 19, 2017 at 11:43 AM, Vanúcia Schumacher <span dir="ltr">&lt;<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.<wbr>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="h5">




<div dir="ltr">
<div id="m_6988442595647793008m_-2162921894433566335divtagdefaultwrapper" style="font-size:14pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Dear NCL users,</span><br style="font-family:&quot;Times New Roman&quot;">
<br style="font-family:&quot;Times New Roman&quot;">
<span style="font-family:&quot;Times New Roman&quot;"><span style="font-size:18.6667px;font-family:&quot;Times New Roman&quot;"><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Is there any</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)"> NCL
 function</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)"> to calculate the</span></span><br style="font-size:18.6667px;font-family:&quot;Times New Roman&quot;">
<span style="font-size:18.6667px;font-family:&quot;Times New Roman&quot;"><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">daily average from wrf </span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">output
 files by each </span></span><span style="font-size:12pt;font-family:Tahoma,Geneva,sans-serif;color:rgb(0,0,0)">6 hourly (4 files per day)</span></span><br style="font-family:&quot;Times New Roman&quot;">
</p>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">I&#39;ve tried the function below, but it returns the error:</span></div>
<div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">No coordinate variable exists for dimension (Time) in variable (x)</span></div>
<div><br>
</div>
</div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">How can I resolve this issue for this data?</span></div>
<br style="font-family:&quot;Times New Roman&quot;">
<span style="font-family:&quot;Times New Roman&quot;"><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)"><br>
</span>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">files = systemfunc(&quot;ls -1 wrfout_d01_20*&quot;) + &quot;.nc&quot;</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">      a = addfiles(files,&quot;r&quot;)</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">      x = wrf_user_getvar(a,&quot;slp&quot;,-1)</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">            printVarSummary(x)</span></div>
</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)"> xDayAvg = calculate_daily_values(x, &quot;avg&quot;, nDim, False)</span><br style="font-family:&quot;Times New Roman&quot;">
<br style="font-family:&quot;Times New Roman&quot;">
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Variable: x</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Type: float</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Total Size: 67200 bytes</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">            16800 values</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Number of Dimensions: 3</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Dimensions and sizes:</span><span class="m_6988442595647793008m_-2162921894433566335Apple-tab-span" style="white-space:pre-wrap;font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">[Time | 12] x [south_north | 50] x [west_east | 28]</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Coordinates: </span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Number Of Attributes: 6</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">  description :</span><span class="m_6988442595647793008m_-2162921894433566335Apple-tab-span" style="white-space:pre-wrap;font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Sea Level Pressure</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">  units :</span><span class="m_6988442595647793008m_-2162921894433566335Apple-tab-span" style="white-space:pre-wrap;font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">hPa</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">  coordinates :</span><span class="m_6988442595647793008m_-2162921894433566335Apple-tab-span" style="white-space:pre-wrap;font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">XLONG XLAT</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">  stagger :</span><span class="m_6988442595647793008m_-2162921894433566335Apple-tab-span" style="white-space:pre-wrap;font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">  MemoryOrder :</span><span class="m_6988442595647793008m_-2162921894433566335Apple-tab-span" style="white-space:pre-wrap;font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">XYZ</span></div>
<div><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">  FieldType :</span><span class="m_6988442595647793008m_-2162921894433566335Apple-tab-span" style="white-space:pre-wrap;font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</span><span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">104</span></div>
<div><br>
</div>
<br style="font-family:&quot;Times New Roman&quot;">
<span style="font-family:Tahoma,Geneva,sans-serif;font-size:12pt;color:rgb(0,0,0)">Regards </span><br>
<p></p>
</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>
<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>