- 积分
- 1210
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 FrankieLJY 于 2017-3-29 10:14 编辑
我wrf输出数据是每小时一个输出,然后每天生成一个文件!
将一个月的30个文件用 cdo mergetime iFile wrfout1 生成一个合并的文件,时间维有720个小时!
之后再用 cdo timmean wrfout1 wrfout2 生成720个小时的平均值文件(我的理解应该是所有变量的数值都被平均了),最后确实所有值都只剩平均值,包括时间(如附件)!
想用平均值文件晚wrfout_2010_01.nc文件做一个温度的图出来,代码如下:
begin
a=addfile("./wrfout_2010_01.nc", "r")
type="pdf"
wks=gsn_open_wks(type, "tempreture")
res=True
res@MainTitle = "Essay Plot"
pltres=True
mpres=True
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mpres@mpDataBaseVersion = "Ncarg4_1"
mpres@mpDataSetName = "Earth..4"
;mpres@mpGeophysicalLineColor = "Black"
;mpres@mpGridLineColor = "Black" ;latitudes and longitudes.
;mpres@mpLimbLineColor = "Black"
mpres@mpNationalLineColor = "Black"
;mpres@mpPerimLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpOutlineBoundarySets = "AllBoundaries"
;;;;;;;;;;;;;;;;;;;;;;;;
t =wrf_user_getvar(a, "T2", 0)
tc=t-273.16
tc@description="Surface Temperature"
tc@units="c"
opts=res
opts@cnFillOn=True
opts@ContourParameters=(/-20.,20.,2./)
opts@gsnSpreadColorEnd=-3
contour_tc=wrf_contour(a, wks, tc, opts)
delete(opts)
plot=wrf_map_overlays(a, wks, (/contour_tc/), pltres, mpres) ;;;43行就是这一行
;map=gsn_contour_map(wks, counter_tc, mpres)
end
我觉得我的代码应该是没有问题的,但是在运行中总是报如下错误:
fatal:Number of subscripts do not match number of dimensions of variable, (3) subscripts used, (2) subscripts expected
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 4527 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 4619 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 4702 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 43 in file tempreture.ncl
希望能有大神解答一下,实在是很困惑。
我尝试了用这个代码去跑wrf输出的数据是没有问题的,我不知道错在了哪一步?
|
-
|