- 积分
- 6325
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-11-25
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我现在要对olr资料滤波,olr资料用的是日平均的olr.day.mean.nc,学姐给了我一个滤波的脚本,我在windows系统上操作,运行出来一直显示第10行有错误,请求各位大大帮我看一下问题出在哪里了,十分感谢。
滤波脚本如下:
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"
begin
diri = "/cygdrive/D/MJO/"
vName = "olr" ; name of variable on the file
fili = "olr.day.mean.nc"
f = addfile(diri+fili, "r")
x =short2flt( f->$vName$(:,:,:));直接利用所给资料滤波,始末时间未变
printVarSummary(x)
;nlat=f->olr&lat
;nlon=f->olr&lon
;ntime=f->olr&time
;anom = x ;(lat|:,lon|:,time|:) ; trick to copy cv's and atts
; anom = dim_rmvmean(x(lat|:,lon|:,time|:))
;printVarSummary(anom)
; ***********************************************
; create the filter weights and apply
; ***********************************************
ihp = 2 ; band pass
sigma = 1.0 ; Lanczos sigma
nWgt = 201 ; loose 100 each end
fca = 1./80. ; start freq
fcb = 1./20. ; last freq
wgt = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )
xBPF =wgt_runave ( x(lat|:,lon|:,time|:), wgt, 0 ) ; 20-80 day
xBPF!0="lat"
xBPF!1="lon"
xBPF!2="time"
xBPF&lat=x&lat
xBPF&lon=x&lon
xBPF&time=x&time
; ***********************************************
; create new date array for use on the plot
; ***********************************************
date = cd_calendar(x&time,-2) ; yyyymmdd
yrfrac = yyyymmdd_to_yyyyfrac (date, 0)
delete(yrfrac@long_name)
delete(x@long_name)
pStrt = 19800101 ; 画图所用4 years: winter 96-97 MJO gold standard
pLast = 19811231
iStrt = ind(date.eq.pStrt) ; user specified dates
iLast = ind(date.eq.pLast)
delete(date)
pltType = "ps"
pltName = "filters"
plot = new ( 2, "graphic")
wks = gsn_open_wks (pltType,pltName)
res =True ; plot mods desired
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame yet
res@vpHeightF = 0.4 ; change aspect ratio of plot
res@vpWidthF = 0.8
res@vpXF = 0.1 ; start plot at x ndc coord
res@gsnYRefLine = 0.0 ; create a reference line
res@gsnCenterString = "Anomaly olr [0, 120E]"
plot(0) = gsn_csm_xy (wks,yrfrac(iStrt:iLast),x(iStrt:iLast,{0},{120}),res)
res@gsnCenterString = "Band Pass Filtered: 20-80 day"
plot(1) = gsn_csm_xy (wks,yrfrac(iStrt:iLast),xBPF({0},{120},iStrt:iLast),res)
resP = True
resP@gsnMaximize = True
gsn_panel(wks,plot,(/2,1/),resP)
fout=addfile("filolr.nc","c")
filedimdef(fout,"time",-1,True)
fout->olrfil=xBPF(time|: ,lat|:,lon|:)
end
|
-
|