爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5532|回复: 6

ncl没有报错,却一直运行

[复制链接]
发表于 2016-4-6 08:06:15 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
请问大家有没有遇到过这样的情况,在运行的时候,ncl程序没有报错,可是程序却一直运行,没有结束
想请问大家,这个是怎么回事?
密码修改失败请联系微信:mofangbao
发表于 2016-4-6 08:48:48 | 显示全部楼层
起码给张图之类的东西
密码修改失败请联系微信:mofangbao
发表于 2016-4-6 09:34:01 | 显示全部楼层
死循环啦        
密码修改失败请联系微信:mofangbao
发表于 2016-4-6 15:18:08 | 显示全部楼层
是不是循环太多太大了  我之前就遇到过,把循环改小了就出来结果了
密码修改失败请联系微信:mofangbao
 楼主| 发表于 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

这个就是我的代码
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-4-6 18:26:57 | 显示全部楼层
zhangqh 发表于 2016-4-6 15:18
是不是循环太多太大了  我之前就遇到过,把循环改小了就出来结果了

我之前也在想是不是循环的问题,后来我把循环去掉,还是这样的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-4-6 18:27:20 | 显示全部楼层
zhangqh 发表于 2016-4-6 15:18
是不是循环太多太大了  我之前就遇到过,把循环改小了就出来结果了

我之前也在想是不是循环的问题,后来我把循环去掉,还是这样的
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表