- 积分
- 121
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-2-8
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 小诸葛 于 2012-3-1 15:11 编辑
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
files = systemfunc ("ls ../../wrfout_d01*")
f = addfiles (files + ".nc" , "r") ;多个文件读取
f = addfile("../../*.nc","r") ;单个文件读取
wks = gsn_open_wks(“x11”,"wrfout_wind")
res = True
res@MainTitle = " WRF RESULT--WIND "
res@tiXAxisString = " Latitude "
res@tiYAxisString = " Longitude "
pltres = True
mpres = True
times = wrf_user_list_times(f) ; get times in the file
ntimes = dimsizes(times) ; number of times in the file
do it = 0,ntimes-1
u = wrf_user_getvar(f,"ua",it) ; u averaged to mass points
v = wrf_user_getvar(f,"va",it) ; v averaged to mass points
end do
uu = dim_avg_n(u,0)
vv = dim_avg_n(v,0)
spd = sqrt(uu*uu + vv*vv) ; speed in m/sec
wrf_smooth_2d( spd, 3) ; smooth speed
spd@description = "Wind Speed"
spd@units = "m/s"
opts = res
opts@ContourParameters = (/ 1., 12., 1. /)
opts@cnFillOn = True
opts@cnLevelSelectionMode ="ManualLevels"
gsn_define_colormap(wks,"BlAqGrYeOrReVi200")
opts@cnLabelMasking = True
contour = wrf_contour(f,wks,spd(:,:),opts)
delete(opts)
end
当读取单个文件的时候没有问题,但是当读取多个文件的时候会提示:fatal:Argument type mismatch on argument (0) of (wrf_contour) can not coerce,,错误在contour = wrf_contour(f,wks,spd(:,:),opts)这一行,查询了下解决办法:http://www.ncl.ucar.edu/Support/talk_archives/2011/2451.html,建议将contour = wrf_contour(f,wks,spd(:,:),opts)改为contour = wrf_contour(f(0),wks,spd(:,:),opts),但是还是提示同样的错误,大家有谁遇到过同样的问题或者哪位达人帮忙解决下,不胜感激!
|
|