<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey,<div class="">I would suggest to use <font face="Menlo" class="">dim_avg_n</font> instead of <font face="Menlo" class="">dim_avg</font>, so that you can have the control on what you are exactly doing. I think (but maybe I’m wrong) that with your syntax you only get a zonal average, while you want to have a full lat/lon average: is this correct? In order to keep metadata I also suggest to use the <font face="Menlo" class="">_Wrap</font> option.&nbsp;</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">T_new=dim_avg_n_Wrap(T(:,{minlat:maxlat},{minlon:maxlon}), (/1,2/) )&nbsp;</font></div><div class=""><br class=""></div><div class="">The<font face="Menlo" class=""> (/1,2/)</font> specifies that you are averaging over coordinates lat and lon, on the subset defined by extents <font face="Menlo" class="">{minlat:maxlat},{minlon:maxlon}</font>. Please note that in the output you will get a variable with only time dimension. Thus, I don’t really understand your second question: lat/lon coordinates are not available anymore, since you took a mean over a square.&nbsp;</div><div class="">Cheers</div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Guido Cioni</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://guidocioni.altervista.org" class="">http://guidocioni.altervista.org</a>&nbsp;</div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 02 Jun 2016, at 10:16, <a href="mailto:dyjbean@163.com" class="">dyjbean@163.com</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><table width="99.99%" height="100%" border="0" cellpadding="0" cellspacing="0" background="cid:_Foxmail.1@c91cf8f4-f91e-f392-7927-ea770284cdf2" style="font-family: Helvetica; letter-spacing: normal; orphans: auto; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; padding: 10px; background-color: transparent;" class=""><tbody class=""><tr class=""><td valign="top" style="width: 1369px; height: 968px; line-height: 22.399999618530273px; font-size: 10.5pt;" class=""><div class=""><div class=""><span class=""></span>hi,</div><div class="">&nbsp; &nbsp;i have a variable named T with dimension (lev,lat,lon), and i gave the minlat,maxlat,minlon,maxlon for some zone,&nbsp;</div><div class="">after i have used function&nbsp;<span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class=""><span style="font-size: 10.5pt; background-color: transparent;" class=""><font style="font-weight: bold;" class="">dim_avg<span class="Apple-converted-space">&nbsp;</span></font>with</span></span><span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class="">&nbsp;<font color="#ff0000" class=""><b class=""><span class="Apple-converted-space">&nbsp;</span></b></font></span><font color="#ff0000" style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class=""><b class="">T_new=<span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class="">dim_avg</span><span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class="">(</span></b></font><span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: rgba(0, 0, 0, 0);" class=""><font color="#ff0000" class=""><b class="">T(:,{minlat:maxlat},{minlon:maxlon})))</b></font>,i obtained the required new variable&nbsp;</span><b style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class="">T_new</b><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 22.399999618530273px;" class="">&nbsp;,&nbsp;</span></div><div class=""><span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: rgba(0, 0, 0, 0);" class="">but how can i &nbsp;know the real lat/lon value in<span class="Apple-converted-space">&nbsp;</span></span><b style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class="">T_new,</b><span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class="">&nbsp;the start and end points are equal to&nbsp;</span><span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class=""><b class="">minlat,maxlat&nbsp;</b>or adjacent value from them?</span></div><div class=""><span style="font-size: 10.5pt; line-height: 22.399999618530273px; background-color: transparent;" class=""><br class=""></span></div><div class=""><br class=""></div><hr size="1" align="left" style="width: 210px; height: 1px;" class=""><div class=""><span class=""><div style="margin: 10px; font-family: verdana; font-size: 10pt;" class=""><div class=""><a href="mailto:dyjbean@163.com" class="">dyjbean@163.com</a></div></div></span></div><div class=""></div></div></td></tr></tbody></table><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">ncl-talk mailing list</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:ncl-talk@ucar.edu" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">ncl-talk@ucar.edu</a><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">List instructions, subscriber options, unsubscribe:</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div></blockquote></div><br class=""></div></body></html>