<div dir="ltr"><div class="gmail_default">Muhammad,</div><br>I think this script is slightly more complicated than it needs to be.<br><br>It looks like your tc2 array is dimensioned ((/30,129,210/), and you want to skip indexes 0-11 of the leftmost dimension so that you are only averaging across indexes 12-29<div class="gmail_default" style="font-size:small;display:inline">​? If so, then:</div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">tc2_avg = dim_avg_n(tc2(12:,:,:),0)​</div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">This will give you back a 129 x 210 array, where each element is an average of the last 18 timesteps.</div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">--Mary</div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 11, 2017 at 2:53 AM, Muhammad Omer Mughal <span dir="ltr"><<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.au</a>></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 id="m_4186537471404656589divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi Mary <br>
</p>
<p><br>
</p>
<p>Kindly see the script below which I use with the bash script to determine the average of 2M TEMPERATURE contained in the whole of WRF out directory. I intend to skip the first 12 hours (spin up time) and I also tend to plot the final average in one plot.
 Kindly let me know if you can help me out <br>
</p>
<p><br>
</p>
<p></p>
<div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"<br>
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl"<br>
load "/data/muhdomer/NSCC/scratch/<wbr>WRF_myfunc.ncl"<br>
begin<br>
<br>
<div> DATADir = "./"<br>
<br>
  FILES   = systemfunc (" ls -1 " + DATADir + "wrfout_d05* ")<br>
<br>
  a       = addfiles(FILES+".nc","r")<br>
<br>
</div>
 <br>
  tc2 = wrf_user_getvar(a,"T2",-1)</div>
<div>  <span>tc2 = tc2-273.16</span><br>
</div>
<div>  times = a[:]->Times<br>
  ntimes = dimsizes(times)         ; number of times in the file<br>
  ntimes_plot = ntimes(0)        ; abandon the first 12 hours  <br>
<br>
<br>
  lh3d = new((/30,129,210/), float)<br>
  lh2d = new((/129,210/), float)<br>
    c = 0 <br>
    do i=time_serie, ntimes_plot-2,24<br>
       lh2d(:,:) = tc2(i,:,:)<br>
       lh3d(c,:,:) = lh2d(:,:)<br>
       c = c + 1</div>
<div>    end do<br>
    lh_avg = dim_avg_n(lh3d,0)<br>
  type = "x11"<br>
wks= gsn_open_wks(type,"temp_"+<wbr>hour)<br>
    gsn_define_colormap(wks,"<wbr>spread_15lev")<br>
<br>
  res = True<br>
  res@cnLevelSelectionMode = "ExplicitLevels"<br>
  res@cnLevels=(/24,25,26,27,28,<wbr>29,30,31,32,33,34,35,36/)<br>
  res@InitTime = False<br>
  res@Footer = False<br>
  res@gsnMaximize = True<br>
  res@gsnPaperOrientation = "landscape"<br>
  pltres = True<br>
  pltres@NoTitles = True<br>
  pltres@gsnMaximize = True<br>
  pltres@FramePlot = False<br>
  pltres@PanelPlot = True<br>
  mpres = True<br>
  mpres@mpFillOn = False<br>
  mpres@mpGeophysicalLineColor = "black"<br>
  mpres@<wbr>mpGeophysicalLineThicknessF   <wbr>    = 0.0   ; for type = "png"<br>
  mpres@mpDataBaseVersion="<wbr>Ncarg4_1"<br>
  mpres@mpDataSetName="Earth..4"<br>
  mpres@mpDataResolution="<wbr>Finest"<br>
  mpres@mpOutlineOn=False<br>
<br>
  lh_avg@description = "temperature averaged"<br>
  <br>
  lh_avg@units = "degree C"<br>
       opts = res<br>
      opts@cnFillOn = True<br>
     contour_lh = wrf_contour(a[0],wks,lh_avg,<wbr>opts)<br>
      delete(opts)<br>
      plot = wrf_map_overlays(a[0],wks,<wbr>contour_lh,pltres,mpres)<br>
 </div>
<div>   shape_files = (/"/data/muhdomer/NSCC/<wbr>scratch/Shapefiles/MYS_adm0.<wbr>shp","/data/muhdomer/NSCC/<wbr>scratch/Shapefiles/IDN_adm0.<wbr>shp","/data/muhdomer/NSCC/<wbr>scratch/Shapefiles/MP14_<wbr>REGION_NO_SEA_PL.shp"/)<br>
<br>
     plot = add_coastline_sgmyid(shape_<wbr>files,wks,plot,"black")<br>
</div>
<div><br>
</div>
<div>     draw(plot)<br>
     frame(wks)<br>
end</div>
<br>
<p></p>
<p>Regards <br>
</p>
<p><br>
</p>
<p>Muhammad Omer<br>
</p>
<div id="m_4186537471404656589Signature">
<div id="m_4186537471404656589divtagdefaultwrapper" 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="m_4186537471404656589LPNoLP" target="_blank"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.<wbr>edu.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="m_4186537471404656589LPNoLP" 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>

<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>