爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 12099|回复: 3

[作图] 用脚本分析10m高空风,但是出不了图,求大佬解释

[复制链接]
发表于 2021-3-29 20:08:51 | 显示全部楼层 |阅读模式

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

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

x
脚本如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
a = addfile("/home/hui/Desktop/wrfout_d0*.nc","r")
type = "pdf"
wks = gsn_open_wks(type,"case")
res = True
res@MainTitie = "REAL-TIME WRF"
res@Footer = False
pltres = True
mpres = True
;times = wrf_user_getvar(a,"times",-1)
;ntimes = dimsizes(times)
;it = 0
;res@TimeLabel = times(it)
;slp = wrf_user_getvar(a,"slp",it)
;wrf_smooth_2d(slp,3)
;t2 = wrf_user_getvar(a,"T2",it)
;tc2 = t2-273.16
;tf2 = 1.8*tc2+32
;tf2@description = "Surface Temperature"
;tf2@units = "F"
  FirstTime = True
  times  = wrf_user_list_times(a)  ; get times in the file
  ntimes = dimsizes(times)         ; number of times in the file
  it=6
  print("Working on time: " + times(it) )
  
u10 = wrf_user_getvar(a,"U10",it)
v10 = wrf_user_getvar(a,"V10",it)
u10 = u10*1.94386
v10 = v10*1.94386
u10@units = "kts"
v10@units = "kts"
WindVeo = sqrt(u10*u10+v10*v10)

opts = res
opts@cnFillOn = True
opts@ContourParameters=(/0.,12.,5./)
opts@gsnSpreadColorEnd = -3
contour_WindVeo = wrf_contour(a,wks,WindVeo,opts)
delete(opts)

;opts = res
;opts@cnFillOn = True
;opts@ContourParameters=(/-20.,90.,5./)
;opts@gsnSpreadColorEnd = -3
;contour_tc = wrf_contour(a,wks,tf2,opts)
;delete(opts)
;opts = res
;opts@cnLineColor = "Blue"
;opts@cnHighLabelsOn = True
;opts@ContourParameters = (/900.,1100.,4./)
;contour_psl = wrf_contour(a,wks,slp,opts)
;delete(opts)
opts = res
opts@FieldTitle = "Winds"
opts@NumVectors = 47
vector = wrf_vector(a,wks,u10,v10,opts)
delete(opts)
;plot = wrf_map_overlays(a,wks,(/contour_tc,contour_psl,vector/),pltres,mpres)
plot = wrf_map_overlays(a,wks,(/contour_WindVeo,vector/),pltres,mpres)

end



错误提示:
fatal:["FileSupport.c":3731]:_NclFindFileExt: Requested file </home/hui/Desktop/wrfout_d0*.nc> or </home/hui/Desktop/wrfout_d0*> does not exist

fatal:["FileSupport.c":4159]:(/home/hui/Desktop/wrfout_d0*.nc) has no file extension, can't determine type of file to open
fatal:file (nc_file) isn't defined
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 2429 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl

fatal:["Execute.c":8575]:Execute: Error occurred at or near line 24 in file 10mfengsu.ncl
密码修改失败请联系微信:mofangbao
发表于 2021-3-29 22:31:42 | 显示全部楼层
提示了说文件路径不存在呀
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-3-29 22:42:24 | 显示全部楼层
但是,那个文件路径核实了好几遍,没错啊
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2021-3-30 09:24:01 | 显示全部楼层
addfile需要打开确定的【文件路径+文件名】
或者先
filename = systemfunc("ls /home/hui/Desktop/wrfout_d0*.nc")  
f = addfiles(filename ,"r")
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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