- 积分
- 20
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-1-9
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
;*************************************************
; NCL tutorial script: vert_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
;************************************************
; file handling
;************************************************
;fn = "00pi2co2_01_climo.nc" ; define filename
files=systemfunc("ls 00pi2co2_*_climo.nc")
in = addfiles(files,"r") ; open netcdf file
;************************************************
; read needed variables from file
;************************************************
pre=in[:]->PRECT*1000*86400
pres=dim_sum_n(pre(4:8,:,:),0)
prew=dim_sum_n(pre(10:3,:,:),0)
presum=dim_sum_n(pre(1:11,:,:),0)
; printVarSummary(pres)
domain=new(dimsizes(pres),float)
;printVarSummary(domain)
do i=0,47
do j=0,95
if((pres(i,j)-prew(i,j))>2.0*5 .and. (pres(i,j)/presum(i,j))>0.55) then
domain(i,j)=1.0
else
domain(i,j)=0.0
end if
end do
end do
;;************************************************
;;************************************************
wks = gsn_open_wks("ps","vert111") ; Opens a ps file
plot = gsn_csm_contour(wks,domain(:,:),False)
这是我的ncl脚本,想利用domain画出一条符合if筛选的线,但是提示错误
warning:ContourPlotInitialize: scalar field is constant; ContourPlot not possible:[errno=1102]
出错的位置应该就在if语句处
求助各位大神是哪里有问题?
|
|