- 积分
- 375
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-2-12
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
别人的脚本我用了,他能够画出来,我就改了下路径,但是图画出来完全一张一张的。之前下载官网的脚本也是这样,到现在没找到原因,求大神解答!!!
这个是我的脚本:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
a = addfile("./wrfout_d01_2017-07-01_00:00:00.nc","r")
type = "eps"
type@wkPaperWidthF = 8.3
type@wkPaperHeightF = 11.7
wks = gsn_open_wks(type,"wind_shade")
; wks = gsn_open_wks(type,"outputd02")
; Set some Basic Plot options
res = True
res@MainTitle = "REAL-TIME WRF"
res@vpWidthF = 0.7
res@vpHeightF = 0.4
pltres = True
mpres = True
mpres0 = True
mpres0@mpGeophysicalLineColor = "Black"
mpres0@mpNationalLineColor = "Black"
mpres0@mpUSStateLineColor = "Black"
;@mpGeophysicalLineColor = "Black" ; Overwrite basic map settings
mpres@mpGridLineColor = "Black"
mpres@mpLimbLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpPerimLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpDataSetName = "Earth..4" ; This new database contains
; divisions for other countries.
mpres@mpDataBaseVersion = "MediumRes" ; Medium resolution database
mpres@mpOutlineOn = True ; Turn on map outlines
mpres@mpOutlineSpecifiers = (/"China:states","Taiwan"/) ;China:states
;;;;;;;;;;;;
;What 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
; What levels and how many are in the data set?
pressure_levels = (/ 850., 700., 500., 300., 100./) ; pressure levels to plot
nlevels = dimsizes(pressure_levels) ; number of pressure levels
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need
z = wrf_user_getvar(a, "z",it) ; grid point height
u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical coordinate
z = wrf_user_getvar(a, "z",it) ; grid point height
spd = (u*u + v*v)^(0.5) ; speed in m/sec
spd@description = "Wind Speed"
spd@units = "m/s"
u = u*1.94386 ; winds now in kts
v = v*1.94386 ; winds now in kts
u@units = "kts"
v@units = "kts"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
do level = 0,nlevels-1 ; LOOP OVER LEVELS
pressure = pressure_levels(level)
z_plane = wrf_user_intrp3d( z,p,"h",pressure,0.,False)
u_plane = wrf_user_intrp3d( u,p,"h",pressure,0.,False)
v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
u_plane = u_plane*1.94386 ; kts
v_plane = v_plane*1.94386 ; kts
u_plane@units = "kts"
v_plane@units = "kts"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Add some level info to the plot
res@PlotLevelID = pressure + " hPa"
; Wind Vectors and Speed
opts = res
opts@ContourParameters = (/1., 25., 3. /)
opts@cnFillOn = True
opts@cnFillColors= (/"White","White","White", "White","Chartreuse","ForestGreen", "Yellow","Orange","Red","Violet"/)
contour = wrf_contour(a,wks,spd(level,:,:),opts)
delete(opts)
opts = res
opts@FieldTitle = "Wind" ; Overwrite Field Title
opts@NumVectors = 47 ; wind barb density
vector = wrf_vector(a,wks,u(level,:,:),v(level,:,:),opts)
delete(opts)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
plot = wrf_map_overlays(a,wks,(/contour,vector/),pltres,mpres)
end do ; END OF LEVEL LOOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end do ; END OF TIME LOOP
end
|
-
-
|