- 积分
- 362
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-2-25
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 hxyj 于 2013-10-4 23:35 编辑
晚上在用NCL自带的函数ilapsF求速度势的时候出错了。我的脚本如下:
;*************************************************
; wind_1.ncl
;*************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;*************************************************
begin
;*************************************************
; open file and read in data: data are on a regular grid
;*************************************************
f1 = addfile ("D:\paper\E\NCEP1\uwnd.mon.mean.nc", "r")
f2 = addfile ("D:\paper\E\NCEP1\vwnd.mon.mean.nc", "r")
t = f1->time
lev= f1->level
lat= f1->lat
lon= f1->lon
u = f1->uwnd(:,:,:,:)
U=u*u@scale_factor + u@add_offset
v = f2->vwnd(:,:,:,:)
V=v*v@scale_factor + v@add_offset
;*************************************************
; calculate divergence: use Wrap version to maintain meta data
;*************************************************
div = uv2dvF_Wrap(U,V) ; u,v ==> divergence
print(dimsizes(div))
;*************************************************
; calculate divergence
;*************************************************
chi = ilapsF(div,(/770,17/))
end
报错如下:
经查,发现ilapsF 函数http://www.ncl.ucar.edu/Document/Functions/Built-in/ilapsf.shtml,(If zlap is a two dimensional array then zlmbda may be a constant. If zlap has 3 or more dimensions then zlmbda must be an array with the same dimensions as zlap (minus the rightmost two dimensions).) 我的数据是4维,分别如图所示,为770,17,73,144.根据提示(If zlap has 3 or more dimensions then zlmbda must be an array with the same dimensions as zlap (minus the rightmost two dimensions)),所以我将zlmbda 设置为(/770,17/),但却出错。可能是理解有误。麻烦版主和各位高手帮忙解决。非常感谢。
|
|