- 积分
- 21884
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-10-31
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
之前的计算过程是对亚洲中纬度纬向风进行eof分析,将eof第1-3模态的时间序列与海温计算相关系数,通过95%信度检验的区域定义为关键区。
现在下一步要做的是将关键区的海温回归至风场,出现了下面的问题,对于ismissing函数我也理解的不太好
fatal:The result of the conditional expression yields a missing value. NCL can not determine branch, see ismissing function
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 94 in file recoef.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
yrStrt = 1963
yrLast = 2012
neof = 3 ; number of EOFs
optEOF = True
optEOF@jopt = 0 ; This is the default; most commonly used; no need to specify.
optETS = False
season = "JJA"
f1 = addfile ("/data2/home/lzb/DATA/20C/uwnd.nc", "r")
f2 = addfile ("/data2/home/lzb/DATA/Hadlsst/sst.nc","r")
f3 = addfile ("/data2/home/lzb/DATA/20C/11grid/wind-level.nc.nc","r")
sst = f2->sst(1116:1715,:,:)
sstt = month_to_season(sst,season)
TIME = f1->time
YYYY = cd_calendar(TIME,-1)/100
iYYYY = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)
uwn = f1->uwnd(iYYYY,16,:,:)
uu = f3->uwnd(1344:1943,16,:,:)
uwnd = month_to_season(uwn,season)
uuuu = month_to_season(uu,season)
latS = 20.
latN = 60.
lonL = 10.
lonR = 180.
lata = -60
latb = 60
rad = 4.*atan(1.)/180.
clat = f1->lat
clat = sqrt(cos(rad*clat)) ; gw for gaussian grid
wuwnd = uwnd ; copy meta data
wuwnd!0 = "time"
wuwnd&time = uwnd&time
wuwnd!1 = "lat"
wuwnd&lat = uwnd&lat
wuwnd!2 = "lon"
wuwnd&lon = uwnd&lon
wuwnd = uwnd*conform(uwnd,clat,1)
wuwnd@long_name = "Wgt: "+wuwnd@long_name
x = wuwnd({lat|latS:latN},{lon|lonL:lonR},time|:)
UU = dim_avg_n_Wrap(uwnd,(/0/))
xAno = uwnd
do i=0,49
xAno(i,:,:) = uwnd(i,:,:) - UU
end do
xAnom = xAno({lat|latS:latN},{lon|lonL:lonR},time|:)
eof = eofunc_Wrap(xAnom,neof,optEOF)
eof_ts = eofunc_ts_Wrap (xAnom,eof,optETS) ; examine EOF variables
eof_ts = dim_standardize_n(eof_ts,1,1) ; normalize
eof_regres = eof ; create an array w meta data
do ne=0,neof-1
eof_regres(ne,:,:) = (/regCoef(eof_ts(ne,:),xAnom(:,:,:))/)
end do
eof_ts1 = eof_ts(0,:)
y = sstt({latitude|:},{longitude|:},time|:)
ccr = escorc(eof_ts1,y)
ccr!0 = "lat"
ccr&lat = y&latitude
ccr!1 = "lon"
ccr&lon = y&longitude
z = uuuu({lat|:},{lon|:},time|:)
tval = 0.
nptxy = 0
maxx = 0.25
minn = -0.25 ; y-sst z-uwind
do j = 0,359
do k = 0,179
if(any(ccr(k,j).ge.maxx .and. ccr(k,j).le.minn)) then
print(ccr)
rc = regcoef(y(k,j,:),z(k,j,:),tval,nptxy)
lon_labels = new(dimsizes(lon_values),string)
lonW_index = ind(-180.lt.lon_values.and.lon_values.lt. 0)
lonE_index = ind( 0.lt.lon_values.and.lon_values.lt.180)
if(.not.all(ismissing(lonW_index)))
lon_labels(lonW_index) = fabs(lon(lonW_index)) + "W" ; west
end if
if(.not.all(ismissing(lonE_index)))
lon_labels(lonE_index) = lon_values(lonE_index) + "E" ; east
end if ;;;;第94行
delete(lonW_index)
delete(lonE_index)
delete(lon0_index)
end if
end do
end do
printVarSummary(rc)
|
-
|