- 积分
- 8280
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-3-11
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2014-7-30 17:25:26
|
显示全部楼层
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/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
files=systemfunc("ls -1 wrfout_d01_2013-08*")
f=addfiles(files,"r")
ListSetType(f,"cat")
rainc=wrf_user_getvar(f[:],"RAINC",-1)
rainnc=wrf_user_getvar(f[:],"RAINNC",-1)
i_rainc=wrf_user_getvar(f[:],"I_RAINC",-1)
i_rainnc=wrf_user_getvar(f[:],"I_RAINNC",-1)
;xlat=wrf_user_getvar(f[:],"XLONG",-1)
; print(xlat(0,0,:))
times=wrf_user_getvar(f[:],"times",-1) ; get all times in the file
ntimes = dimsizes(times) ; number of times in the file
rain=rainc+100.0*i_rainc+rainnc+10*i_rainnc
;result_rain=rain(1,:,:)-rain(0,:,:)
;t_rain=dim_avg_n_Wrap(rain,0)
result_rain1 = dim_avg_n_Wrap(rain(1 : , :, :) - rain(0 : ntimes - 2, :, :), 0)
result_rain=result_rain1*4
;result_rain=dim_sum_n_Wrap(rain,0)
;wrf_smooth_2d( result_rain, 3 )
wks = gsn_open_wks("png","wrfout_avg_rain_August")
colors = (/"white","black", "Snow" \
,"PaleTurquoise","PaleGreen","SeaGreen3" ,"Yellow" \
,"Orange","HotPink","Red","Violet", "Purple", "Brown"/)
;gsn_define_colormap(wks,"wh-bl-gr-ye-re")
gsn_define_colormap(wks, colors);rain,dir,maxdir,spd,vis
; Set some basic resources
res = True
res@MainTitle = "REAL-TIME WRF"
pltres = True
mpres = True
res@cnFillOn=True
res@cnLineColor = "Blue"
;res@gsnDraw = False ; Don't draw plots
;res@gsnFrame = False ; Don't advance frames
;res@cnFillColors = 2 ; 起始于color index 14
res@cnLinesOn = False ; 关闭等值线线条
res@FieldTitle = "RAIN(mm) in August"
res@cnLevelSelectionMode = "ExplicitLevels"
;res@cnLevels = (/20,40,60,80,100,120,140,160,180,200,220/) ; rain
res@cnLevels = (/0.4,4,8,12,16,20,30,40,60,80/) ; rain
;contour_rain = wrf_contour(f[0],wks,result_rain,res)
contour_rain=wrf_contour(f[0],wks,result_rain,res)
pltres@LatLonOverlay = True
;mpres@gsnFrame = False
;mpres@gsnDraw = False
mpres@mpGeophysicalLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpGridLineColor = "White"
mpres@mpLimbLineColor = "White"
mpres@mpPerimLineColor = "Black"
;mpres@mpGeophysicalLineThicknessF = 2.0
;mpres@mpGridLineThicknessF = 2.0
mpres@mpLimbLineThicknessF = 2.0
mpres@mpNationalLineThicknessF = 2.0
mpres@mpUSStateLineThicknessF = 2.0
mpres@mpDataBaseVersion="MediumRes"
mpres@mpDataSetName="Earth..4"
mpres@mpOutlineOn = True
mpres@mpFillOn=True
mpres@mpOutlineSpecifiers=(/"China:states","Taiwan"/)
mpres@mpOutlineBoundarySets ="NoBoundaries"
mpres@mpDataBaseVersion="MediumRes"
mpres@mpDataSetName="Earth..4"
mpres@mpOutlineSpecifiers=(/"China:states","Taiwan"/)
mpres@mpAreaMaskingOn = True
mpres@mpMaskAreaSpecifiers = (/"China","Taiwan"/) ;China:state
; mpres@mpFillDrawOrder = "PreDraw"
mpres@mpOceanFillColor="White"
mpres@mpLandFillColor="White"
mpres@mpInlandWaterFillColor="White"
plot= wrf_map_overlays(f[0],wks,(/contour_rain/),pltres,mpres)
; 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)
;>============================================================<
;draw(plot)
;frame(wks)
end
|
|