- 积分
- 11712
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-11-6
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
|
问题概况: |
使用NCL添加自己的shp文件,能够运行,没有报错,但就是叠加不了地图。 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
1 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
;****************************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "./WRF_contributed.ncl.test" ; copied on 4/5/4 from /fs/cgd/data0/shea/nclGSUN.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
;************************************************
; open file and read in data
;************************************************
works = "png"
first_guess = addfile("/home/fzl/Build_WRF/Domain/WRFDA-Domain/2021081200/wrfinput_d01"+".nc", "r")
analysis = addfile("/home/fzl/Build_WRF/Domain/WRFDA-Domain/2021081200/wrfvar_output"+".nc", "r")
;************************************************
; Read vertical coordinate for plot labels
;************************************************
znu = first_guess->ZNU(0,:) ; (Time, bottom_top)
;************************************************
; Read fields
;************************************************
; Fix the desired level below
kl = 1
var = "U"
fg = first_guess->U ;Theta-T0
an = analysis->U ;Theta-T0
plot_data = an - fg
;plot_data = an
; var = "T"
; fg = first_guess->T ;Theta- 300
; an = analysis->T ;Theta- 300
; plot_data = an - fg
; plot_data = fg + 300.0
;************************************************
; create plots
;************************************************
wks = gsn_open_wks(works, "WRF-VAR_"+var+"_level_"+kl) ; ps,pdf,x11,ncgm,eps
gsn_define_colormap(wks ,"BlAqGrYeOrReVi200"); choose colormap
res = True ; plot mods desired
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
;res@cnFillPalette = "OceanLakeLandSnow"
;set for map
res@mpFillDrawOrder = "PostDraw"
res@mpFillOn = True
res@mpDataSetName = "Earth..4"
res@mpDataBaseVersion = "MediumRes" ; or "Ncarg4_1"
res@mpAreaMaskingOn = True
res@mpMaskAreaSpecifiers = (/"xizang"/)
;res@mpFillAreaSpecifiers = (/"xizang"/)
;res@mpMaskAreaSpecifiers = (/"China"/)
res@mpOutlineSpecifiers = (/"China","China:xizang"/)
res@mpMinLatF = 25.
res@mpMaxLatF = 35.
res@mpMinLonF = 90.
res@mpMaxLonF = 110.
res@mpLandFillColor = "white"
res@mpInlandWaterFillColor = "white"
res@mpOceanFillColor = "white"
res@mpFillBoundarySets = "NoBoundaries"
res@mpOutlineBoundarySets = "NoBoundaries"
res@mpNationalLineColor = "black"
res@mpProvincialLineColor = "black"
res@mpGeophysicalLineColor = "black"
res@mpNationalLineThicknessF = 2
res@mpProvincialLineThicknessF = 2
;res@mpOutlineBoundarySets = "AllBoundaries"
WRF_map_c(first_guess,res,0) ; set map resources
nt = 0 ; last time step
res@gsnSpreadColors = True ; use full range of colormap
res@cnFillOn = True ; color plot desired
res@cnLinesOn = False ; turn off contour lines
res@cnLineLabelsOn = False ; turn off contour labels
res@lbLabelAutoStride = True ; let NCL figure lb stride
res@gsnLeftString = var+"("+kl+")"
res@gsnRightString = "2021-08-12 08:00"
plot = gsn_csm_contour_map(wks,plot_data(nt,kl,:,:),res)
;--- add shp file boundaries ---
ShpDir = "/home/fzl/Build_WRF/LIBRARIES/全国各省shp文件/全国各省shp文件/xinjiang_xianjie.shp" ;./cnmap/"
plres = True
plres@gsLineThicknessF = 2.0
plres@gsLineColor = "red"
poltshp1 = gsn_add_shapefile_polylines(wks,plot,ShpDir,plres)
draw(plot)
frame(wks)
end
|
|