- 积分
- 352
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-4-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
用的资料:欧洲中心erainterim的逐月比湿场(共8层),逐月u场(共8层),逐月v场(共8层),地面气压场。
程序:
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/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/wind_rose.ncl"
begin
********读取u,v,q场**********
f1=addfile("C:/Users/Administrator/Desktop/data1/1987.quv.nc","r")
U=short2flt(f1->u(5,:,:,:))
V=short2flt(f1->v(5,:,:,:))
Q=short2flt(f1->q(5,:,:,:))
f2=addfile("C:/Users/Administrator/Desktop/data1/1987.pre.nc","r")
PS=short2flt(f2->sp(5,:,:))
ps=PS/100
copy_VarMeta(PS,ps)
lat=f1->latitude
lat@units = "degrees_north"
lon=f1->longitude
lon@units= "degrees_east"
qu=new((/8,51,91/),float)
qv=new((/8,51,91/),float)
do iz=0,7
do i=0,50
do j=0,90
qu(iz,i,j)=Q(iz,i,j)*U(iz,i,j)
qv(iz,i,j)=Q(iz,i,j)*V(iz,i,j)
end do
end do
end do
lev=(/1000,925,850,700,600,500,400,300/)
**赋给qu,qv坐标信息**
lat=new(1,float)
lon=new(1,float)
lon!0 = "lon"
lon@units = "degrees_east"
lat!0 = "lat"
lat@units = "degrees_north"
lev!0 = "lev"
lev@units = "hPa"
qu!0 = "lev"
qu!1 = "lat"
qu!2 = "lon"
qu&lon = lon(报错)
qu&lat = lat
qu&lev = lev
qv!0 = "lev"
qv!1 = "lat"
qv!2 = "lon"
qv&lon = lon(报错)
qv&lat = lat
qv&lev = lev
qu1 = qu(lev|:, lat|:, lon|:)
delete(qu1)
qv1 = qv(lev|:, lat|:, lon|:)
delete(qv1)
p = (/1000,925,850,700,600,500,400,300/)
linlog = 2 ; 1为线性积分 2为对数积分
data11 = (vibeta(p,qu1,linlog,PS,1000,300))/9.8 ; 返回的数值是2维的(lat,lon)
data12 = (vibeta(p,qv1,linlog,PS,1000,300))/9.8
mm = new((/51,91/),float)
mm = sqrt(data11^2+data12^2)
mm!0 = "lat"
mm!1 = "lon"
mm&lat = lat
mm&lon = lon
lon!0 = "lon"
lon@units = "degrees_east"
lat!0 = "lat"
lat@units = "degrees_north"
wks =gsn_open_wks("png","C:/Users/Administrator/Desktop/data/shumzong")
gsn_define_colormap(wks,"BlAqGrYeOrReVi200")
res = True
res@gsnAddCyclic=False
res@mpOutlineOn = True ; turn the map outline on
res@gsnDraw = False ; do not draw the plot
res@gsnFrame = False
res@gsnMajorLatSpacing = 5;设置坐标纬度间隔
res@gsnMajorLonSpacing = 10;设置坐标经度间隔
res@mpOutlineOn = False;可以去除海岸线
res@mpOutlineDrawOrder = "PostDraw"
res@mpMaxLatF = 50
res@mpMinLatF = 0
res@mpMaxLonF = 150
res@mpMinLonF = 60
vcres = True
vcres@gsnAddCyclic = False
vcres@gsnDraw = False ; don't draw yet
vcres@gsnFrame = False ; don't advance frame yet
vcres@pmTickMarkDisplayMode = "Always"
vcres@vcMinFracLengthF = 0.33
vcres@vcRefMagnitudeF = 10
vcres@vcRefLengthF = 0.022
vcres@vcGlyphStyle = "CurlyVector" ; tur n on curly vectors
vcres@vcMonoLineArrowColor = False
vcres@vcMinDistanceF = 0.013
vcres@vcLineArrowHeadMaxSizeF = 0.008 ;default = 0.012
vcres@lbLabelBarOn = False
vcres@vcMonoFillArrowFillColor = True
vcres@vcLineArrowThicknessF = 1.0
vcres@vcRefAnnoOn =False
vcres@gsnLeftString =""
vcres@gsnRightString =""
vcres@tiMainString =""
vector = gsn_csm_vector(wks,qu1,qv1,vcres)
res = True
res@gsnDraw = False
res@gsnFrame = False
res@cnFillOn = True ; turn on color
res@gsnSpreadColors = True
res@gsnSpreadColorStart = 0
res@gsnSpreadColorEnd = 199
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnInfoLabelOn = False
res@cnLevelSelectionMode = "Constant"
res@gsnLeftString =" "
res@gsnRightString =" "
res@tiMainString =" "
res@lbLabelBarOn = True
res@lbOrientation = "Vertical" ; vertical label bars
res@lbAutoManage = True
res@lbLabelFontHeightF = 0.009 ; make labels smaller
mm = smth9(mm,0.5,0.25,False)
contour = gsn_csm_contour_map(wks,mm,res)
overlay(contour,vector)
draw(plot)
frame(wks)
end
|
|