爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 10851|回复: 5

为什么ncl 画气候平均风场 空白

[复制链接]

新浪微博达人勋

发表于 2017-9-27 08:39:35 | 显示全部楼层 |阅读模式
NCL
系统平台: ncl
问题截图: -
问题概况: 计算风场的冬季平均,再画矢量图。为啥我的图是空白呢?请各位大神指教!
我看过提问的智慧: 看过
自己思考时长(天): 1

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

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

x
脚本如下:
begin

  yrStrt = 1980
  yrLast = 2011
  season = "JFM"    ; choose Dec-Jan-Feb seasonal mean


  f      = addfile ("/disk_raid5/data/NCEP2-2.5/monthly/pressure/uwnd.mon.mean.nc", "r")
  TIME   = f->time
  YYYY   = cd_calendar(TIME,-1)/100                 ; entire file
  iYYYY  = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)
  uwnd   = short2flt(f->uwnd(11:394,7,0:36,:))           ;

  UWND         = month_to_season (uwnd, season)
  nyrs        = dimsizes(UWND&time)

  time  = TIME(11:394)
  lat=f->lat(0:36)
  lon   = f->lon
  level = f->level
; calculate climatology  
  UWND_cli = dim_avg_n_Wrap(UWND, 0)


ff      = addfile ("/disk_raid5/data/NCEP2-2.5/monthly/pressure/vwnd.mon.mean.nc", "r")
TIME2   = ff->time
YYYY2   = cd_calendar(TIME2,-1)/100                 ; entire file
iYYYY2  = ind(YYYY2.ge.yrStrt .and. YYYY2.le.yrLast)
vwnd   = short2flt(ff->vwnd(11:394,7,0:36,:))           ;VWND         = month_to_season (vwnd, season)
VWND         = month_to_season (vwnd, season)
nyrs        = dimsizes(VWND&time)
time  = TIME(11:394)
lat=ff->lat(0:36)
lon   = ff->lon
level = ff->level
; calculate climatology
VWND_cli = dim_avg_n_Wrap(VWND, 0)


wks = gsn_open_wks("ps","UV300")
gsn_define_colormap(wks,"temp_diff_18lev")       ; choose colormap
  
  
res2 = True
res2@gsnDraw=False
res2@gsnFrame=False

res2@vcRefMagnitudeF         = 2.5             ; define vector ref mag
res2@vcRefLengthF            = 0.05            ; define length of vec ref
res2@vcGlyphStyle            = "LineArrow"    ; turn on curly vectors
res2@vcMinDistanceF          = 0.025

res2@vcRefAnnoFontHeightF    = 0.015
res2@vcRefAnnoSide    = "Top"

res2@vcRefAnnoPerimOn    = False

res2@vcRefAnnoString1  = "2.5m/s"
res2@vcRefAnnoString2On  = False
res2@vcRefAnnoOrthogonalPosF   =  -0.16

plot  =gsn_csm_vector(wks,UWND_cli,VWND_cli,res2); panel plot only resources


  
  
end

运行没有报错,请各位大神看看哪里出问题啦



密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-9-27 09:11:26 | 显示全部楼层
最后在end前加两句
draw(plot)
frame(wks)
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-9-27 10:52:33 | 显示全部楼层
songwei 发表于 2017-9-27 09:11
最后在end前加两句
draw(plot)
frame(wks)

我加了之后,就报错:
fatal:VectorPlotDraw: VVECTR - VECTOR NDC LENGTH TOO GREAT
fatal:VectorPlotDraw: error drawing vectors
fatal:VectorPlotDraw: draw error
fatal:PlotManagerDraw: error in plot draw
fatal:_NhlPlotManagerDraw: Draw error
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-9-27 10:56:51 | 显示全部楼层
songwei 发表于 2017-9-27 09:11
最后在end前加两句
draw(plot)
frame(wks)

而且还是空白..
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-9-27 18:36:03 | 显示全部楼层

看看第几行出错
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-9-29 12:39:01 | 显示全部楼层
songwei 发表于 2017-9-27 18:36
看看第几行出错

画出来了,我把res2@gsnDraw=False
res2@gsnFrame=False 注释掉;又把参考值改了一下就好了。谢谢~
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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