[gradsusr] area and vertical average

Jennifer M Adams jadams21 at gmu.edu
Thu May 9 20:53:11 EDT 2019


Hi, Sim —
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.

‘set x 1'
‘set y 1'
‘set lev 925 700’
‘define uave = aave(ugrdprs,x=1,x=463,y=1,y=425)’

Now fix Z and average over all levels:

‘set z 1'
‘define val = ave(uave,lev=925,lev=700)’

—Jennifer





On May 8, 2019, at 4:36 PM, sim.aberson <sim.aberson at noaa.gov<mailto:sim.aberson at noaa.gov>> wrote:

I wish to calculate the area average of a variable that is vertically averaged between two levels.  I use the command:

'define aveu=ave(ave(ave(ugrdprs,x=1,x=463),y=1,y=425),lev=925,lev=700)'

This seems to take a huge amount of time (a half hour and counting on my mac).  Even without the vertical average, for example,

'd ave(ave(wtmpsfc,x=1,x=463),y=1,y=425)'

takes about 3 minutes.  However, just issuing the command

'define u850=ave(ugrdprs,lev=925,lev=700)'

returns the result in just a moment.

Am I doing this wrong?  Is there a more efficient way that I am overlooking?

Thanks,
Sim Aberson
NOAA/AOML/Hurricane Research Division

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://secure-web.cisco.com/1e70dwxPtD-ubMvepAkh0tYJ-NOwy4Yug6Sx3H25tEXzpobLTbPuPLv-dlDNFLuRKZmJZZrS5PjRBIlQJEY66IFZPP_YVnG2QXYS8ExiAmwX5bNhQZNDpx2HCttqYZqlocu-ZOGJ55u7raGloYKm7XAhneZXThnLLHMbX5RgLFsHwnK0drByqwK1b1QHX3AIimDvVOOwL8g9S0liWBoast7N99Dk6tppJ98qHLe46SMZMiLFjFJG8tMHX8SXgYq7uRgd3GBWYD1xH2iFu6jzInkQGFIMooZbRpAeg8ScnjFd6iFuRN-lohosPNgQojT3tILN5hkeaDcK7xLskASN1muw5Exwra9dEuOZJUGnbr6tYaFOvP6iDfRZEeO_Uo6Jr/http%3A%2F%2Fgradsusr.org%2Fmailman%2Flistinfo%2Fgradsusr


--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20190510/5beea400/attachment.html>


More information about the gradsusr mailing list