- 积分
- 93
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-6-17
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
数据是从NCEP上下的1948-2014年的月均u和v的.nc文件
程序如下:
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
;************************************************
; read in netCDF file
;************************************************
ufname = "uwnd_mon_mean.nc" ;get uwind file name
vfname = "vwnd_mon_mean.nc" ;get vwind file name
udata = addfile(ufname,"r") ; Open uwind file
vdata = addfile(vfname,"r") ; Open vwind file
utmp = udata->uwnd ; get uwnd data
vtmp = vdata->vwnd ; get uwnd data
level = udata->level
time = udata->time
;time1 = ut_calendar(time,-1)
ttime = dimsizes(time)
lat = udata->lat
lon = udata->lon
nlat=dimsizes(lat)
nlon=dimsizes(lon)
avr_monthu = new((/nlat,nlon/),float)
avr_monthu!0 = "lat"
avr_monthu&lat = utmp&lat
avr_monthu&lat@units = "degrees_north"
avr_monthu!1= "lon"
avr_monthu&lon = utmp&lon
avr_monthu&lon@units = "degrees_east"
avr_monthv = avr_monthu
nmod=12
;*************************************
do nlevel = 0,16
do ntime =0,nmod-1
u = utmp(:,nlevel,:,:)
v = vtmp(:,nlevel,:,:)
avr_monthu = dim_avg_n(u(ntime:ttime-1:nmod,:,:),0)
avr_monthv = dim_avg_n(v(ntime:ttime-1:nmod,:,:),0)
printVarSummary(avr_monthv)
;************************************************
; create plot
;************************************************
filename="uv_mon_1980-2013_ltm_"+level(nlevel)+"_"+ntime
wks = gsn_open_wks("eps",filename) ; open a eps file
res = True ; plot mods desired
res@gsnFrame = False ; so we can draw time stamp
res@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up
res@vcRefMagnitudeF = 10.0 ; define vector ref mag
res@vcRefLengthF = 0.045 ; define length of vec ref
res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors
res@vcMinDistanceF = 0.017
res@vpWidthF = 0.8 ; make map bigger
res@vpHeightF = 0.8
res@mpMaxLatF = 90 ; select subregion
res@mpMinLatF = -90
res@mpMinLonF = 0
res@mpMaxLonF = 357.5
res@gsnLeftString = "uv at "+level(nlevel)+"hPa "+ntime
vector = gsn_csm_vector_map_ce(wks, avr_monthu, avr_monthv,res)
;************************************************
; add time stamp to plot
;************************************************
frame (wks)
cmd="convert -geometry 1000x1000 -density 1000 -trim "+filename+".eps "+filename+".png"
system(cmd)
end do
end do
end
得出的图是下面这样子。。。
刚开始提示错误是(0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesnt contain one at all (0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesnt contain one at all
后来我在前面加了数组的属性,他不报这个错了,但是画出来的图还是错的,这是为啥??
我感觉是因为我求平均求错了??
|
|