- 积分
- 237
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-12-11
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
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
;
; Make a list of all files we are interested in
DATADir = "/mnt/Disk16T/Guoxl/"
FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d02_20* ")
numFILES = dimsizes(FILES)
print("numFILES = " + numFILES)
print(FILES)
print (" ")
; We generate plots, but what kind do we prefer?
type = "PNG"
; type = "pdf"
; type = "ps"
; type = "ncgm"
wks = gsn_open_wks(type,"plt_Surface_multi_files")
spd_num = new((/99,150/),float)
speed = new((/99,150/),float)
spd_num=0.0
;--------------------------------
; Set some Basic Plot options
;--------------------------------
res = True
res@Footer = False
res@mpGeophysicalLineColor = "Black"
res@mpNationalLineColor = "Black"
res@mpGridAndLimbOn = False
res@mpDataSetName = "Earth..4" ; divisions for other countries.
res@mpDataBaseVersion = "MediumRes" ; Medium resolution database
res@mpOutlineSpecifiers = (/"China:states","Taiwan"/)
; mpres@mpOutlineBoundarySets = "NoBoundaries"
res@mpFillAreaSpecifiers = (/"China"/)
res@mpSpecifiedFillColors = (/"White"/)
res@mpUSStateLineColor = "Black"
res@mpGridLineColor = "Black"
res@mpLimbLineColor = "Black"
res@mpPerimLineColor = "Black"
res@mpGeophysicalLineThicknessF = 3.0 ; for Offshore Line thickness
res@mpNationalLineThicknessF = 3.0 ; for National Line thickness
res@mpGridLineThicknessF = 3.0
res@mpLimbLineThicknessF = 3.0
res@mpUSStateLineThicknessF = 3.0 ; for Province Line thickness
;-------------------------------------------------------------------------------
do ifil = 0,numFILES-1
a = addfile(FILES(ifil)+".nc","r") ; Open the next file
lat = a->XLAT(0,:,:)
lon = a->XLONG(0,:,:)
printVarSummary(lat)
dims = dimsizes(lat)
u10 = wrf_user_getvar(a,"U10",-1) ; u at 10 m, mass point
v10 = wrf_user_getvar(a,"V10",-1) ; v at 10 m, mass point
dimU = dimsizes(u10)
lonU = dimU(1)
dimV = dimsizes(v10)
latV = dimV(0)
printVarSummary(u10)
spd = sqrt(u10^2+v10^2)
; copy_VarCoords(u10,spd)
printVarSummary(spd)
printMinMax(spd, True)
spd_avg=dim_avg_n_Wrap(spd,0)
; printVarSummary(spd_avg)
spd_num=spd_num+spd_avg
copy_VarCoords(u10,spd_num)
; printVarSummary(spd_num)
end do
; speed!0 = "lat"
; speed&lat = u10&XLAT
; speed!1 = "lon"
; speed&lon = u10&XLONG
speed = spd_num/numFILES
copy_VarCoords(u10,speed)
printVarSummary(speed)
;---------------------------------------------
; Plotting options for Wind Speed
;---------------------------------------------
res@mpLimitMode = "Corners"
res@mpLeftCornerLatF = lat(0,0)
res@mpLeftCornerLonF = lon(0,0)
res@mpRightCornerLatF = lat(dims(0)-1,dims(1)-1)
res@mpRightCornerLonF = lon(dims(0)-1,dims(1)-1)
res@pmTickMarkDisplayMode = "Always"
opts = res
opts@cnFillOn = True
; opts@pmLabelBarOrthogonalPosF = -0.1
opts@FieldTitle = "Wind Speed at 10 m" ; overwrite Field Title
opts@ContourParameters = (/ 900., 1100., 4. /)
opts@gsnSpreadColorEnd = -3 ; End third from the last color in color map
plot = gsn_csm_contour_map(wks,speed,opts)
end
warning:FieldTitle is not a valid resource in plt_Surface_multi_files_contour at this time
warning:ContourParameters is not a valid resource in plt_Surface_multi_files_contour at this time
warning:Footer is not a valid resource in plt_Surface_multi_files_contour at this time
图画出来不合适,谢谢各位大神了
|
|