- 积分
- 1491
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-8
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 薇风拂尘 于 2012-11-14 20:31 编辑
这是我的脚本,画出来的图很奇怪,要么就是空白,求指点。
; Example script to produce plots for a WRF real-data run,
; with the ARW coordinate dynamics option.
; Interpolating to specified pressure levels
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/wrf/WRF_contributed.ncl"
;load "./WRFUserARW.ncl"
begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.
a = addfile("wrfout_d01_2009-04-28_18_00_00.00.nc","r")
; We generate plots, but what kind do we prefer?
type = "x11"
; type = "pdf"
; type = "ps"
; type = "ncgm"
wks = gsn_open_wks(type,"streamline")
res = True
;************************************************
; Use WRF_contributed procedure to set map resources
;************************************************
;WRF_map_c(a, res, 0) ; reads info from file
;************************************************
; if appropriate, set True for native mapping (faster)
; set False otherwise
;************************************************
; res@tfDoNDCOverlay = True
;************************************************
; Turn on lat / lon labeling
;************************************************
;res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks
res@mpDataBaseVersion="MediumRes"
res@mpDataSetName="Earth..4"
res@mpOutlineSpecifiers="China:Provinces"
res@mpFillOn=False
res@mpGridAndLimbOn=False
; res@mpGeophysicalLineColor = "Black"
; res@mpNationalLineColor = "Black"
; res@mpUSStateLineColor = "Black"
; res@mpGridLineColor = "Black"
; res@mpLimbLineColor = "Black"
; res@mpPerimLineColor = "Black"
; res@mpGeophysicalLineThicknessF = 1.0
; res@mpGridLineThicknessF = 1.0
; res@mpLimbLineThicknessF = 1.0
; res@mpNationalLineThicknessF = 1.0
; res@mpUSStateLineThicknessF = 1.0
res@mpMinLatF =38. ; zoom in on map
res@mpMaxLatF = 44.
res@mpMinLonF = 110.
res@mpMaxLonF = 120.
res@tmYLMode="Explicit"
res@tmYLValues=(/38,39,40,41,42,43,44/)
res@tmYLLabels=(/"38","39","40","41","42","43","44N"/)
res@tmXBMode="Explicit"
res@tmXBValues=(/110,112,114,116,118,120/)
res@tmXBLabels=(/"110","112","114","116","118","120E"/)
res@gsnLeftString=" "
res@gsnRightString=" "
res@stLineColor="Blue"
res@stArrowLengthF = 0.004 ; size of the arrows
res@stMinArrowSpacingF = 0.001 ; arrow spacing.
res@stArrowStride = 2 ; arrows start every third
res@stLineColor="Blue"
res@stMinDistanceF=0.03
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; What times and how many time steps are in the data set?
times = wrf_user_list_times(a) ; get times in the file
ntimes = dimsizes(times) ; number of times in the file
; The specific pressure levels that we want the data interpolated to.
pressure_levels = (/ 1000.,925.,850., 700., 500./) ; pressure levels to plot
nlevels = dimsizes(pressure_levels) ; number of pressure levels
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
do it = 7,8 ; 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
tc = wrf_user_getvar(a,"tc",it) ; T in C
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
z=0.1*z
rh = wrf_user_getvar(a,"rh",it) ; relative humidity
lat2 = wrf_user_getvar(a,"XLAT",0)
lon2 = wrf_user_getvar(a,"XLONG",0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
do level = 0,nlevels-1 ; LOOP OVER LEVELS
pressure = pressure_levels(level)
tc_plane = wrf_user_intrp3d(tc,p,"h",pressure,0.,False)
z_plane = wrf_user_intrp3d( z,p,"h",pressure,0.,False)
rh_plane = wrf_user_intrp3d(rh,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)
printVarSummary(u_plane)
;u_plane = u_plane*1.94386 ; kts
;v_plane = v_plane*1.94386 ; kts
u_plane@units = "m/s"
v_plane@units = "m/s"
plot=gsn_csm_streamline_map(wks,u_plane,v_plane,res)
end do ; END OF LEVEL LOOP
end do ; END OF TIME LOOP
end
file:///C:\Users\sparrow\AppData\Roaming\Tencent\Users\245450868\QQ\WinTemp\RichOle\5{RYDU_D00JWIPHVLLTR8PD.jpg
|
|