[Wrf-users] WRF vertical profile in NCL
Joseph Brodie
jbrodie at udel.edu
Mon Aug 27 08:16:30 MDT 2012
Hi all,
I'm trying to get a lower atmosphere vertical profile from some WRF output
data I have (I only want the first 200 meters of the atmosphere) and for
some reason, when I use the wrf_user_intrp3d function, and then plot the
data, it removes the lowest 100 m of the atmosphere from the data! I know
there is data there, because I have model layers starting as low as 8m, and
if I plot horizontal data, I have no problem getting the data from the
layers below 100 m. Has anyone else experienced this? Any guidance would
be appreciated! The code is below.
Cheers,
Joe Brodie
-------- NCL CODE
; WRF windfarm output processesing - VERTICAL CROSS SECTION
; J. F. Brodie
; University of Delaware
; 8 August 2012
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
a = addfile("wrfout_farm1_newlays.nc","r")
; a = addfile("wrfout_d01_0001-01-03_00:00:00.nc","r")
type = "x11" ; X11 visual output
; type = "pdf" ; PDF output
plane = (/ 17.0, 17.0/) ; x,y coordinate for vertical cross
angle = 90.0 ; 90 degrees = W-E cross section
FirstTime = True
wks = gsn_open_wks(type,"WRF_AWEA_farm1")
gsn_define_colormap(wks,"precip3_16lev")
gsn_reverse_colormap(wks)
; plot options
res = True
res at MainTitle = "WRF WINDFARM - AWEA"
pltres = True
height = 200. ; maximum height I would like displayed, meters
; let's get all the times
times = wrf_user_getvar(a,"times",-1)
ntimes = dimsizes(times)
do it = 0,ntimes-1,1
print("Working on time " + times(it) )
res at TimeLabel = times(it)
u = wrf_user_getvar(a,"ua",it)
v = wrf_user_getvar(a,"va",it) ; U and V velocities averaged to mass pts
z = wrf_user_getvar(a, "z",it) ; grid point height
if ( FirstTime ) then
zz = wrf_user_intrp3d(z,z,"v",plane,angle,False)
b = ind(zz(:,0) .gt. height )
zmax_pos = b(0) - 1
if ( abs(zz(zmax_pos,0)-height) .lt. abs(zz(zmax_pos+1,0)-height) )
then
zspan = b(0) - 1
else
zspan = b(0)
end if
delete(zz)
delete(b)
FirstTime = False
end if
u_plane = wrf_user_intrp3d(u,z,"v",plane,angle,False)
v_plane = wrf_user_intrp3d(v,z,"v",plane,angle,False)
u_plane at units = "m/s"
v_plane at units = "m/s"
spd = (u_plane*u_plane + v_plane*v_plane)^(0.5) ; convert to speed
spd at description = "Wind Speed"
spd at units = "m/s"
; contour of speed
opts = res
opts at cnFillOn = True
opts at trYMinF = 0
opts at trYMaxF = zspan
; contour = wrf_contour(a,wks,u_plane(0:zmax_pos,:),opts)
contour = wrf_contour(a,wks,spd(0:zmax_pos,:),opts)
delete(opts)
; overlay plots together
plot = wrf_overlays(a,wks,(/contour/),pltres)
delete(u)
delete(u_plane)
delete(v)
delete(v_plane)
delete(z)
delete(spd)
end do
end
--
Joseph F. Brodie
Graduate Research Assistant, Center for Carbon-free Power Integration
School of Marine Science and Policy
College of Earth, Ocean, and Environment
University of Delaware
007A Robinson Hall
Newark, DE 19716 USA
Phone: +1 302-831-0694
Fax: +1 302-831-6838
Email: jbrodie at udel.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/wrf-users/attachments/20120827/29eab8a8/attachment.html
More information about the Wrf-users
mailing list