<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi Dennis <br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks for the reply. I think its working now since I receive the following output.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>Variable: tc2DayAvg<br>
Type: float<br>
Total Size: 3250800 bytes<br>
            812700 values<br>
Number of Dimensions: 3<br>
Dimensions and sizes:    [Time | 30] x [south_north | 129] x [west_east | 210]<br>
Coordinates: <br>
            Time: [   0.. 696]<br>
Number Of Attributes: 9<br>
  _FillValue :    9.96921e+36<br>
  FieldType :    104<br>
  MemoryOrder :    XY <br>
  description :    Daily Mean: TEMP at 2 M<br>
  units :    K<br>
  stagger :    <br>
  coordinates :    XLONG XLAT XTIME<br>
  Time :       0<br>
  NCL_tag :    calculate_daily_values: arith=avg<br>
(0)    Daily Mean: TEMP at 2 M (K) : min=298.312   max=306.723<br>
(0)    -----</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" color="#1F497D" face="Arial Bold"><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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" color="#1F497D" face="Arial Bold"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font size="1" color="#1F497D" face="Arial,sans-serif"><span style="font-size:8pt"><br>
</span></font><font size="2" color="#AB8303" face="Arial Bold"><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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" color="#AB8303" face="Arial Bold"><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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt"><br>
Curtin University</span></font><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt"><br>
</span></font><font size="2" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:11pt"><br>
</span></font><font size="2" color="#1F497D" face="Arial Bold"><span style="font-size:9pt">Curtin University</span></font><font size="2" color="#1F497D" face="Arial Bold"><span style="font-size:9pt"><br>
</span></font><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt">Tel |</span></font><font size="2" color="#1F497D" face="Arial Bold"><span style="font-size:9pt"> </span></font><font size="2" color="#1F497D" face="Arial,sans-serif"><span style="font-size:9pt">+61
 8 9266 7962</span></font><font size="2" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:9pt"> </span></font><font size="1" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:7pt"><br>
</span></font><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt">Fax |</span></font><font size="2" color="#1F497D" face="Arial Bold"><span style="font-size:9pt"> </span></font><font size="2" color="#1F497D" face="Arial,sans-serif"><span style="font-size:9pt">+61
 8 9266 2377</span></font><font size="2" color="#1F497D" face="Arial,sans-serif"><span style="font-size:9pt"><br>
</span></font><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt">Mobile |</span></font><font size="2" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:9pt"> </span></font><font size="2" color="#1F497D" face="Arial,sans-serif"><span style="font-size:9pt">0470 237 525</span></font><font size="2" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:9pt">  </span></font><font size="2" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:9pt"><br>
</span></font><font size="2" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:9pt"><br>
</span></font><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt">Email |</span></font><font size="2" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" target="_blank" id="LPNoLP"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.edu.au</span></font></a><font size="2" color="#1F497D" face="Arial,sans-serif"><span style="font-size:9pt"> </span></font><font size="2" color="#1F497D" face="Arial,sans-serif"><span style="font-size:9pt"><br>
</span></font><font size="2" color="#AB8303" face="Arial Bold"><span style="font-size:9pt">Web |</span></font><font size="2" color="#AB8303" face="Calibri,sans-serif"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" target="_blank" id="LPNoLP"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font size="2" color="#1F497D" face="Arial,sans-serif"><span style="font-size:9pt"><br>
</span></font><font size="1" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:7pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="1" color="#1F497D" face="Calibri,sans-serif"><span style="font-size:6pt"></span></font><font size="1" color="#1F497D" face="Arial,sans-serif"><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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" color="#1F497D" face="Arial,sans-serif"><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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" color="#1F497D" face="Arial,sans-serif"><span style="font-size:6pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" color="#1F497D" face="Arial,sans-serif"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</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> Dennis Shea <shea@ucar.edu><br>
<b>Sent:</b> Friday, 2 February 2018 3:16:17 AM<br>
<b>To:</b> Mary Haley<br>
<b>Cc:</b> Muhammad Omer Mughal; ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Fw: script for daily average</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>
<div>You had the wrong syntax.<br>
<br>
</div>
@ is for attributes<br>
</div>
&  is for coordinates<br>
<br>
---<br>
So I try to do the following to correct this error
<p style="margin-top:0px; margin-bottom:0px"><span>   tc2@Time=wrf_times_c(a->Times,<wbr>0)</span><br>
</p>
and repeat the command but I still receive the same error as above.<br>
---<br>
<br>
Please try:<br>
   <span>tc2&Time=wrf_times_c(a->Times,<wbr>0)</span></div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">On Thu, Feb 1, 2018 at 9:43 AM, Mary Haley <span dir="ltr">
<<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">The calculate_daily_values documentation states that the variable must have a "time" coordinate attached to the leftmost dimension, with units recognized by cd_calendar, i.e., units like "hours since 1-1-1 00:00:0.0"<br>
<br>
You are working with WRF data, which doesn't have these kind of units 
<div class="x_gmail_default" style="font-size:small; display:inline">​for time by default. You may need to use "wrf_times_c" to first convert time to have the correct units, and then attach this new time array to your variable before you call calculate_daily_values:</div>
<div>
<div class="x_gmail_default" style="font-size:small; display:inline"><br>
</div>
</div>
<font face="monospace, monospace">     Time_0
<div class="x_gmail_default" style="font-size:small; display:inline">​  ​</div>
= wrf_times_c(
<div class="x_gmail_default" style="display:inline">​</div>
a->Times, 0 )
<div class="x_gmail_default" style="font-size:small; display:inline">​        ​</div>
;
<div class="x_gmail_default" style="display:inline">​ ​</div>
opt=0 ==>
<div class="x_gmail_default" style="display:inline">​ ​</div>
"hours since" initial time on file<br>
<div class="x_gmail_default" style="display:inline">​     </div>
<span style="color:rgb(0,0,0)">tc2
<div class="x_gmail_default" style="display:inline">​&Time = Time_0​</div>
</span>
<div class="x_gmail_default" style="display:inline">​   </div>
 
<div class="x_gmail_default" style="font-size:small; display:inline">​                        ​</div>
; a
<div class="x_gmail_default" style="font-size:small; display:inline">​ttach Time_0 to the "Time" dimension of tc2​</div>
       </font>
<div><font face="monospace, monospace">    <br>
<div class="x_gmail_default" style="font-size:small; display:inline">​     ​</div>
tc2DayAvg<span class="">
<div class="x_gmail_default" style="font-size:small; display:inline">​ ​</div>
= calculate_daily_values(tc2, "avg", nDim, False)</span></font>
<div><span style="color:rgb(80,0,80); font-family:Calibri,Helvetica,sans-serif; font-size:16px"><br>
</span></div>
<div>
<div class="x_gmail_default" style="font-size:small">Please read the documentation on wrf_times_c to see what other options are available, as the above may not be appropriate for your data.​</div>
<br>
</div>
<div>
<div class="x_gmail_default" style="font-size:small; display:inline"><a href="http://www.ncl.ucar.edu/Document/Functions/WRF_contributed/wrf_times_c.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/WRF_<wbr>contributed/wrf_times_c.shtml</a></div>
</div>
<div>
<div class="x_gmail_default" style="font-size:small; display:inline"><br>
</div>
</div>
<div>
<div class="x_gmail_default" style="font-size:small; display:inline">--Mary</div>
</div>
<div>
<div class="x_gmail_default" style="font-size:small; display:inline"><br>
</div>
</div>
<div>
<div class="x_gmail_default" style="font-size:small; display:inline">​</div>
</div>
</div>
</div>
<div class="x_HOEnZb">
<div class="x_h5">
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">On Wed, Jan 31, 2018 at 6:31 PM, Muhammad Omer Mughal via ncl-talk
<span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_-1781720034286653194m_2577957526897429823divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hi <br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I tried to use the suggestion provided by Dennis below and it shows the error.I am using NCL version 6.4.0. I am repeating the steps here for convenience.</p>
<p style="margin-top:0; margin-bottom:0"><span>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/wrf/WRF_contributed.ncl"</span></p>
<p style="margin-top:0; margin-bottom:0"><span>a=addfile("wrfout_d05_2016-04-<wbr>01_00:00:00","r")</span></p>
<p style="margin-top:0; margin-bottom:0"><span></span><span> tc2= wrf_user_getvar(a,"T2",-1)</span></p>
<p style="margin-top:0; margin-bottom:0"><span><span>nDim    = 0</span><br>
</span></p>
<span>
<p style="margin-top:0; margin-bottom:0"><span>tc2DayAvg= calculate_daily_values(tc2, "avg", nDim, False)</span></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
</span>
<p style="margin-top:0; margin-bottom:0">At this stage I get the following error <br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div>fatal:No coordinate variable exists for dimension (Time) in variable (x)<br>
fatal:["Execute.c":8640]:Execu<wbr>te: Error occurred at or near line 18125 in file /usr/local/ncl-6.4.0/lib/ncarg<wbr>/nclscripts/csm/contributed.<wbr>ncl<br>
<br>
</div>
So I try to do the following to correct this error
<p></p>
<p style="margin-top:0; margin-bottom:0"><span>tc2@Time=wrf_times_c(a->Times,<wbr>0)</span><br>
</p>
<p style="margin-top:0; margin-bottom:0">and repeat the command but I still receive the same error as above.
<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I would appreciate the help depending upon your convenience.<br>
</p>
<span>
<div id="x_m_-1781720034286653194m_2577957526897429823Signature">
<div id="x_m_-1781720034286653194m_2577957526897429823divtagdefaultwrapper" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:8pt"><br>
</span></font><font size="2" face="Arial Bold" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
Curtin University</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:11pt"><br>
</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt">Curtin University</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Tel |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 7962</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Fax |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 2377</span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Mobile |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">0470 237 525</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt">  </span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Email |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" id="x_m_-1781720034286653194m_2577957526897429823LPNoLP" target="_blank"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.ed<wbr>u.au</span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Web |</span></font><font size="2" face="Calibri,sans-serif" color="#AB8303"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" id="x_m_-1781720034286653194m_2577957526897429823LPNoLP" target="_blank"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="1" face="Calibri,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:6pt"></span></font><font size="1" face="Arial,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</div>
</span></div>
<hr style="display:inline-block; width:98%">
<div id="x_m_-1781720034286653194m_2577957526897429823divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>><br>
<b>Sent:</b> Thursday, 1 February 2018 5:51:50 AM<br>
<b>To:</b> Muhammad Omer Mughal<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Fw: script for daily average</font>
<div> </div>
</div>
<div>
<div class="x_m_-1781720034286653194h5">
<div>
<div dir="ltr">I am not sure what you were doing but *read the following documentation":<br>
<div><br>
<a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/calculate_daily_values.shtml" target="_blank">https://www.ncl.ucar.edu/Docum<wbr>ent/Functions/Contributed/<wbr>calculate_daily_values.shtml</a><br>
requires 6.4.0<br>
<br>
========<br>
  nDim    = 0          <br>
  tc2DayAvg= calculate_daily_values(tc2, "avg", nDim, False) <br>
  tc2DayAvg@description = "Daily Mean: " + tc2@description<br>
<br>
  printVarSummary(tc2DayAvg)<br>
  printMinMax(tc2DayAvg,0)<br>
  print("-----")<br>
</div>
</div>
<div class="x_m_-1781720034286653194m_2577957526897429823x_gmail_extra"><br>
<div class="x_m_-1781720034286653194m_2577957526897429823x_gmail_quote">On Wed, Jan 31, 2018 at 2:24 PM, Muhammad Omer Mughal via ncl-talk
<span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br>
<blockquote class="x_m_-1781720034286653194m_2577957526897429823x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div><br>
<br>
<br>
​<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD  Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | <a href="tel:+61%208%209266%207962" value="+61892667962" target="_blank">+61 8 9266 7962</a><br>
Fax | <a href="tel:+61%208%209266%202377" value="+61892662377" target="_blank">+61 8 9266 2377</a><br>
Mobile | 0470 237 525<br>
<br>
Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.<wbr>au</a><br>
Web | <a href="http://curtin.edu.au" target="_blank">http://curtin.edu.au</a><br>
<br>
​ Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
​<br>
<hr style="display:inline-block; width:98%">
<div id="x_m_-1781720034286653194m_2577957526897429823x_m_-7114549505189780340divRplyFwdMsg" dir="ltr">
<font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Muhammad Omer Mughal<br>
<b>Sent:</b> Wednesday, 31 January 2018 12:17:57 PM<br>
<b>To:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> script for daily average </font>
<div> </div>
</div>
<div dir="ltr">
<div id="x_m_-1781720034286653194m_2577957526897429823x_m_-7114549505189780340x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hi <br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I wrote the following script to calculate the daily averages
<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div>a=addfile("./wrfout_d05_2016-0<wbr>4-01_00:00:00","r")<br>
tc2= wrf_user_getvar(a,"T2",-1)<br>
tc2_dims=dimsizes(tc2)<br>
ntim=tc2_dims(0)<br>
nlat=tc2_dims(1)<br>
nlon=tc2_dims(2)<br>
<br>
ndays=ntim/24<br>
<br>
tc2D=reshape(tc2,(/ndays,nlat,<wbr>nlon/))<br>
copy_VarAtts(tc2,tc2D)<br>
tc2_hr_avg=dim_avg_n_Wrap(tc2D<wbr>,0)<br>
<br>
printVarSummary(tc2_hr)<br>
<br>
</div>
but I am seeing the following error
<p></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div>input dimension sizes cannot conform to dimensions of input array<br>
<br>
The Var summaries are as follows<br>
<div>Variable: tc2<br>
Type: float<br>
Total Size: 75526920 bytes<br>
            18881730 values<br>
Number of Dimensions: 3<br>
Dimensions and sizes:    [Time | 697] x [south_north | 129] x [west_east | 210]<br>
Coordinates: <br>
Number Of Attributes: 6<br>
  coordinates :    XLONG XLAT XTIME<br>
  stagger :    <br>
  units :    K<br>
  description :    TEMP at 2 M<br>
  MemoryOrder :    XY <br>
  FieldType :    104<br>
<br>
</div>
<div>Variable: nlat<br>
Type: integer<br>
Total Size: 4 bytes<br>
            1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes:    [1]<br>
Coordinates: <br>
(0)    129</div>
<br>
<br>
<br>
<br>
</div>
<br>
<p></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<div id="x_m_-1781720034286653194m_2577957526897429823x_m_-7114549505189780340x_Signature">
<div id="x_m_-1781720034286653194m_2577957526897429823x_m_-7114549505189780340x_divtagdefaultwrapper" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:8pt"><br>
</span></font><font size="2" face="Arial Bold" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
Curtin University</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:11pt"><br>
</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt">Curtin University</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Tel |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 7962</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Fax |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 2377</span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Mobile |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">0470 237 525</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt">  </span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Email |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" id="x_m_-1781720034286653194m_2577957526897429823x_m_-7114549505189780340LPNoLP" target="_blank"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.ed<wbr>u.au</span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Web |</span></font><font size="2" face="Calibri,sans-serif" color="#AB8303"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" id="x_m_-1781720034286653194m_2577957526897429823x_m_-7114549505189780340LPNoLP" target="_blank"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="1" face="Calibri,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:6pt"></span></font><font size="1" face="Arial,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" 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,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</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>
</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>
</body>
</html>