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

楼主 |
发表于 2015-9-15 16:45:04
|
显示全部楼层
这个是ncl画的
; Example script to produce plots for a WRF real-data run,
; with the ARW coordinate dynamics option.
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/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.
a = addfile("/public/home/huanglei/wrfdata/wrfout_d03_2015-05-01_12:00:00.nc","r")
ij = wrf_user_ll_to_ij(a, 108.58,34.26,True)
print("lon location is: " +ij(0))
print("lat location is: " + ij(1))
; First get the variables we will need
u10_2=new((/31,24/),float,"No_FillValue")
v10_2=new((/31,24/),float,"No_FillValue")
filename1=systemfunc("ls /public/home/huanglei/wrfdata/wrfout_d03_2015-05*.nc")
fin1=addfiles(filename1,"r")
do i=0,30
u10_1=fin1->U10(0:23,ij(1)-1, ij(0)-1)
v10_1=fin1->V10(0:23,ij(1)-1, ij(0)-1)
u10_2 (i,:)= u10_1
v10_2 (i,:)= v10_1
end do
u10=ndtooned(u10_2)
v10=ndtooned(v10_2)
u10_d=u10(0:724)
v10_d=v10(0:724)
;;;;;;;;;;;;;;;get obs data;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ascii_filename = "/public/home/huanglei/obs.txt"
seismic = asciiread(ascii_filename,(/725,6/),"float")
seismic@_FillValue = -999
wdir = seismic(:,4)
wspd = seismic(:,5)
rad = 4.0*atan(1.0)/180.
u_o = wspd*sin(rad*wdir)
v_o = wspd*cos(rad*wdir)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
u10_new=new((/100,725/),float)
u10_new=0
u10_new(50,:)=u10_d(0:724)
u10_new(70,:)=u_o(0:724)
v10_new=new((/100,725/),float)
v10_new=0
v10_new(50,:)=v10_d(0:724)
v10_new(70,:)=v_o(0:724)
wks = gsn_open_wks("pdf","gsn_vector") ; open a Graphic wkStation
res = True ; plot mods desired
; res@tiMainString = "Basic Vector Plot"
res@vcRefMagnitudeF = 5.0 ; add a reference vector
res@vcRefLengthF = 0.045 ; what the ref length is
res@vcGlyphStyle = "CurlyVector" ; turn on curley vectors
res@gsnMaximize = True
res@vpHeightF = 0.4
res@vpWidthF = 0.99
res@vcRefMagnitudeF = 0.15
res@vcRefLengthF = 0.001
res@wkPaperSize = "E"
;;;;;;;; set X axis
res@tmXBMode ="Explicit"
res@tmXBValues =(/1,100,220,340,460,580,700/)
res@tmXBLabels = (/"5/1"," 5/5"," 5/10"," 5/15","5/20", \
" 5/25"," 5/30"/)
res@gsnLeftString ="(a)Wind"
res@pmLegendWidthF = 0.10 ; Change width and
res@pmLegendHeightF = 0.10 ; height of legend.
res@lgLabelFontHeightF = 0.02 ; change font height
plot = gsn_vector(wks,u10_new,v10_new,res)
end |
|