爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7871|回复: 7

请大家帮我看一下,总是报错呢

[复制链接]
发表于 2014-8-13 11:18:40 | 显示全部楼层 |阅读模式

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

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

x
数据描述:
float UGRD_P0_L102_GLL0 ( lv_AMSL1, lat_0, lon_0 )
         center :       US National Weather Service - NCEP (WMC)
         production_status :    Operational products
         long_name :    U-component of wind
         units :        m s-1
         _FillValue :   1e+20
         grid_type :    Latitude/longitude
         parameter_discipline_and_category :    Meteorological products, Momentum
         parameter_template_discipline_category_number :        ( 0, 0, 2, 2 )
         level_type :   Specific altitude above mean sea level (m)
         forecast_time :        0
         forecast_time_units :  hours
         initial_time : 04/11/2011 (00:00)
float GPA_P0_L100_GLL0 ( lv_ISBL6, lat_0, lon_0 )
         center :       US National Weather Service - NCEP (WMC)
         production_status :    Operational products
         long_name :    Geopotential height anomaly
         units :        gpm
         _FillValue :   1e+20
         grid_type :    Latitude/longitude
         parameter_discipline_and_category :    Meteorological products, Mass
         parameter_template_discipline_category_number :        ( 0, 0, 3, 9 )
         level_type :   Isobaric surface (Pa)
         forecast_time :        0
         forecast_time_units :  hours
         initial_time : 04/11/2011 (00:00)
float PWAT_P0_L200_GLL0 ( lat_0, lon_0 )
         center :       US National Weather Service - NCEP (WMC)
         production_status :    Operational products
         long_name :    Precipitable water
         units :        kg m-2
         _FillValue :   1e+20
         grid_type :    Latitude/longitude
         parameter_discipline_and_category :    Meteorological products, Moisture
         parameter_template_discipline_category_number :        ( 0, 0, 1, 3 )
         level_type :   Entire atmosphere (considered as a single layer)
         level :         0
         forecast_time :        0
         forecast_time_units :  hours
         initial_time : 04/11/2011 (00:00)
代码:
1 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
  3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  5 begin
  6 ;read the data
  7  diri = "/home/liuzhe/fnl_data/"
  8  fils = systemfunc("ls "+diri + "fnl_20110411*.grib2")
  9  f = addfiles(fils,"r")
10  ListSetType(f ,"join")
11  u = f[:]->UGRD_P0_L100_GLL0
12  v = f[:]->VGRD_P0_L100_GLL0
13  r = f[:]->PWAT_P0_L200_GLL0
14  u1 = dim_avg_n_Wrap(u(:,{72500},:,:) ,0)
15  v1 = dim_avg_n_Wrap(v(:,{72500},:,:),0)
16  r1 = dim_sum_n_Wrap(r ,0)
17  wks = gsn_open_wks("ps","wind and rain")
18  gsn_define_colormap(wks ,"gui_default")
19  res = True
20  res@mpLimtiMode = "LatLon"
21  res@mpMinLatF = 35
22  res@mpMaxLatF = 38
23  res@mpMinLonF =138
24  res@mpMaxLonF =142
25  res@mpTickMarkDisplayMode = "always"
26  res@mpFillOn = "Fasle"
27  res@mpOutlineDrawOrder = "PostDraw"
28  res@mpOutlineBoundarySets ="GeophysicalAndUSStates"
29  res@tfDoNDCoverlay = True
30  res@gsnAddCyclic = False
31  res@vcRefMagnitudeF = 10.0
32  res@vcRefLengthG = 0.045
33  res@vcGlyphStyle = "CurlyVector"
34  res@vcMinDistanceF = 0.017
35  res@vcRefAnnoOrthogonalPosF =.1
36  res@gsnScalarContour = True
37  plot= gsn_csm_vector_scalar_map(wks,u1,v1,r1,res)
38 end
报的错误:
warning:tfDoNDCoverlay is not a valid resource in wind and rain_contour at this time
warning:tfDoNDCoverlay is not a valid resource in wind and rain_vector at this time
warning:vcRefLengthG is not a valid resource in wind and rain_vector at this time
fatal:Not: operation not supported on type (string)
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 5775 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 9760 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 10638 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 37 in file rainAndWind-411.ncl

密码修改失败请联系微信:mofangbao
发表于 2014-8-13 11:28:11 | 显示全部楼层
本帖最后由 longlivehj 于 2014-8-13 12:13 编辑

注意拼写,大小写!

25  res@mpTickMarkDisplayMode = "always"
是pmTickMarkDisplayMode="Always"

26  res@mpFillOn = "Fasle"
不但拼写错误,还加了引号

29  res@tfDoNDCoverlay = True
是tfDoNDCOverlay

32  res@vcRefLengthG = 0.045
是vcRefLengthF
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-13 12:24:13 | 显示全部楼层
longlivehj 发表于 2014-8-13 11:28
注意拼写,大小写!

25  res@mpTickMarkDisplayMode = "always"

师傅,我总是反着小毛病,有什么技巧可以规避这些小毛病吗?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-13 12:26:58 | 显示全部楼层
longlivehj 发表于 2014-8-13 11:28
注意拼写,大小写!

25  res@mpTickMarkDisplayMode = "always"

师傅,我都修改了,可是还是报错warning:tfDoNDCoverlay is not a valid resource in wind and rain_contour at this time
warning:tfDoNDCoverlay is not a valid resource in wind and rain_vector at this time
warning:vcRefLengthG is not a valid resource in wind and rain_vector at this time
fatal:Not: operation not supported on type (string)
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 5775 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl

fatal:["Execute.c":8128]:Execute: Error occurred at or near line 9760 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl

fatal:["Execute.c":8128]:Execute: Error occurred at or near line 10638 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl

fatal:["Execute.c":8128]:Execute: Error occurred at or near line 37 in file rainAndWind-411.ncl
总是说引用函数那有问题
密码修改失败请联系微信:mofangbao
发表于 2014-8-13 13:34:45 | 显示全部楼层
一楼不是给你说了嘛,不是tfDoNDCoverlay,是tfDoNDCOverlay,你没改全吧,O大写诶
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-13 14:34:11 | 显示全部楼层
苏拉苏拉 发表于 2014-8-13 13:34
一楼不是给你说了嘛,不是tfDoNDCoverlay,是tfDoNDCOverlay,你没改全吧,O大写诶

全改了,还是报的错误好像是什么引用函数库的原因!
密码修改失败请联系微信:mofangbao
发表于 2014-8-13 15:29:50 | 显示全部楼层
刘哲 发表于 2014-8-13 12:26
师傅,我都修改了,可是还是报错warning:tfDoNDCoverlay is not a valid resource in wind and rain_cont ...

错误信息一样的啊?你确定全部改过来了?
密码修改失败请联系微信:mofangbao
发表于 2014-8-13 15:39:00 | 显示全部楼层
刘哲 发表于 2014-8-13 12:24
师傅,我总是反着小毛病,有什么技巧可以规避这些小毛病吗?

这个大家都会有,细心一点,根据错误提示查找原因。
http://www.ncl.ucar.edu/Applications/editor.shtml
在上面的链接中找找,有没有适用于你的。在编写脚本时,这些插件会有一定的辅助作用。
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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