爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 9440|回复: 5

[其他] 【求助】NCL官网例子overlay_12运行出错

[复制链接]

新浪微博达人勋

发表于 2016-10-10 10:04:51 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 xuebiz 于 2016-10-10 10:06 编辑

overlay功能例子中
http://www.ncl.ucar.edu/Applications/Scripts/overlay_12.ncl

数据在官网下了,是wrfout_d01_2003-07-15_00_00_00.txt,用ncdump可以打开开内容,也改名了.nc和无后缀都不行。。。
想不通。。。
---------------------------------------------------------------------------------
文件名为wrfout_d01_2003-07-15_00_00_00.nc时,运行及输出:
#ncl test-overlay_12.ncl
Copyright (C) 1995-2014 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.2.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
fatal:["FileSupport.c":3605]:_NclFindFileExt: Requested file <wrfout_d01_2003-07-15_00:00:00.nc> or <wrfout_d01_2003-07-15_00:00:00> does not exist

fatal:["FileSupport.c":3973]:(wrfout_d01_2003-07-15_00:00:00.nc) has no file extension, can't determine type of file to open
fatal:file (a) isn't defined
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 30 in file test-overlay_12.ncl

--------------------------------------------------------------------------------
文件名为wrfout_d01_2003-07-15_00_00_00时,运行及输出:
$ ncl test-overlay_12.ncl
Copyright (C) 1995-2014 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.2.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
fatal:["FileSupport.c":3973]:(wrfout_d01_2003-07-15_00:00:00) has no file extension, can't determine type of file to open
fatal:file (a) isn't defined
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 30 in file test-overlay_12.ncl

-----------------------------------------------------------------------------------
文件名为wrfout_d01_2003-07-15_00_00_00.txt时,运行及输出:
$ ncl test-overlay_12.ncl
Copyright (C) 1995-2014 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.2.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
fatal:["FileSupport.c":3605]:_NclFindFileExt: Requested file <wrfout_d01_2003-07-15_00:00:00.txt> or <wrfout_d01_2003-07-15_00:00:00> does not exist

fatal:["FileSupport.c":3973]:(wrfout_d01_2003-07-15_00:00:00.txt) has no file extension, can't determine type of file to open
fatal:file (a) isn't defined
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 30 in file test-overlay_12.ncl

-----------------------------------------------------------------------------------
代码第25行起部分如下:
begin
;---Open file. You may need to include ".nc" at the end.
a = addfile("wrfout_d01_2003-07-15_00:00:00.nc","r")

;---Read variables directly (can also use "wrf_user_getvar")
hgt = a->HGT(0,:,:)                 ; terrain, 0 is the first time step
lat = a->XLAT(0,:,:)                ; latitude
lon = a->XLONG(0,:,:)               ; longitude
znu = a->ZNU                        ; eta values
dbz = wrf_user_getvar(a,"dbz",0)    ; reflectivity

nlev = 1
print("Plotting at level " + znu(0,nlev))

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

新浪微博达人勋

 楼主| 发表于 2016-10-10 16:05:58 | 显示全部楼层
up
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2016-10-11 00:48:16 | 显示全部楼层
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-10-12 13:43:50 | 显示全部楼层
读数据文件这个问题搞定了,是win系统的问题,我直接用linux系统下的数据文件就ok,用win系统下载的就不能读。。。之前别的同事也遇到过,个别数据会这样,
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-10-12 13:44:43 | 显示全部楼层
不过程序又开始报其他的错。。。
let me see see。。。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-10-12 14:00:12 | 显示全部楼层
报错,关于“wrf_user_getvar”,查了下,把这两行放出来了
  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

然后报错。。。一大片。。。

$ ncl test-overlay_12.ncl
Copyright (C) 1995-2014 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.2.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
(0)     Plotting at level 0
(0)     ------------------------------------------
(0)     Terrain Height: min=0   max=0
(0)     Reflectivity: min=-30   max=-30
warning:ContourPlotInitialize: scalar field is constant; no contour lines will appear; use cnConstFEnableFill to enable fill
warning:ContourPlotInitialize: X coordinates out of data range: defaulting
warning:ContourPlotInitialize: Zero X coordinate span: defaulting:[errno=1104]
warning:ContourPlotInitialize: Y coordinates out of data range: defaulting
warning:ContourPlotInitialize: Zero Y coordinate span: defaulting:[errno=1104]
warning:ContourPlotInitialize: current transformation requires trXMaxF to be within data coordinate range: resetting
warning:ContourPlotInitialize: current transformation requires trYMaxF to be within data coordinate range: resetting
warning:TransInitialize: Zero X coordinate span: defaulting:[errno=1104]
warning:TransInitialize: Zero Y coordinate span: defaulting:[errno=1104]
warning:SpTransInitialize: X maximum greater than maximum value of coordinate points array, defaulting
warning:SpTransInitialize: Y maximum greater than maximum value of coordinate points array, defaulting
warning:ContourPlotSetValues: Data values out of range of levels set by EXPLICITLEVELS mode
warning:ContourPlotSetValues: X coordinates out of data range: defaulting
warning:ContourPlotSetValues: Zero X coordinate span: defaulting:[errno=1104]
warning:ContourPlotSetValues: Y coordinates out of data range: defaulting
warning:ContourPlotSetValues: Zero Y coordinate span: defaulting:[errno=1104]
warning:ContourPlotSetValues: current transformation requires trXMaxF to be within data coordinate range: resetting
warning:ContourPlotSetValues: current transformation requires trYMaxF to be within data coordinate range: resetting
(0)     gsn_csm_map_ce: Fatal: The resources mpMinLonF/mpLeftCornerLonF must be less than the resources mpMaxLonF/mpRightCornerLonF.
(0)     Execution halted.

有点儿懵
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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