<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, Katrina --&nbsp;<div>I did a simple test:&nbsp;</div><div><div>ga-&gt; man = (u(z=1)+u(z=2)+u(z=3)+u(z=4)+u(z=5)+u(z=6)+u(z=7)+u(z=8)+u(z=9)+u(z=10))/10</div><div><div>ga-&gt; avg = ave(u,z=1,z=10)</div><div>ga-&gt;&nbsp;mean = mean(u,z=1,z=10)</div><div>ga-&gt; d avg-man&nbsp;</div></div></div><div><div>Contouring: -1e-14 to 1e-14 interval 2e-15&nbsp;</div><div>(this is just the noise)</div><div>ga-&gt; d avg-mean</div><div><div>Constant field. &nbsp;Value = 0</div><div><br></div><div>So the ave() and mean() functions give the same thing. There is no weighting in the vertical. And I am unable to reproduce a significantly different average when calculating in manually. How did you calculate "a straight average of T over 11 levels" that was different from ave()?&nbsp;</div><div>--Jennifer</div></div><div><br></div><div><div>On Apr 7, 2010, at 4:08 PM, Katrina Hales-Garcia wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div>I recently joined the grads users' group. &nbsp;And I do apologize if this topic is covered in the old list archives, I haven't been able to access them to search.</div><div><br><div>I am trying to reproduce/understand a value averaged in the vertical over a subset of layers. &nbsp;The variable was defined by something simple like:</div><div><br></div><div>define Tave=ave(T,z=1,z=11)</div><div><br></div><div>However, I find this is different than a straight average of T over the 11 levels. &nbsp;In the documentation, it is noted that ave has some weighting for non-linear grid spacing in the y-direction, averaging along latitude. &nbsp;But I haven't found the details of weighting in the vertical. &nbsp;If I use the function 'mean' instead of 'ave' I get the same result (which according to the documentation, does not have the non-linear grid space weighting at least in the y-direction). &nbsp;(Excerpt from the documentation below.)</div><div><br></div><div>Of course, the data I'm looking at has non-linear spacing in the vertical pressure coordinate. &nbsp;Does anyone have details of how this weighting is done? &nbsp;</div><div><br></div><div>Thanks much,</div><div>Katrina</div><div><br></div><div><div>What is in the documentation:</div><div><span class="Apple-style-span" style="font-family: Times; ">Usage Note 3</span></div><div><span class="Apple-style-span" style="font-family: Times; ">The average is weighted by grid interval to account for non-linear grid spacing. Averages in the latitude dimension are weighted by the difference between the sines of the latitude at the northern and southern edges of the grid box. The edges of the grid box are always defined as being the midpoint between adjacent grid points. To calculate an average without using the latitude weighting, use the&nbsp;<code><a href="http://grads.iges.org/grads/gadoc/gradfuncmean.html">mean</a></code>function.</span></div><div><font class="Apple-style-span" face="Times"><br></font></div></div></div></div>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span> </div><br></div></body></html>