[gradsusr] area and vertical average

sim.aberson sim.aberson at noaa.gov
Fri May 10 11:34:58 EDT 2019


Thanks for that information.  It helps.  My next question is whether 
there is anything I can do to speed up using min or max.  I want to find 
the minimum or maximum across my grid, so I have, for example:

d max(max(mag(ugrd10m,vgrd10m),x=1,x=450),y=1,y=425)*1.945

This takes about 5 minutes on a new mac.  Any suggestions, or just bear 
with it.

Thanks,
Sim

On 5/9/19 8:53 PM, Jennifer M Adams wrote:
> 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
> 
> 
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 



More information about the gradsusr mailing list