- 积分
- 141
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-20
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 xiaogao 于 2017-9-13 11:03 编辑
这是我的脚本,提取wrfout10米U、V风速,插值到离散点,最后画图。但是图上的线条和箭头都很奇怪,不知道哪里有问题,求各位大神解答。
;---Open WRF output file
files = systemfunc ("ls ../D1/wrfout_d01*")
a = addfile(files+".nc","r")
;---Find the total number of time
number = dimsizes(a->XLAT(:,0,0))
;---convet UTC time to BJ time
Times = wrf_user_getvar(a,"Times",-1) ; get all times in the file
TimeUTC = wrf_times_c(Times,1)
TimeBJT = TimeUTC + 8
copy_VarAtts(TimeUTC, TimeBJT)
times = cd_calendar(TimeBJT,-3)
;---Read several WRF variables
nl = 1
do ii = 6, number-1,nl
it = ii
u10 = a->U10(it,:,:)
v10 = a->V10(it,:,:)
u10@units = ""
v10@units = ""
v10@description =""
u10@description =""
lat2d = a->XLAT(0,:,:)
lon2d = a->XLONG(0,:,:)
lon2d@description = ""
lat2d@description = ""
lat1d = lat2d(:,122)
lon1d = lon2d(197,:)
u10@lat2d = lat2d
u10@lon2d = lon2d
u10= rcm2rgrid_Wrap(lat2d,lon2d,u10,lat1d,lon1d,0);插值到点
v10@lat2d = lat2d
v10@lon2d = lon2d
v10= rcm2rgrid_Wrap(lat2d,lon2d,v10,lat1d,lon1d,0);插值到点
;---name the result
name2 = times(it)
outname = "GFS"+name2
outname1 = outname
wks_type = "png"
wks_type@wkBackgroundOpacityF = 0.0
wks_type@wkWidth = 5000
wks_type@wkHeight = 5000
filename = times(0)
outputPath="./WindMap/GFS_D1"
wks = gsn_open_wks(wks_type,outputPath+"/"+outname1)
;---Set common resources for all plots
res = True
res@gsnFrame = False
res@gsnDraw = False
res@gsnLeftString = ""
res@gsnRightString = ""
;---Necessary for contours to be overlaid correctly on WRF projection
res@tfDoNDCOverlay = True
;---Wind vector plot
vec_res = res
vec_res@vcGlyphStyle = "CurlyVector"
vec_res@vcMinDistanceF = 0.025
vec_res@vcRefLengthF = 0.04
vec_res@vcLineArrowThicknessF = 3.0
vec_res@vcRefMagnitudeF = 5.0
vec_res@vcRefAnnoOn = False
vec_res@vcVectorDrawOrder = "PreDraw"
vec_res@NoHeaderFooter = True
vector = wrf_vector(a,wks,u10,v10,vec_res);风场作图
;---Map plot
map_res = res
map_res@gsnMaximize = True
map_res@gsnBoxMargin = 0.0
map_res@mpFillOn = False
map_res@mpOutlineOn = False
map_res@PerimOn =False
map_res@tmXBOn = False
map_res@tmYLOn = False
map_res@tmXTOn = False
map_res@tmYROn = False
map_res@tmXBBorderOn = False
map_res@tmXTBorderOn = False;
map_res@tmYLBorderOn = False
map_res@tmYRBorderOn = False
map_res@mpLimitMode = "LatLon"
map_res@mpMinLatF = min(lat1d)
map_res@mpMaxLatF = max(lat1d)
map_res@mpMinLonF = min(lon1d)
map_res@mpMaxLonF = max(lon1d)
map = gsn_csm_map(wks,map_res)
;---Overlay plots on map and draw.
overlay(map,vector)
draw(map)
frame(wks)
end do
end
|
-
|