<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">Hi, Sim — </div>
<div class="">It’s much more efficient to use aave() instead of nested ave() functions over X and Y. Start by setting Z varying and define your area averages at desired levels. The ‘define’ command will calculate the area averages at each fixed Z level and
then stack them into a Z-varying result — it is the equivalent of having a zloop() function under the hood. </div>
<div class=""><br class="">
</div>
<div class=""><font face="Courier New" style="font-size: 12px;" class="">‘set x 1'</font></div>
<div class=""><font face="Courier New" style="font-size: 12px;" class="">‘set y 1'</font></div>
<div class=""><font face="Courier New" style="font-size: 12px;" class="">‘set lev 925 700’</font></div>
<div class=""><font face="Courier New" style="font-size: 12px;" class="">‘define uave = aave(ugrdprs,x=1,x=463,y=1,y=425)’ </font></div>
<div class=""><br class="">
</div>
<div class="">Now fix Z and average over all levels:</div>
<div class=""><br class="">
</div>
<div class=""><font face="Courier New" style="font-size: 12px;" class="">‘set z 1'</font></div>
<div class=""><font face="Courier New" style="font-size: 12px;" class="">‘define val = ave(uave,lev=925,lev=700)’</font></div>
<div class=""><br class="">
</div>
<div class="">—Jennifer</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><br class="">
<br class="">
<blockquote type="cite" class="">On May 8, 2019, at 4:36 PM, sim.aberson <<a href="mailto:sim.aberson@noaa.gov" class="">sim.aberson@noaa.gov</a>> wrote:<br class="">
<br class="">
I wish to calculate the area average of a variable that is vertically averaged between two levels. I use the command:<br class="">
<br class="">
'define aveu=ave(ave(ave(ugrdprs,x=1,x=463),y=1,y=425),lev=925,lev=700)'<br class="">
<br class="">
This seems to take a huge amount of time (a half hour and counting on my mac). Even without the vertical average, for example,<br class="">
<br class="">
'd ave(ave(wtmpsfc,x=1,x=463),y=1,y=425)'<br class="">
<br class="">
takes about 3 minutes. However, just issuing the command<br class="">
<br class="">
'define u850=ave(ugrdprs,lev=925,lev=700)'<br class="">
<br class="">
returns the result in just a moment.<br class="">
<br class="">
Am I doing this wrong? Is there a more efficient way that I am overlooking?<br class="">
<br class="">
Thanks,<br class="">
Sim Aberson<br class="">
NOAA/AOML/Hurricane Research Division<br class="">
<br class="">
_______________________________________________<br class="">
gradsusr mailing list<br class="">
<a href="mailto:gradsusr@gradsusr.org" class="">gradsusr@gradsusr.org</a><br class="">
http://secure-web.cisco.com/1e70dwxPtD-ubMvepAkh0tYJ-NOwy4Yug6Sx3H25tEXzpobLTbPuPLv-dlDNFLuRKZmJZZrS5PjRBIlQJEY66IFZPP_YVnG2QXYS8ExiAmwX5bNhQZNDpx2HCttqYZqlocu-ZOGJ55u7raGloYKm7XAhneZXThnLLHMbX5RgLFsHwnK0drByqwK1b1QHX3AIimDvVOOwL8g9S0liWBoast7N99Dk6tppJ98qHLe46SMZMiLFjFJG8tMHX8SXgYq7uRgd3GBWYD1xH2iFu6jzInkQGFIMooZbRpAeg8ScnjFd6iFuRN-lohosPNgQojT3tILN5hkeaDcK7xLskASN1muw5Exwra9dEuOZJUGnbr6tYaFOvP6iDfRZEeO_Uo6Jr/http%3A%2F%2Fgradsusr.org%2Fmailman%2Flistinfo%2Fgradsusr<br class="">
<br class="">
</blockquote>
<br class="">
<div class="">--<br class="">
Jennifer Miletta Adams<br class="">
Center for Ocean-Land-Atmosphere Studies (COLA)<br class="">
George Mason University<br class="">
<br class="">
<br class="">
</div>
<br class="">
</div>
</div>
</body>
</html>