- 积分
- 2302
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-3-27
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2016-4-6 18:26:30
|
显示全部楼层
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"
begin
nx=101
ny=51
lx=100
;
ua=new((/nx,ny,3/),"float")
va=new((/nx,ny,3/),"float")
ub=new((/nx,ny,3/),"float")
vb=new((/nx,ny,3/),"float")
yitaa=new((/nx,ny,3/),"float")
yitab=new((/nx,ny,3/),"float")
pi=3.1415926
do n=0,3-1
do j=0,ny-1
do i=0,nx-1
; sigma>0
yitaa(i,j,n)= exp(-1*j*cos(2*pi*(i-1)/lx-2*pi/(n+1)))
ua(i,j,n)= exp(-1*j*cos(2*pi*(i-1)/lx-2*pi/(n+1)))
va(i,j,n)=0
; sigma<0
yitab(i,j,n)=exp(-1*(ny-j)*cos(2*pi*(nx-i)/lx-2*pi/(n+1)))
ub(i,j,n)=-exp(-1*(ny-j)*cos(2*pi*(nx-i)/lx-2*pi/(n+1)))
vb(i,j,n)=0
end do
end do
end do
print(ub)
;=======================plot===========================
wks=gsn_open_wks("pdf","kw") ; open a Graphic wkStation
gsn_define_colormap(wks,"gsdtol")
plotva=new(3,graphic)
plotvb=new(3,graphic)
res=True
res@gsnDraw = False
res@gsnFrame = False
res@vcRefLengthF = 0.045 ; what the ref length is
res@vcGlyphStyle = "CurlyVector" ; turn on curley vectors
res@vcMinDistanceF = 0.02
;plotva = gsn_csm_vector(wks,ua,va,res)
; plotvb = gsn_csm_vector(wks,ub,vb,res)
plotva(0) = gsn_csm_vector(wks,ua(0,:,:),va(0,:,:),res)
plotvb(0) = gsn_csm_vector(wks,ub(0,:,:),vb(0,:,:),res)
plotva(1) = gsn_csm_vector(wks,ua(1,:,:),va(1,:,:),res)
plotvb(1) = gsn_csm_vector(wks,ub(1,:,:),vb(1,:,:),res)
plotva(2) = gsn_csm_vector(wks,ua(2,:,:),va(2,:,:),res)
plotvb(2) = gsn_csm_vector(wks,ub(2,:,:),vb(2,:,:),res)
plotp=new(3,graphic)
resP = True
resP@cnLineLabelsOn= False
resP@gsnDraw = False
resP@gsnFrame = False
resP@cnFillOn = True
resP@pmLabelBarHeightF = 0.05
resP@pmLabelBarWidthF = 0.5
resP@lbOrientation = "Horizontal"
resP1=resP
resP1@tiMainString="Kelvin Wave (Sigma>0) T=1"
resP2=resP
resP2@tiMainString="Kelvin Wave (Sigma>0) T=2"
resP3=resP
resP3@tiMainString="Kelvin Wave (Sigma>0) T=3"
plotp(0) = gsn_contour(wks,yitaa(0,:,:),resP1)
plotp(1) = gsn_contour(wks,yitaa(1,:,:),resP2)
plotp(2) = gsn_contour(wks,yitaa(2,:,:),resP3)
plotp1=new(3,graphic)
resP11=resP
resP11@tiMainString="Kelvin Wave (Sigma<0) T=1"
resP22=resP
resP22@tiMainString="Kelvin Wave (Sigma<0) T=2"
resP33=resP
resP33@tiMainString="Kelvin Wave (Sigma<0) T=3"
plotp1(0) = gsn_contour(wks,yitab(0,:,:),resP11)
plotp1(1) = gsn_contour(wks,yitab(1,:,:),resP22)
plotp1(2) = gsn_contour(wks,yitab(2,:,:),resP33)
;plotp22 = gsn_contour(wks,yita,resP1)
;plotp33 = gsn_contour(wks,yita,resP1)
overlay(plotp(0),plotva(0))
overlay(plotp(1),plotva(1))
overlay(plotp(2),plotva(2))
overlay(plotp1(0),plotvb(0))
overlay(plotp1(1),plotvb(1))
overlay(plotp1(2),plotvb(2))
gsn_panel(wks,(/plotp(0),plotp1(0),plotp(1),plotp1(1),plotp(2),plotp1(2) /),(/3,2/),False)
end
这个就是我的代码 |
|