- 积分
- 8197
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-7-3
- 最后登录
- 1970-1-1
|
发表于 2020-10-28 09:45:07
|
显示全部楼层
想问一下我画FNL的涡度场的时候不管加不加trGridType这条命令都有这个warning:ContourPlotDraw: out of range coordinates encountered; standard AreaFill rendering method may be unreliable;
consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values
画出来的涡度图分布有棱有角的,这个是什么问题呢??
下面是我的脚本:
load"$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
;;;;;;;;;;;;;;;;;;;;;;;;;;fnl;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a = addfile("E:\fnl\20080608\fnl.grib2","r")
v= a->VGRD_P0_L100_GLL0(:,20,:,:)
u =a->UGRD_P0_L100_GLL0(:,20,:,:)
p =a->lv_ISBL0
print(p)
printVarSummary(u)
uu = dim_avg_n_Wrap(u,0)
vv = dim_avg_n_Wrap(v,0)
scale=1.e05
vort = uv2vr_cfd(uu,vv,u&lat_0,u&lon_0,0)*scale
type = "pdf"
wks = gsn_open_wks(type,"v080608")
gsn_define_colormap(wks,"WhiteBlueGreenYellowRed")
; Set some basic resources
cnres = True ; plot mods desired
cnres@gsnFrame = False
cnres@gsnDraw = False
cnres@gsnMaximize = True
cnres@gsnRightString = " " ; turn off right string
cnres@gsnLeftString = " " ; turn off left string
cnres@pmTickMarkDisplayMode = "Always"
; cnres@tiXAxisString = " "
res = True
res = cnres
res@vcGlyphStyle = "CurlyVector" ; "CurlyVector" , "WindBarb"
res@vcFillArrowEdgeColor = "white"
res@vcFillArrowFillColor = "black"
res@vcMinDistanceF = 0.02
res@vcMinMagnitudeF = 5.0
;; 箭头头部大小一致。若要绘制头部大小不一致箭头可参考第4章示例。
res@vcFillArrowMinFracWidthF = 1.0
res@vcFillArrowHeadMinFracXF = 1.0
res@vcFillArrowHeadMinFracYF = 1.0
;; 参考箭头
res@vcRefAnnoOn = True
res@vcRefMagnitudeF = 20 ;标准长度箭头所表示的大小
res@vcRefLengthF = 0.04 ;标准长度箭头在图形中的长度
res@vcRefAnnoBackgroundColor = "white" ;背景颜色
res@vcRefAnnoPerimOn = False ;关闭边框
res@vcRefAnnoFontHeightF = 0.015 ;参考箭头标签字体大小
res@vcRefAnnoString1On = False ;设定参考箭头上、
res@vcRefAnnoString2On = True ; 下的字符
res@vcRefAnnoString2 = "20 m/s"
;----------------------------------map plot--------------------------------
mpres = cnres
;---Zoom in on area of interest
mpres@mpLimitMode = "LatLon"
mpres@mpMinLatF = 18.
mpres@mpMaxLatF = 32.
mpres@mpMinLonF = 102.
mpres@mpMaxLonF = 124.
mpres@mpDataBaseVersion = "MediumRes"
mpres@mpDataSetName = "Earth..4"
mpres@mpOutlineOn = True ; Turn on map outlines
mpres@mpOutlineSpecifiers = (/"China","Taiwan"/) ;China:states
mpres@mpLandFillColor = "white"
mpres@mpInlandWaterFillColor = "white"
mpres@mpOceanFillColor = "white"
mpres@gsnMajorLatSpacing = 4.
mpres@gsnMajorLonSpacing = 4. ; 设置高级绘图窗口gsn中经纬度刻度的间隔
mpres@tmXTOn = False ;不显示X轴顶部的坐标刻度
mpres@tmYROn = False ;不显示Y轴右侧的坐标刻度
mpplot=gsn_csm_map(wks,mpres)
;----------------------------- contour plot--------------------------------------
cnres = True
cnres@cnLinesOn = False
cnres@cnFillOn = True
cnres@cnLineLabelsOn = False
cnres@cnLineLabelFontHeightF = 0.01
cnres@gsnSpreadColorEnd = -3 ; End third from the last color in color map
cnres@cnLineLabelPlacementMode = "Computed"
cnres@cnLineLabelDensityF = 0.0
cnres@lbTitleOn = False
cnres@pmLabelBarOrthogonalPosF = -0.05
cnres@cnLevelSelectionMode = "ExplicitLevels"
cnres@cnLevels = (/ -3, -2, -1, 0, 0.5, 1, 1.5, 2, 2.5, 3/)
cnres@cnFillColors = (/ 64, 48, 32, 16, 142,143,158,159,175,190,191/)
cnres@cnSmoothingOn = True
cnres@vpHeightF = 0.1
cnres@vpWidthF = 0.8
cnres@vpXF = 0.1
cnres@vpYF = 0.9
uvplot = gsn_csm_vector(wks,uu,vv,res)
cnplot = gsn_csm_contour(wks,vort,cnres) ; create plot
;--------------------------- draw plot and fram wks------------------------------
overlay(mpplot,cnplot)
overlay(mpplot,uvplot)
draw(mpplot)
frame(wks)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end |
|