- 积分
- 45254
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-8-28
- 最后登录
- 1970-1-1
|
发表于 2016-4-20 17:14:38
|
显示全部楼层
你的max函数用的用问题吧,直接用max嵌套就行,不需要循环,例如'define um=max(max(uwnd,lat=30,lat=40),lon=37,lon=51)'
新版grads种直接有函数可以用,甚至都不需要max嵌套
amax()
This function returns an area maximum -- the maximum value in a grid spanning an X-Y region. The syntax is:
amax(expr, xdim1, xdim2, ydim1, ydim2)
where:
expr any valid GrADS grid expression
xdim1 starting X or LON dimension expression
xdim2 ending X or LON dimension expression
ydim1 starting Y or LAT dimension expression
ydim2 ending Y or LAT dimension expression
For global maximum, a shorthand may be used:
amax(expr, global) or
amax(expr, g)
is the same as
amax(expr, lon=0, lon=360, lat=-90, lat=90)
Usage Notes
This function will only work with GrADS version 2.0.2 or later.
This function is more efficient that using nested max functions.
Related functions amaxlocx and amaxlocy will return the grid location (X or Y) of the maximum value. If more than one grid box contains the maximum value, the location returned will be the first one encountered as the grid is scanned. The grid is scanned by rows from south to north, and each row is scanned from west to east.
A similar set of functions exists for finding the minimum over an area: amin, aminlocx, and aminlocy.
Examples
Get the maximum value of the variable ps over a specified grid domain:
d amax(ps,x=10,x=120,y=15,y=45)
Get the maximum value of the variable sstanom over the nino3.4 domain:
d amax(sstanom,lon=-170,lon=-120,lat=-5,lat=5)
|
|