爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7658|回复: 8

求助,,NCL 画WRF结果中的地面长波

[复制链接]
发表于 2014-4-4 16:14:19 | 显示全部楼层 |阅读模式

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

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

x
这是我的代码,总是第27行有错误,请各位大神指点
;   Example script to plot a field from a single metgrid file
  2 ;   November 2008
  3
  4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  5 load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
  6
  7 begin
  8 ;
  9   a = addfile("wrfout.d01.2011_03_19_00:00:00.nc","r")  ; Open a file
10
11
12 ; We generate plots, but what kind do we prefer?
13   type = "x11"
14 ; type = "pdf"
15 ; type = "ps"
16 ; type = "ncgm"
17   wks = gsn_open_wks(type,"plt_landflux_1")
18   
19
20   res = True                           ; Set up some basic plot resources
21   res@MainTitle = "GROUND LONG WAVELENTH"
22   res@Footer = False
pltres = True
25   mpres = True
26
27   glw    = wrf_user_getvar(a,"GLW",0)
28
29
30
31     opts = res                                ; Set some plotting resources
32     opts@cnFillOn = True
33     opts@ContourParameters = (/ 10. /)
34
35     contour = wrf_contour(a,wks,glw,opts)
36     delete(opts)
37     plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
38
39 end


密码修改失败请联系微信:mofangbao
发表于 2014-4-4 22:09:56 | 显示全部楼层
我执行你的代码,27行没有问题啊!
提示的什么错误?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-4-5 09:25:39 | 显示全部楼层
longlivehj 发表于 2014-4-4 22:09
我执行你的代码,27行没有问题啊!
提示的什么错误?

fatal:Number of dimensions in parameter (2) of (wrf_contour) is (3), (2) dimensions were expected
我这次用的是a->LH读取数据,结果到了 contour = wrf_contour(a,wks,v,opts),就提示错误阿
密码修改失败请联系微信:mofangbao
发表于 2014-4-5 19:09:26 | 显示全部楼层
无敌泡 发表于 2014-4-5 09:25
fatal:Number of dimensions in parameter (2) of (wrf_contour) is (3), (2) dimensions were expected
...

直接a->LH得到的数组是3维的,当然会出现错误啊!
wrf_user_getvar第三个参数为0,是获取第一个时次的数据,所以得到的数组是2维,是可以出图的。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-4-6 09:02:08 | 显示全部楼层
longlivehj 发表于 2014-4-5 19:09
直接a->LH得到的数组是3维的,当然会出现错误啊!
wrf_user_getvar第三个参数为0,是获取第一个时次的数 ...

谢谢您,现在出来新的错误了,warning:ContourPlotInitialize: scalar field is constant; ContourPlot not possible:[errno=1102]
是说我的数值设置的不对,我看他们全球例子中也是(-300,300,10),这个数值我该怎么确定呢?
谢谢
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-4-6 09:07:08 | 显示全部楼层
longlivehj 发表于 2014-4-5 19:09
直接a->LH得到的数组是3维的,当然会出现错误啊!
wrf_user_getvar第三个参数为0,是获取第一个时次的数 ...

就是出来的图,只有底图,,
密码修改失败请联系微信:mofangbao
发表于 2014-4-6 10:21:52 | 显示全部楼层
无敌泡 发表于 2014-4-6 09:07
就是出来的图,只有底图,,

取其它时次看看,就是wrf_user_getvar的第三个参数不要取0,取1,2……看看呢!
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-4-6 10:32:04 | 显示全部楼层
longlivehj 发表于 2014-4-6 10:21
取其它时次看看,就是wrf_user_getvar的第三个参数不要取0,取1,2……看看呢!

我太爱你了!!!谢谢!!!
密码修改失败请联系微信:mofangbao
发表于 2014-4-16 10:24:25 | 显示全部楼层
好东西必须顶
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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