- 积分
- 746
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-5-17
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在下NCL小白,今天在学习NCL尝试用ncl脚本将500hpa的位势高度的月平均资料处理成年平均资料,然后画出01961-1990年气候场遇到了一点问题,请教各位大神!下面是我编辑的脚本:系统显示在脚本中红色那行左右有这样一个错误:Subscript out of range, error in subscript #0,应该是哪里下标出了问题 但是我就是找不到。对了 关于读出来的hgt500文件格式如下:dimt (这个dimt是dimt=dimsizes(hgt500) print(dimt)得到的)
Type: integer
Total Size: 12 bytes
3 values
Number of Dimensions: 1
Dimensions and sizes: [3]
Coordinates:
(0) 1704
(1) 91
(2) 180
脚本:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
f=addfile("C:/dream/bj/summer/data/hgt.mon.mean.nc","r")
hgt500=f->hgt(:,10,:,:)
hgt500=hgt500/10
dimt=dimsizes(hgt500)
print(dimt)
lon=f->lon
lat=f->lat
;calculate winterhgt
winterhgt500=new((/141,91,180/),float)
do i=0,90
do j=0,179
do it=0,1702
if(mod(it,12).eq.11)then
winterhgt500((it+1)/12,i,j)=(hgt500(it,i,j)+hgt500(it+1,i,j)+hgt500(it+2,i,j))/3
end if
end do
end do
end do
copy_VarMeta(hgt500,winterhgt500)
;calculate ave winterhgt for 1961-1990
avehgt6190=new((/91,180/),float)
do i=0,90
do j=0,179
do it=90,119
avehgt6190(i,j)=avehgt6190(i,j)+winterght500(it,i,j)
end do
avehgt6190(i,j)=avehgt6190(i,j)/30
end do
end do
avehgt6190@op="time average:"+winterght500@long_name
wks=gsn_open_wks("png","C:/dream/bj/summer/slp/hgt/avehgt6191two") ; send graphics to PNG file
res = True ; plot mods desired
res@gsnPolar = "NH" ; specify the hemisphere
res@gsnLeftString = "" ; turn off subtitles
res@gsnRightString = ""
res@gsnCenterString = ""
plot = gsn_csm_contour_map_polar(wks,avehgt6190,res) ; create the plot
end
|
|