- 积分
- 119
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-3-1
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
昨天随便百度了一个脚本就用了 ,但是很奇怪为什么这个输出的降雨图里没有颜色。所以想求提取wrfout变量的ncl脚本!!!
以下是我昨天下载的脚本:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
;
;the WRF ARF input file
a = addfile("/public/home/czhang/app/WRF/3.8.1/WRFV3-MPI/run/wrfout_d01_2019-02-19_00:00:00.nc","r")
rainc=a->RAINC
printVarSummary(rainc)
rainnc=a->RAINNC
printVarSummary(rainnc)
nt1=dimsizes(rainc(:,0,0))
nt2=dimsizes(rainnc(:,0,0))
;calculate the total precipitation
rain_exp=wrf_user_getvar(a,"RAINNC",-1)
rain_con=wrf_user_getvar(a,"RAINC",-1)
rain_tot=(rain_exp+rain_con)
rain_tot@description="Total Precipitation (mm)"
; create a window
wks = gsn_open_wks("png","wrf_total_rain")
;define colormap
cmap = (/ (/255, 255, 255/), \
(/ 0, 0, 0/), \
(/255, 255, 255/), \
(/248, 248, 255/), \
(/191, 239, 255/), \
(/178, 223, 238/), \
(/187, 255, 255/), \
(/187, 255, 255/), \
(/174, 238, 238/), \
(/152, 245, 255/), \
(/122, 197, 205/), \
(/118,238,0/),\
(/238,230,133/),\
(/238, 154, 0/), \
(/205, 133, 0/), \
(/238, 92, 66/), \
(/255, 69, 0/),\
(/238, 64, 0/), \
(/ 205, 55, 0/) /) / 255.
gsn_define_colormap(wks,cmap)
; gsn_define_colormap(wks,"Rainbow")
;make some basic resources
res = True
res@gsnFrame = False
res@MainTitle = "Total Rain"
res@gsnDraw = False
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnFillOn = True
res@cnLinesOn = False
res@lbLabelAutoStride = True
res@cnFillDrawOrder = "PreDraw"
res@cnInfoLabelOn = False
; res@cnLevels = (/0,30,60,90,120,150,180,210/)
; res@cnFillColors = (/"white","whitesmoke","turquoise1","turquoise2","turquoise3","greenyellow","green","green3","firebrick1","firebrick"/)
;res@cnConstFlabelOn = False
;res@mpFillOn = True
;res@cnFillAreaSpecifiers = (/"Land"/)
;res@mpAreamaskingOn = True
;res@mpMaskAreaSpecifiers = "Water"
contour_tot = wrf_contour(a,wks,rain_tot(0,:,:),res)
;draw administrative region
mpres = True
mpres@gsnFrame = False
mpres@mpGridLineDashPattern = 2 ; lat/lon lines dashed
mpres@mpGeophysicalLineColor = "Black"
mpres@mpGeophysicalLineThicknessF = 2
mpres@mpNationalLineColor = "Black"
mpres@mpNationalLineThicknessF = 2
mpres@mpGridLineColor = "Black"
mpres@mpGridLineThicknessF = 2
mpres@mpLimbLineColor = "Black"
mpres@mpLimbLineThicknessF = 2
mpres@mpPerimLineColor = "Black"
mpres@mpPerimLineThicknessF = 2
mpres@mpUSStateLineColor = "Black"
mpres@mpUSStateLineThicknessF = 2
mpres@mpDataBaseVersion = "MediumRes"
mpres@mpDataSetName = "Earth..4"
mpres@mpOutlineSpecifiers = (/"China:states"/)
pltres = True
pltres@gsnFrame = False
plot = wrf_map_overlays(a,wks,(/contour_tot/),pltres,mpres)
;before make text, you should remember make pltres@gsnFrame mpres@gsnFrame=False
tres = True
tres@gsnFrame = False
tres@txFontHeightF = 0.01
plat = (/39.9,40.0,39.10/)
plon = (/116.3,115.0,117.10/)
province = (/"BJ","HB","TJ"/)
do i=0,2
gsn_text(wks,plot,province(i),plon(i),plat(i),tres)
end do
frame(wks)
end
听很多博主说官网上有脚本 但我也没有找到,跪求分享~!!!
|
|