Dear NCL users,
I am having WRF model outputs which are saved in 1 hourly. So each file
contains only 1 time.
I would like to calcuate "Relative Vorticity" using following script. It is
showing error like:
fatal:Number of dimensions in parameter (2) of (uv2vr_cfd) is (2), (1)
dimensions were expected
fatal:Execute: Error occurred at or near line 44 in file test_vort.ncl
HERE line 44 is: vr = uv2vr_cfd (u_plane,v_plane,lat,lon, 3)
;==========script is here============
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"
begin
datadir = "/WRF/output/"
FILES = systemfunc ("ls -1 " + datadir + "wrfout_d02* " )
numFILES = dimsizes(FILES)
res = True
pltres = True
mpres = True
do ifil = 0,numFILES-1
a = addfile(FILES(ifil)+".nc","r")
times = wrf_user_list_times(a)
plevs = (/ 925., 850./)
nlevels = dimsizes(plevs)
;;;===========================
day = systemfunc("echo "+times +"|cut -c9-10")
yr = systemfunc("echo "+times +"|cut -c1-4")
mon = systemfunc("date '+%b'|tr [a-z] [A-Z]")
hr = systemfunc("echo "+times +"|cut -c12-13")
;;;===========================
u = wrf_user_getvar(a,"ua",0)
v = wrf_user_getvar(a,"va",0)
p = wrf_user_getvar(a, "pressure",0)
lat = wrf_user_getvar(a,"XLAT",0)
lon = wrf_user_getvar(a,"XLONG",0)
do level = 0,nlevels-1 ; LOOP OVER LEVELS
pressure = plevs(level)
u_plane = wrf_user_intrp3d(u,p,"h",pressure,0.,False)
v_plane = wrf_user_intrp3d(v,p,"h",pressure,0.,False)
vr = uv2vr_cfd (u_plane,v_plane,lat,lon, 2)
wks = gsn_open_wks("ps","vort_"+pressure+"hPa"+"_"+day+mon+yr+"_"+hr+"Z")
vort = wrf_contour(a,wks,vr,res)
plot = wrf_map_overlays(a,wks,vort,pltres,mpres)
end do
end do
end
================================
Kindly help me to solve it.
Sahidul
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 14 01:23:40 2010
This archive was generated by hypermail 2.1.8 : Mon Jul 19 2010 - 09:39:01 MDT