<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Atul Saini,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you are new to NCL, I suggest looking at the NCL User Guide which has an excellent step-by-step guide for NCL, with a focus on creating graphics:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/">http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/</a><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">One way to do this is to first reshape the temperature array to an NTIM x 5 x NLAT x NLON array, where NTIM is the total number of years divided by five. Once you do this, you can use dim_avg_n to average across the rightmost three dimensions of the new array, effectively giving you the average for every 5 years:</div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><br></font></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">  filename = "<a href="http://chamba_tmean_fldmean.nc">chamba_tmean_fldmean.nc</a>"</font></div><div class="gmail_default"><font face="monospace, monospace">  a = addfile(filename,"r")</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">  temp  = a->t</font></div><div class="gmail_default"><font face="monospace, monospace">  dims  = dimsizes(temp)</font></div><div class="gmail_default"><font face="monospace, monospace">  ntim  = dims(0)</font></div><div class="gmail_default"><font face="monospace, monospace">  nlat  = dims(1)</font></div><div class="gmail_default"><font face="monospace, monospace">  nlon  = dims(1)</font></div><div class="gmail_default"><font face="monospace, monospace">  ntim5 = ntim/5</font></div><div class="gmail_default"><font face="monospace, monospace">;                                                                               </font></div><div class="gmail_default"><font face="monospace, monospace">; Reshape temperature array so we can easily average groupings of </font></div><div class="gmail_default"><font face="monospace, monospace">; five years at a time.                                                                    </font></div><div class="gmail_default"><font face="monospace, monospace">;                                                                               </font></div><div class="gmail_default"><font face="monospace, monospace">  temp_5year_avg = dim_avg_n(reshape(temp,(/ntim5,5,nlat,nlon/)),(/1,2,3/))</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">The temp_5year_avg array will be a one-dimensional array of ntim5 (8) elements that you can easily plot. See attached script and image.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Note that your "t" variable on the file has no units, and it appears to have a funny character as part of the long_name. You probably should try to fix these when creating the plot.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">--Mary</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 10, 2018 at 2:10 AM, Atul Saini <span dir="ltr"><<a href="mailto:atulsainimail@gmail.com" target="_blank">atulsainimail@gmail.com</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>Sir/Ma'am,</div><div>                   I have the mean temperature
 file containing the data for MAMJJA season. This file contains the 
seasonal average (MAMJJA) data of each year from 1975 to 2014. I can 
easily plot the XY plot using it but the problem is how to make the 
average of 1975 to 1979, 1980 to 1985 and so on. I want to make the 
pentad map as explained in the previous sentence.</div><div><br></div><div> Please help in making the average of five years to plot the map, which will represent the composite of five years.<br></div><div><br></div><div>The data file is attached herewith this mail.</div><div><br></div><div><div dir="ltr" class="m_-8969425237301311780gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>Regards,</div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=1-FxdNiTGH6ODiAbx9rORqe-MEqsUbdbp&revid=0Byj9ykpbAx3oTmhuRDNKVk9yUm9Pbmh1RDhtc3p0VzlVWHlNPQ" width="248" height="94"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></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>