登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 1649518749 于 2016-8-28 12:23 编辑
楼主推荐:http://bbs.06climate.com/forum.php?mod=viewthread&tid=47160
但是画wrfout数据的时候有时候会出现地图缺失的现象(像图1,没国界、省界、南海),不知道你们遇到没?
顺利添加成功。效果图2/3。只是没有南海小地图,我下次再找找看,怎么添加进去。
其中我做了部分处理。代码模板如下:
你只要把红色地方复制到你脚本里面就行!
; Example script to produce dbz plots for a WRF real-data run,
; with the ARW coordinate dynamics option.
; November 2008
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/cnmap/cnmap.ncl"
begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.
a = addfile("/home/fc/datafile/wrfoutdata/wrfout_d01_2016-08-17_18:00:00","r")
wks = gsn_open_wks("ps","dbz")
; gsn_define_colormap(wks,colors) ; Overwrite the standard color map
; Set some basic resources
res = True
res@MainTitle = "REAL-TIME WRF"
pltres = True
mpres = True
;>==============set for map====================================<
m=asciiread ("/home/fc/datafile/barmes.txt", (/25,29,3/) , "float") 注:/home/fc/datafile/barmes.txt 是地形文件路径,自己去天行健那里下载就行
lat=fspan(10,70,25)
lon=fspan(60,130,29)
lat@units="degrees_north"
lon@units="degrees_east"
m!0="lat"
m!1="lon"
m&lat=lat
m&lon=lon
mpres@mpLimitMode = "LatLon"
mpres@mpMinLatF = 15
mpres@mpMaxLatF = 55
mpres@mpMinLonF = 72
mpres@mpMaxLonF = 136
mpres@mpDataBaseVersion="MediumRes" ;MediumRes ;;; Ncarg4_1
mpres@mpDataSetName="Earth..4"
mpres@mpOutlineOn = True
mpres@mpOutlineSpecifiers=(/"China:states","Taiwan","Disputed area between India and China","India:Arunachal Pradesh"/)
mpres@mpOutlineBoundarySets ="NoBoundaries"
mpres@mpAreaMaskingOn = True
mpres@mpOceanFillColor = "white"
mpres@mpLandFillColor = "white"
mpres@mpInlandWaterFillColor = "white"
mpres@mpNationalLineColor = "Black" ;guojie yan se
mpres@mpUSStateLineColor = "Black" ;shengjie yanse
mpres@mpGeophysicalLineColor = "Black" ; kao shui diyu yan se
mpres@mpNationalLineThicknessF = 1.5
mpres@mpGeophysicalLineThicknessF = 1.5
mpres@mpUSStateLineThicknessF = 1.5
;>============================================================<
; Which times and how many time steps are in the data set?
times = wrf_user_getvar(a,"times",-1) ; get all times in the file
ntimes = dimsizes(times) ; number of times in the file
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
do it = 1,ntimes-1 ; TIME LOOP
print("Working on time: " + times(it))
res@TimeLabel = times(it) ; Set Valid time to use on plots
; First get the variables we will need
; Both dbz and mdbz will be calculated using constant intercept parameters
; (as in early Reisner-2), with values of 8x10^6, 2x10^7, and 4x10^6 m^-4,
; for rain, snow, and graupel, respectively.
mdbz = wrf_user_getvar(a,"mdbz",it)
dbz = wrf_user_getvar(a,"dbz",it)
opts = res
opts@cnFillOn = True
opts@ContourParameters = (/ 5., 70., 5./)
opts@cnFillColors = (/"white","white","cadetblue1","steelblue2","green","green4","yellow",\
"gold2", "orange","red","red3","red4","deeppink","magenta","gray0"/)
contour = wrf_contour(a,wks,dbz(1,:,:),opts) ; plot only lowest level
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
contour = wrf_contour(a,wks,mdbz,opts)
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
end do ; END OF TIME LOOP
end
|