爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4353|回复: 1

ncl 属性设置有个小疑问

[复制链接]
发表于 2017-2-26 15:24:57 | 显示全部楼层 |阅读模式

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

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

x
今天画图的时候调皮的设置了一样的属性,反正都是画风场嘛,只是量级不同,我就想着改了一句量级即可,如下
  wks = gsn_open_wks("pdf","qbwoDJFobsU85")                ; open a ps file
  vcres                         = True             ; plot mods desired
  vcres@gsnFrame                = False            ; so we can draw time stamp
  vcres@gsnAddCyclic            = False
  vcres@mpMinLonF              =60
  vcres@mpMaxLonF              =160
  vcres@mpMinLatF              =-30
  vcres@mpMaxLatF              =30
  vcres@mpCenterLonF              =110
  vcres@vcRefAnnoOrthogonalPosF = -1.0             ; move ref vector up
  vcres@vcRefMagnitudeF         = 0.1             ; define vector ref mag
  vcres@vcRefLengthF            = 0.06            ; define length of vec ref
  vcres@vcGlyphStyle            = "CurlyVector"    ; turn on curly vectors
  vcres@vcMinDistanceF          = 0.017
  vector = gsn_csm_vector_map(wks,TEST(0,:,:),TEST(1,:,:),vcres)
  wks = gsn_open_wks("pdf","qbwoMAMobsU85")                ; open a ps file
vector = gsn_csm_vector_map(wks,test(0,:,:),test(1,:,:),vcres)


然后就一直提示错误:  fatal:Variable (vcres) is undefined, can not assign attribute (vcRefMagnitudeF)
                                  fatal:["Execute.c":8575]:Execute: Error occurred at or near line 86 in file 01.ncl


我查了第86行,发现是这家伙    vcres@vcRefMagnitudeF         = 0.1             ; define vector ref mag
我思考了一会觉得,是不是我前面有这段
  wks = gsn_open_wks("pdf","20010101obsUV85")                ; open a ps file
  vcres                         = True             ; plot mods desired
  vcres@gsnFrame                = False            ; so we can draw time stamp
  vcres@gsnAddCyclic            = False
  vcres@mpMinLonF              =60
  vcres@mpMaxLonF              =160
  vcres@mpMinLatF              =-30
  vcres@mpMaxLatF              =30
  vcres@mpCenterLonF              =110
  vcres@vcRefAnnoOrthogonalPosF = -1.0             ; move ref vector up
  vcres@vcRefMagnitudeF         = 10             ; define vector ref mag
  vcres@vcRefLengthF            = 0.045            ; define length of vec ref
  vcres@vcGlyphStyle            = "CurlyVector"    ; turn on curly vectors
  vcres@vcMinDistanceF          = 0.017
  vector = gsn_csm_vector_map(wks,wind(396,0,::2,::2),wind(396,1,::2,::2),vcres);;it's ok
  wks = gsn_open_wks("pdf","obsUV85JJA")   
  vector = gsn_csm_vector_map(wks,u850_summer,v850_summer,vcres);;it's ok
导致后面还用这个时候出错?但没道理呀。。。于是我就将提示错误的那段统统改为vcres1,然后就可以了。。。请问各位大侠,这是啥子情况。。。多谢!

密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-26 12:37:03 | 显示全部楼层
将属性重新delete就可以重复使用了,可能在ncl里头变量的规格定下来以后就不能乱改,除非删除自带属性
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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