爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 14714|回复: 23

[分享资料] 关于grads中scorr函数的使用

[复制链接]
发表于 2012-5-10 22:12:21 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
目的:求两次降水过程某区域的空间相关系数

问题:lz实在不会使用scorr函数,因为是新手手册和上网都找不到解决方法。。。于是只能向论坛里的大牛求助。。。希望不要被喷

菜鸟自己编写的gs:
'reinit'
'open d:\1\ncep\dat\3.ctl'
'open d:\1\ncep\dat\7.ctl'
'set x 1 144 '
'set y 1 73'
'set t 1'
'set lon 10 140'
'set lat 10 30'
'define hgt1=hgt.1'
'define hgt2=hgt.2'
'define a=scorr(hgt1,hgt2,lon=10,lon=140,lat=10,lat=30)'
'd a'
'reinit'

最后,先感谢一下大家~
密码修改失败请联系微信:mofangbao
发表于 2012-5-10 22:46:27 | 显示全部楼层
This function calculates the spatial correlation between two variables over an X-Y domain. It returns a single number. The syntax is:

scorr(expr1, expr2, xdim1, xdim2, ydim1, ydim2)
where:


expr1   - any valid GrADS expression
expr2   - any valid GrADS expression
xdim1   - starting X dimension expression
xdim2   - ending X dimension expression
ydim1   - starting Y dimension expression
ydim2   - ending Y dimension expression

For global averaging, a shorthand may be used:

scorr(expr1, expr2, global) or
scorr(expr1, expr2, g)
is the same as
scorr(expr1, expr2, lon=0, lon=360, lat=-90, lat=90)

Usage Note

scorr may be used in conjunction with tloop or define to create time series or time/height plots.

scorr assumes that the world coordinates are longitude in the X dimension and latitude in the Y dimension, and does weighting in the latitude dimension by the delta of the sin of the latitudes. Weighting is also performed appropriately for unequally spaced grids.

Examples
This example calculates the correlation between the surface temperature and the latent heat flux over the tropical Pacific:


set lat -10 10
set lon 120 280
d scorr(tsfc, lhtfl, lon=120, lon=280, lat=-10, lat=10)

这个是grads自带的文本说明了
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2012-5-10 22:59:38 | 显示全部楼层

谢谢~这个我也看到了~就是不知道怎么用才是正确的。。。或者说我的有什么问题。。。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2012-5-11 09:46:27 | 显示全部楼层
继续求解。。。
密码修改失败请联系微信:mofangbao
发表于 2012-5-11 12:11:16 | 显示全部楼层
苜蓿 发表于 2012-5-11 09:46
继续求解。。。

自己好好读读,里面写的很详细了,老是这么问是学不到东西的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2012-5-11 13:04:52 | 显示全部楼层
随缘 发表于 2012-5-11 12:11
自己好好读读,里面写的很详细了,老是这么问是学不到东西的

我已经仔细读过了,也编了好多次。。。

最新的:
'reinit'
'open d:\1\ncep\dat\3.ctl'
'open d:\1\ncep\dat\7.ctl'

'set lon 10 140'
'set lat 10 30'
'set t 1'

'set lev 500'

'define a1=hgt.1'
'define a2=hgt.2'

'd scorr(a1,a2,lon=10,lon=140,lat=10,lat=30)'

'reinit'

但一直显示request beyond file limits,确实是不知道怎么办才来提问的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2012-5-11 13:25:47 | 显示全部楼层
本帖最后由 苜蓿 于 2012-5-11 13:42 编辑
随缘 发表于 2012-5-11 12:11
自己好好读读,里面写的很详细了,老是这么问是学不到东西的


再次谢谢你~我再仔细看了又发现了问题,再重新编过。。。

'reinit'
'open d:\1\ncep\dat\3.ctl'
'open d:\1\ncep\dat\7.ctl'
'set x 1 144'
'set y 1 73'
'set t 1'

'set lev 500'
'define a1=aave(hgt.1,lon=10,lon=140,lat=10,lat=30)'
'define a2=aave(hgt.2,lon=10,lon=140,lat=10,lat=30)'


'set lon 10 140'
'set lat 10 30'
'd scorr(a1,a2,lon=10,lon=140,lat=10,lat=30)'

'reinit'


还是这个错误:request beyond file limits
不管加权不加权都说scorr这个有问题。。。不知道怎么办了
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2012-5-11 14:59:50 | 显示全部楼层
我发现问题了。。。我打开的第二个ctl文件总是无法读取,不论顺序如何,只要是放在第二个的ctl就是读不出来。。。为什么呢~有什么解决办法么~
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2012-5-11 15:14:06 | 显示全部楼层
把时间描述改成一样就没问题了。。。唉。。。绕了好多弯路
密码修改失败请联系微信:mofangbao
发表于 2012-8-4 19:53:55 | 显示全部楼层
恩 谢谢分享啊
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表