- 积分
- 10605
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-10-10
- 最后登录
- 1970-1-1
|
发表于 2014-6-24 17:17:34
|
显示全部楼层
本帖最后由 longlivehj 于 2014-6-24 17:48 编辑
就在你的代码上改了一下,红色标出来了。
问你1948到2007年平均的意思是,你可以用addfiles或循环来做。否则,60年平均,按你目前的写法,只是读文件就要写60 * 4 = 240行程序。
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
fu1=addfile("2001/uwnd.2001.nc","r")
fv1=addfile("2001/vwnd.2001.nc","r")
U1=short2flt(fu1->uwnd)
V1=short2flt(fv1->vwnd)
fu2=addfile("2002/uwnd.2002.nc","r")
fv2=addfile("2002/vwnd.2002.nc","r")
U2=short2flt(fu2->uwnd)
V2=short2flt(fv2->vwnd)
fu3=addfile("2003/uwnd.2003.nc","r")
fv3=addfile("2003/vwnd.2003.nc","r")
U3=short2flt(fu3->uwnd)
V3=short2flt(fv3->vwnd)
fu4=addfile("2004/uwnd.2004.nc","r")
fv4=addfile("2004/vwnd.2004.nc","r")
U4=short2flt(fu4->uwnd)
V4=short2flt(fv4->vwnd)
fu5=addfile("2005/uwnd.2005.nc","r")
fv5=addfile("2005/vwnd.2005.nc","r")
U5=short2flt(fu5->uwnd)
V5=short2flt(fv5->vwnd)
fu6=addfile("2006/uwnd.2006.nc","r")
fv6=addfile("2006/vwnd.2006.nc","r")
U6=short2flt(fu6->uwnd)
V6=short2flt(fv6->vwnd)
fu7=addfile("2007/uwnd.2007.nc","r")
fv7=addfile("2007/vwnd.2007.nc","r")
U7=short2flt(fu7->uwnd)
V7=short2flt(fv7->vwnd)
fu8=addfile("2008/uwnd.2008.nc","r")
fv8=addfile("2008/vwnd.2008.nc","r")
U8=short2flt(fu8->uwnd)
V8=short2flt(fv8->vwnd)
fu9=addfile("2009/uwnd.2009.nc","r")
fv9=addfile("2009/vwnd.2009.nc","r")
U9=short2flt(fu9->uwnd)
V9=short2flt(fv9->vwnd)
fu10=addfile("2010/uwnd.2010.nc","r")
fv10=addfile("2010/vwnd.2010.nc","r")
U10=short2flt(fu10->uwnd)
V10=short2flt(fv10->vwnd)
U = U1(603:847,:,:,:)
V = U
U=(U1(603:847,:,:,:)+U2(603:847,:,:,:)+U3(603:847,:,:,:)+U4(607:851,:,:,:)+U5(603:847,:,:,:)+U6(603:847,:,:,:)+U7(603:847,:,:,:)+U8(607:851,:,:,:)+U9(603:847,:,:,:)+U10(603:847,:,:,:))/10.0
V=(V1(603:847,:,:,:)+V2(603:847,:,:,:)+V3(603:847,:,:,:)+V4(607:851,:,:,:)+V5(603:847,:,:,:)+V6(603:847,:,:,:)+V7(603:847,:,:,:)+V8(607:851,:,:,:)+V9(603:847,:,:,:)+V10(603:847,:,:,:))/10.0
tU=dim_avg_n_Wrap(U,0)
tV=dim_avg_n_Wrap(V,0)
;----------850hpa-----------
u=tU(2,:,:)
v=tV(2,:,:)
wks=gsn_open_wks("ps","NNRP2_UV_850_JJA_2001_2010")
resuv = True
resuv@tfDoNDCOverlay =True ;trun off map projection
resuv@vcRefMagnitudeF=15.0
resuv@vcRefLengthF=0.045
;thin the vectors
resuv@vcMinDistanceF=0.017
resuv@tiMainString="JJA Mean U-VWind NNRP2 850hpa 2001-2010"
plot=gsn_csm_vector_map(wks,u,v,resuv)
delete(resuv)
delete(plot)
delete(u)
delete(v)
end
|
|