- 积分
- 7129
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-4
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 1649518749 于 2016-8-24 16:36 编辑
楼主推荐http://bbs.06climate.com/forum.php?mod=viewthread&tid=47083
麻烦哪位大神帮我看看这脚本有没有问题,或者帮我测试一下也行。谢谢啦按照这方法http://bbs.06climate.com/forum.php?mod=viewthread&tid=11797画出来的图叠加底图没效果。
ncl版本6.3.0
代码:
; 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mpres@mpFillOn = True
mpres@mpOutlineOn = False ; Use outlines from shapefile
res@cnFillDrawOrder = "PreDraw"
mpres@mpDataBaseVersion = "MediumRes"
mpres@mpDataSetName = "Earth..4"
mpres@mpAreaMaskingOn = True
mpres@mpMaskAreaSpecifiers = (/"China:states","Taiwan","Disputed area between India and China","India:Arunachal Pradesh"/)
mpres@mpLandFillColor = "white"
mpres@mpInlandWaterFillColor = "white"
mpres@mpOceanFillColor = "white"
mpres@mpOutlineBoundarySets = "NoBoundaries" ;NoBoundaries or National
mpres@mpNationalLineColor = "Black"
mpres@mpGeophysicalLineColor = "Black"
mpres@mpNationalLineThicknessF = 1.0
mpres@mpGeophysicalLineThicknessF = 1.0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 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)
;>============================================================<
; add China map
;>------------------------------------------------------------<
cnres = True
cnres@china = True ;draw china map or not
cnres@river = True ;draw changjiang&huanghe or not
cnres@province = True ;draw province boundary or not
cnres@nanhai = True ;draw nanhai or not
cnres@diqu = False ; draw diqujie or not
chinamap = add_china_map(wks,plot,cnres)
;>============================================================<
end do ; END OF TIME LOOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end
|
-
-
|