- 积分
- 10656
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-5-15
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2017-11-16 15:00:31
|
显示全部楼层
wks = gsn_open_wks("x11" ,"yaogan")
; Common resources
res = True
res@tfDoNDCOverlay = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnRightString = ""
res@gsnLeftString = ""
mpres = True ; Set map options
mpres@mpGeophysicalLineColor = "Black"
mpres@mpGeophysicalLineThicknessF = 2.
mpres@mpOutlineBoundarySets = "National"
mpres@mpNationalLineColor = "Black"
mpres@mpNationalLineThicknessF = 2
lats = (/ 42.4 , 43.1/)
lons = (/ 93.1, 94.2/)
loc = wrf_user_ll_to_ij(f, lons, lats, True)
; loc(0,;) is west-east (x) ; loc(1,:) is south-north (y)
; subtract one since we want to use it as an index in NCL
x_start = loc(0,0) - 1
x_end = loc(0,1) - 1
y_start = loc(1,0) - 1
y_end = loc(1,1) - 1
mpres@ZoomIn = True ; set up map info for zoomed area
mpres@Xstart = x_start
mpres@Ystart = y_start
mpres@Xend = x_end
mpres@Yend = y_end
; olr = wrf_user_getvar(a,"OLR",-1) ; get olr
t2_zoom = t2(:,y_start:y_end,x_start:x_end) ; create a zoomed area
hgt_zoom = hgt(:,y_start:y_end,x_start:x_end)
; Line contours
lres = res
lres@cnLineColor = "NavyBlue"
lres@cnLineLabelsOn = True
lres@cnLineThicknessF = 2.0
;lres@cnInfoLabelString = hgt@description + " Contours $CMN$ TO $CMX$ BY $CIU$"
lres@cnInfoLabelFontColor = lres@cnLineColor
lres@cnLineLabelBackgroundColor = -1
lres@cnLineLabelPerimOn = True
lres@cnLineLabelAngleF = 0.
lcontour = gsn_csm_contour(wks,hgt_zoom(0,:,:),lres)
; Filled contours
fres = res
fres@cnFillOn = True
fres@cnFillMode="RasterFill"
fres@cnLinesOn = False
fres@cnInfoLabelOn = False
fres@cnFillPalette = "BlAqGrYeOrReVi200"
fres@cnLevelSelectionMode = "ExplicitLevels"
;fres@cnLevels = (/273,280,290,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311/)
;fres@cnLevels = (/280,290,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308/)
;fres@cnLevels = (/20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35/)
fres@cnLevels = (/28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47/)
;fres@cnLevels = (/12,14,16,18,20,22,24,26,28,30,32,34,36/)
fres@cnLineThicknessF = 2.0
fres@lbOrientation = "Vertical"
fres@lbLabelFontHeightF = 0.02
fcontour = gsn_csm_contour(wks,t2_zoom(0,:,:),fres)
mpres = res
mpres@tmBorderThicknessF =0.5
mpres@tmXBLabelFont =21
mpres@tmXBLabelFontHeightF =0.03
mpres@tmXBLabelFontThicknessF = 10.0
mpres@tmXBMajorLengthF = 0.015
mpres@tmXBMajorThicknessF =1.0
mpres@tmXBMinorPerMajor =4
mpres@tmXBTickSpacingF =1.0
mpres@tmXMajorGridThicknessF=1.0
mres = wrf_map_resources(f,mpres) ; Add necessary resources for WRF map
map = gsn_csm_map(wks,mpres)
; Overlay everything on a WRF map
overlay(map,fcontour)
overlay(map,lcontour)
draw(map)
frame(wks)
|
|