- 积分
- 1868
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-1-1
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位好,我使用的资料是1948年到2016年的ncpe月平均资料,想利用位势高度绘制eof,之前提取数据都是用的cdo……奈何前段时间师姐把大型机里的cdo删除了QAQ,崩溃QAQ!!! 所以现在尝试着用ncl写循环提取每年的6月份,但是一直在报错,望大家指导!非常感谢!
begin
; ==============================================================
; User defined parameters that specify region of globe and
; ==============================================================
f = addfile ("E:/TPV/hgt.mon.mean.nc", "r")
hgt=f->hgt(0:827,4,:,:)
printVarSummary(hgt)
;hgt1 = hgt
hgt1 = new((/69,73,144/), float)
printVarSummary(hgt1)
do i = 5, 822, 12
hgt1(i,:,:) = hgt(i,:,:)
end do
wsgd1 = dim_rmvmean_n_Wrap(hgt1, 0)
printVarSummary(wsgd1)
dims = dimsizes(wsgd1)
year = ispan(1948, 1948+dims(0)-1, 1)
;jisuan quanzhong
w = sqrt(cos(0.01745329*wsgd1&lat))
wp = wsgd1 * conform(wsgd1, w, 1)
copy_VarCoords(wsgd1, wp)
;optEOF = True
;optEOF@jopt = 0
latS = 27.5
latN = 40.
lonL = 80.
lonR = 102.5
; =================================================================
; Reorder (lat,lon,time) the *weighted* input data
; Access the area of interest via coordinate subscripting
; =================================================================
x = wp({lat|latS:latN},{lon|lonL:lonR},time|:)
neof = 1
eof = eofunc_Wrap(x, neof, False) ;EOF fenjie
;jisuan shijianxulie biaozhunhua==========
eof_ts = eofunc_ts_Wrap (x, eof, False)
eof_ts = dim_standardize_n(eof_ts, 1, 1)
printVarSummary( eof ) ; examine EOF variables
;printVarSummary( eof_ts )
;north--------------------------
ntim = dims(0)
sig_pcv = eofunc_north(eof@pcvar, ntim, False)
;;;NETcdf wenjian
;path_out = "sm1-PC1-"+dims(0)+"yr.nc"
;system("rm -f"+path_out)
;ncdf = addfile(path_out, "c")
eof_ts!1 = "year"
eof_ts&year = ispan(1948, 2016, 1)
;ncdf->EOF1 = eof_ts(0,:)
;============================================================
wks = gsn_open_wks("png","E:/TPV/try3.0") ; send graphics to PNG file
plot = new(neof,graphic) ; create graphic array
报错如下:
fatal:Subscript out of range, error in subscript #0
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 43 in file /cygdrive/e/TPV/eof6.ncl
应该是 hgt1(i,:,:) = hgt(i,:,:)写错了,但是……菜鸟真的不知道该怎么改,可能是搜索方式不对,没能在论坛找到解决方法,希望大家多多帮助,给与详细一点的指导QAQ
鞠躬感谢!!!
|
|