| 
 
	积分172贡献 精华在线时间 小时注册时间2019-11-5最后登录1970-1-1 
 | 
 
 
 楼主|
发表于 2020-3-11 22:34:13
|
显示全部楼层 
| 你好,但是还是没成功,可以帮我看下是不是其他设置出了问题
 
 res                 = True
 
 ; Set some contouring resources.
 ;cmap     := read_colormap_file("OceanLakeLandSnow")
 ;cmap(0,:) = (/0,0,0,0/)    ; make first color fully transparent
 res@cnFillOn        = True
 res@cnLinesOn       = False
 res@cnLineLabelsOn  = False
 res@cnInfoLabelOn   = False
 res@gsnSpreadColors = True
 res@cnLevelSelectionMode = "ExplicitLevels"
 res@cnLevels             = (/0,10, 20, 50,100, 200, 300, 500, 700, \
 900,1000, 1300/)
 res@cnFillPalette = "OceanLakeLandSnow"
 res@gsnLeftString = ""
 res@gsnRightString = ""
 
 res@gsnDraw         = False
 res@gsnFrame        = False
 ; Add map resources
 res@mpFillOn =   True ;False
 res@mpOutlineBoundarySets = "AllBoundaries"
 res@mpDataSetName         = "Earth..4"
 res@mpDataBaseVersion     = "MediumRes"          ; Default is LowRes
 res@mpOutlineDrawOrder    = "PostDraw"          ; Draw map outlines last
 res@mpOutlineOn           = True
 res@mpOutlineSpecifiers   = (/"China:states","Taiwan"/)
 res@mpAreaMaskingOn           = True
 res@mpFillOn                    = True
 res@mpFillAreaSpecifiers        = (/"water",       "land" /)
 res@mpSpecifiedFillColors       = (/"skyblue1","white"/)
 ; res@mpOutlineDrawOrder    = "PostDraw"          ; Draw map outlines last
 
 
 res@mpGridAndLimbOn       = False                ; Turn off lat/lon lines
 res@pmTickMarkDisplayMode = "Always"             ; Turn on map tickmarks
 res = set_mp_wrf_map_resources(d1,res)
 res@mpLimitMode        = "Corners"               ; Portion of map to zoom
 res@mpLeftCornerLatF   = lat1(0,0)
 res@mpLeftCornerLonF   = lon1(0,0)
 res@mpRightCornerLatF  = lat1(ny1,nx1)
 res@mpRightCornerLonF  = lon1(ny1,nx1)
 
 ; Add label bar resources
 res@lbLabelAutoStride = True
 res@gsnMaximize     = True    ; Maximize plot in frame
 
 
 res2@lbLabelBarOn = False  ; Labelbar already created in 1st plot
 res2@gsnMaximize  = False  ; Use maximization from original plot
 ; Add map resources
 res@mpFillOn =   True ;False
 res@mpOutlineBoundarySets = "AllBoundaries"
 res@mpDataSetName         = "Earth..4"
 res@mpDataBaseVersion     = "MediumRes"          ; Default is LowRes
 res@mpOutlineDrawOrder    = "PostDraw"          ; Draw map outlines last
 res@mpOutlineOn           = True
 res@mpOutlineSpecifiers   = (/"China:states","Taiwan"/)
 res@mpAreaMaskingOn           = True
 res@mpFillOn                    = True
 res@mpFillAreaSpecifiers        = (/"water",       "land" /)
 res@mpSpecifiedFillColors       = (/"skyblue1","white"/)
 ; res@mpOutlineDrawOrder    = "PostDraw"          ; Draw map outlines last
 
 
 res@mpGridAndLimbOn       = False                ; Turn off lat/lon lines
 res@pmTickMarkDisplayMode = "Always"             ; Turn on map tickmarks
 dom_rank = dimsizes(dom_dims)
 nx2 = dom_dims(dom_rank - 1) - 1
 ny2 = dom_dims(dom_rank - 2) - 1
 
 
 res                 = True
 
 ; Set some contouring resources.
 ;cmap     := read_colormap_file("OceanLakeLandSnow")
 ;cmap(0,:) = (/0,0,0,0/)    ; make first color fully transparent
 res@cnFillOn        = True
 res@cnLinesOn       = False
 res@cnLineLabelsOn  = False
 res@cnInfoLabelOn   = False
 res@gsnSpreadColors = True
 res@cnLevelSelectionMode = "ExplicitLevels"
 res@cnLevels             = (/0,10, 20, 50,100, 200, 300, 500, 700, \
 900,1000, 1300/)
 res@cnFillPalette = "OceanLakeLandSnow"
 res@gsnLeftString = ""
 res@gsnRightString = ""
 
 res@gsnDraw         = False
 res@gsnFrame        = False
 
 res2 = res
 
 ; Add map resources
 res@mpFillOn =   True ;False
 res@mpOutlineBoundarySets = "AllBoundaries"
 res@mpDataSetName         = "Earth..4"
 res@mpDataBaseVersion     = "MediumRes"          ; Default is LowRes
 res@mpOutlineDrawOrder    = "PostDraw"          ; Draw map outlines last
 res@mpOutlineOn           = True
 res@mpOutlineSpecifiers   = (/"China:states","Taiwan"/)
 res@mpAreaMaskingOn           = True
 res@mpFillOn                    = True
 res@mpFillAreaSpecifiers        = (/"water",       "land" /)
 res@mpSpecifiedFillColors       = (/"skyblue1","white"/)
 ; res@mpOutlineDrawOrder    = "PostDraw"          ; Draw map outlines last
 
 
 res@mpGridAndLimbOn       = False                ; Turn off lat/lon lines
 res@pmTickMarkDisplayMode = "Always"             ; Turn on map tickmarks
 res = set_mp_wrf_map_resources(d1,res)
 res@mpLimitMode        = "Corners"               ; Portion of map to zoom
 res@mpLeftCornerLatF   = lat1(0,0)
 res@mpLeftCornerLonF   = lon1(0,0)
 res@mpRightCornerLatF  = lat1(ny1,nx1)
 res@mpRightCornerLonF  = lon1(ny1,nx1)
 
 ; Add label bar resources
 res@lbLabelAutoStride = True
 res@gsnMaximize     = True    ; Maximize plot in frame
 
 
 res2@lbLabelBarOn = False  ; Labelbar already created in 1st plot
 res2@gsnMaximize  = False  ; Use maximization from original plot
 
 ; we need these to later draw boxes for the location of the nest domain
 xbox_out = new(5,float)
 ybox_out = new(5,float)
 lnres = True
 lnres@gsLineThicknessF  = 1.5
 
 ; make images
 map = gsn_csm_contour_map(wks, var1, res)
 plot = gsn_csm_contour(wks, var2, res2)
 
 
 ; let's make 3 plots
 ; 1 - the mother domain only
 ; 2 - the mother and nest domains
 ; 3 - same as 2, but add a box around domain 2
 
 
 ; PLOT 1
 draw(map)
 frame(wks)
 
 ; PLOT 2
 overlay (map, plot)
 draw(map)
 frame(wks)
 
 ; PLOT 3
 draw(map)   ; domain 2 already overlaid here - so just draw again
 xbox = (/lon2(0,0),lon2(0,nx2),lon2(ny2,nx2),lon2(ny2,0),lon2(0,0)/)
 ybox = (/lat2(0,0),lat2(0,nx2),lat2(ny2,nx2),lat2(ny2,0),lat2(0,0)/)
 datatondc(map, xbox, ybox, xbox_out, ybox_out)
 gsn_polyline_ndc(wks, xbox_out, ybox_out, lnres)
 frame(wks)
 
 end
 
 | 
 |