爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4964|回复: 4

ncl运行出错

[复制链接]
发表于 2016-8-4 21:52:11 | 显示全部楼层 |阅读模式

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

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

x
; load functions and procedures
load "/home/fanxiqing/wrf/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "/home/fanxiqing/wrf/ncl/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
; WRF ARW input file (NOTE, your wrfout file does not need
; the .nc, but NCL needs it so make sure to add it in the
; line below)
a = addfile("/home/fanxiqing/wrf/ncl/wrfout_d01_2000-01-24_12:00:00.nc","r")
; Output on screen. Output will be called "plt_Surface1"
type = "x11"
wks = gsn_open_wks(type,"plt_Surface1")
; Set basic resources
res = True
res@MainTitle = "REAL-TIME WRF" ; Give plot a main title
res@Footer = False ; Set Footers off
pltres = True ; Plotting resources
mpres = True ; Map resources
;---------------------------------------------------------------
times = wrf_user_getvar(a,"times",-1)) ; get times in the file
it = 0 ; only interested in first time
res@TimeLabel = times(it) ; keep some time information
;---------------------------------------------------------------
; Get variables
slp = wrf_user_getvar(a,"slp",it) Get slp
wrf_smooth_2d( slp, 3 ) ; Smooth slp
t2 = wrf_user_getvar(a,"T2",it) ; Get T2 (deg K)
tc2 = t2-273.16 ; Convert to deg C
tf2 = 1.8*tc2+32. ; Convert to deg F
tf2@description = "Surface Temperature"
tf2@units = "F"
u10 = wrf_user_getvar(a,"U10",it) ; Get U10
v10 = wrf_user_getvar(a,"V10",it) ; Get V10
u10 = u10*1.94386 ; Convert to knots
v10 = v10*1.94386
u10@units = "kts"
v10@units = "kts"
;---------------------------------------------------------------
; Plotting options for T
opts = res ; Add basic resources
opts@cnFillOn = True ; Shaded plot
opts@ContourParameters = (/ -20., 90., 5./) ; Contour intervals
opts@gsnSpreadColorEnd = -3
contour_tc = wrf_contour(a,wks,tf2,opts) ; Create plot
delete(opts)
; Plotting options for SLP
opts = res ; Add basic resources
opts@cnLineColor = "Blue" ; Set line color
opts@cnHighLabelsOn = True ; Set labels
opts@cnLowLabelsOn = True
opts@ContourParameters = (/ 900.,1100.,4./) ; Contour intervals
contour_psl = wrf_contour(a,wks,slp,opts) ; Create plot
delete(opts)
; Plotting options for Wind Vectors
opts = res ; Add basic resources
opts@FieldTitle = "Winds" ; Overwrite the field title
opts@NumVectors = 47 ; Density of wind barbs
vector = wrf_vector(a,wks,u10,v10,opts) ; Create plot
delete(opts)
; MAKE PLOTS
plot = wrf_map_overlays(a,wks, \
(/contour_tc,contour_psl,vector/),pltres,mpres)
;---------------------------------------------------------------
end


QQ图片20160804215146.png
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-8-4 21:54:14 | 显示全部楼层
哪位大神帮忙看一下可能是哪里出问题,还需要其他的数据我再贴上来
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-8-4 22:02:58 | 显示全部楼层
解决了,都是语法错误,,下回注意,第一次用这个
密码修改失败请联系微信:mofangbao
发表于 2016-8-12 10:23:31 | 显示全部楼层
请问下NCL怎么装啊,我装了两天都装不上
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-10-14 10:15:35 | 显示全部楼层
下载对应版本,解压,设置环境变量,创建.hluresfile文件,测试成功就可以了,具体方法参见官网及各种大神的教程,不要找我要哦
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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