- 积分
- 1502
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-4-12
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2014-5-6 15:56:15
|
显示全部楼层
提示一下:下面程序中中间部分读取冰粒子重要目的是获取模式的经纬度范围,为了更好的对比。这些时间和层数其实没有冰粒子的,画不出来的,就是为了获取底图
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"
begin
type = "pdf"
wks = gsn_open_wks(type,"lightning")
gsn_define_colormap(wks,"precip_11lev")
a = addfile("/home/Huanglei/data/d032"+".nc","r")
res = True
res@MainTitle = "REAL-TIME WRF"
mpres = True ; Map resources
mpres@mpOutlineOn = False ; Turn off map outlines
mpres@mpFillOn = False ; Turn off map fill
mpres@mpGridAndLimbOn = True
pltres = True ; Plot resources
pltres@PanelPlot = True ; Tells wrf_map_overlays not to remove overlays
times = wrf_user_getvar(a,"times",-1) ; get all times in the file
ntimes = dimsizes(times) ; number of times in the file
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
it =24 ; TIME LOOP
print("Working on time: " + times(it) )
res@TimeLabel = times(it) ; Set Valid time to use on plots
print(it)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need
if(isfilevar(a,"QICE"))
qi = wrf_user_getvar(a,"QICE",it)
qi = qi*1000.
qi@units = "g/kg"
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
level = 25 ; LOOP OVER LEVELS
opts = res
opts@cnFillOn = True
opts@gsnSpreadColors = False
opts@ContourParameters = (/ 0.02, 0.5, 0.05 /)
opts@gsnDraw = False
opts@gsnFrame = False
if (isvar("qi"))
qis = qi(level,:,:)
contour = wrf_contour(a,wks,qis,opts)
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
delete(contour)
end if
;>============================================================<
; add China map
;>------------------------------------------------------------<
shp_name1 = "/home/Huanglei/map/China/diquJie_polyline.shp"
lnres = True
lnres@gsLineColor = "gray25"
lnres@gsLineThicknessF = 0.5
id = gsn_add_shapefile_polylines(wks,plot,shp_name1,lnres)
shp_name2 = "/home/Huanglei/map/China/cnmap/cnhimap.shp"
prres=True
prres@gsLineThicknessF = 2.0
prres@gsLineColor = "black"
plotcn3 = gsn_add_shapefile_polylines(wks,plot,shp_name2,prres)
draw(plot) ; This will draw the map and the shapefile outlines.
ascii_filename = "/home/Huanglei/data/7241600.txt"
seismic = asciiread(ascii_filename,(/72,3/),"float")
x = seismic(:,0) ; Column 1 of file contains X values.
y = seismic(:,1) ; Column 2 of file contains Y values.
z = seismic(:,2) ; Column 3 of file contains Z values.
txres2 = True
do lt=0, 71
lon=x(lt)
lat=y(lt)
if z(lt).gt.0
str="+"
txres2@txFont = 0.02
txres2@txFontHeightF =0.01
txres2@txFontColor = "Red"
end if
if z(lt).lt.0
str="-"
txres2@txFont = 0.02
txres2@txFontHeightF =0.01
txres2@txFontColor = "Blue"
end if
txdum1 =gsn_add_text(wks, plot, str, lon,lat, txres2)
end do
frame(wks)
;delete(opts)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end |
|