爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 11187|回复: 2

[作图] 用wrfout画图怎么都画不出国家边界和台湾边界,求助哎

[复制链接]

新浪微博达人勋

发表于 2020-9-18 09:57:27 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
就是我用ncl官网下下来的脚本稍加修改了以后,画海平面气压和风场,但是怎么修改都画不出中国边界和台湾省的边界图,可以画出各个省界,求助哎o(╥﹏╥)o
下面是我的脚本
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"

begin
type = "pdf"
fon ="wrf_slp_wind10m_1009"; 输出图档名称
  wks = gsn_open_wks(type,fon)
;================画图设置  
; Set some basic resources
  res = True
  res@MainTitle                   = "wrf_slp_wind10m"
;------------- map settings ------------  
   mpres = True
    mpres@mpMinLatF = 20.
   mpres@mpMaxLatF = 30.
      mpres@mpMinLonF = 110.
      mpres@mpMaxLonF = 130.
        mpres@mpOutlineOn   = True    ;turn on map outlines
       mpres@mpDataBaseVersion       = "MediumRes"
      mpres@mpDataSetName           = "Earth..4"
     mpres@mpOutlineSpecifiers       =(/"China","Fujian"/)
        ; mpres@mpOutlineSpecifiers           = (/"China:states","Taiwan"/)
         mpres@mpProvincialLineColor       ="Black"
         mpres@mpProvincialLineThicknessF   =3
        mpres@mpCountyLineColor       ="Black"
        mpres@mpCountyLineThicknessF   =3
    pltres = True
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; a = addfiles(FILES,"r")
  a = addfiles("/mnt/d/ncl/script/wrf/2018070912/wrfout_d01_2018-07-10_090000" ,"r")
  times = wrf_user_getvar(a,"times",-1)  ; get all times in the file
  ntimes = dimsizes(times)         ; number of times in the file

  slp = wrf_user_getvar(a,"slp",-1)    ; slp
    wrf_smooth_2d( slp, 3 )            ; smooth slp
  u10 = wrf_user_getvar(a,"U10",-1)    ; u at 10 m, mass point
  v10 = wrf_user_getvar(a,"V10",-1)    ; v at 10 m, mass point
  u10 = u10*1.94386*2.5                    ; Turn wind into knots
  v10 = v10*1.94386*2.5
    u10@units = "kts"
    v10@units = "kts"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  do it = 0,ntimes-1,2             ; TIME LOOP

    print("Working on time: " + times(it) )
    res@TimeLabel = times(it)   ; Set Valid time to use on plots

    ; Plotting options for SLP            
      opts = res         
      opts@cnLineColor = "Blue"
      opts@cnHighLabelsOn = True
      opts@cnLowLabelsOn = True
      opts@ContourParameters = (/ 900., 1100., 4. /)
      opts@cnLineLabelBackgroundColor = -1
      opts@gsnContourLineThicknessesScale = 2.0
      contour_psl = wrf_contour(a[it],wks,slp(it,:,:),opts)
      delete(opts)

    ; Plotting options for Wind Vectors                 
      opts = res         
      opts@FieldTitle = "Wind"       ; overwrite Field Title
      opts@NumVectors = 47           ; density of wind barbs
      vector = wrf_vector(a[it],wks,u10(it,:,:),v10(it,:,:),opts)
      delete(opts)

    ; MAKE PLOTS                                       
      plot = wrf_map_overlays(a[it],wks,(/contour_psl,vector/),pltres,mpres)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  end do        ; END OF TIME LOOP

end


反正就是死活画不出国家边界和台湾的边界哎,求助

1.PNG
2.PNG
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-9-18 16:28:34 | 显示全部楼层
供参考
  mpres = res
  mpres@pmTickMarkDisplayMode="Always"
  mpres@mpOceanFillColor="white"
  mpres@mpLandFillColor="white"
  mpres@mpOutlineOn          =True
  mpres@mpDataBaseVersion = "MediumRes"
  mpres@mpDataSetName = "Earth..4"
  mpres@mpOutlineBoundarySets = "National"
  mpres@mpOutlineSpecifiers = (/"China:states","Taiwan"/)
  mpres@mpGeophysicalLineColor = "dimgrey"
  mpres@mpNationalLineColor    = "dimgrey"
  mpres@mpUSStateLineColor     = "dimgrey"
  mpres@mpGridLineColor        = "dimgrey"
  mpres@mpLimbLineColor        = "dimgrey"
  mpres@mpPerimLineColor       = "dimgrey"
  mpres@mpGridAndLimbOn        = False
  mpres@mpGeophysicalLineThicknessF = 1.5
  mpres@mpProvincialLineThicknessF = 1.5
  mpres@mpNationalLineThicknessF = 1.5
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2021-4-23 15:35:00 | 显示全部楼层
mpres@mpOutlineSpecifiers = (/"China:states","Taiwan"/)这一行被你注释掉了,所以没有显示。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表