interpolate winds in height

The NCL graphics package.

interpolate winds in height

Postby Guillermo » Tue Oct 06, 2015 2:45 pm

Hi, I trying extract winds field at a specific height (50 y 80m).
I used a ncl script but the height is above sea level, and I need above ground level, following the orography.
I have results, but no the results that i want.

This is the part of the script that I use.
---------------------------------------------------------------------------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

a = addfile("/home/WRF/wrfout_d01_1998-02-01_00:00:00","r")

type = "png"
wks = gsn_open_wks(type,"winds")

; Set some basic resources
res = True
res@MainTitle = "REAL-TIME WRF"
res@Footer = False

pltres = True
mpres = True
mpres@mpGeophysicalLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpGridLineColor = "Black"
mpres@mpLimbLineColor = "Black"
mpres@mpPerimLineColor = "Black"

; What times and how many time steps are in the data set?
times = wrf_user_getvar(a,"times",-1) ; get all times in the file
ntimes = dimsizes(times) ; number of times in the file

; First get the variables we will need
u = wrf_user_getvar(a,"ua",-1) ; u averaged to mass points
v = wrf_user_getvar(a,"va",-1) ; v averaged to mass points
z = wrf_user_getvar(a, "z",-1) ; grid point height


; The specific height levels that we want the data interpolated to.
; And interpolate to these levels
height_levels = (/ 50., 80. /) ; height levels to plot - in meter
nlevels = dimsizes(height_levels) ; number of height levels

u_plane = wrf_user_intrp3d( u,z,"h",height_levels,0.,False)
v_plane = wrf_user_intrp3d( v,z,"h",height_levels,0.,False)

spd = (u_plane*u_plane + v_plane*v_plane)^(0.5) ; speed in m/sec
spd@description = "Wind Speed"
spd@units = "m/s"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

do it = 0,ntimes-1,1 ; TIME LOOP

print("Working on time: " + times(it) )
res@TimeLabel = times(it) ; Set Valid time to use on plots


do level = 0,nlevels-1 ; LOOP OVER LEVELS

height = height_levels(level)

; Add some level into to the plot
res@PlotLevelID = .001*height + " km"

opts = res
opts@cnFillOn = True
opts@ContourParameters = (/ 0, 20., 2./)
opts@cnFillColors = (/"cadetblue1","cadetblue3","aquamarine", \
"aquamarine2","aquamarine4","blue",\
"blue4","brown1", \
"olivedrab1","PaleGreen3"/)
contour_vt = wrf_contour(a,wks,spd(it,level,:,:),opts)
delete(opts)



; Plotting options for Wind Vectors
opts = res
opts@vcGlyphStyle = "CurlyVector"
vector = wrf_vector(a,wks,u_plane(it,level,:,:),v_plane(it,level,:,:),opts)
delete(opts)


; MAKE PLOTS
plot = wrf_map_overlays(a,wks,(/contour_vt,vector/),pltres,mpres)


end do ; END OF LEVEL LOOP


end do ; END OF TIME LOOP

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

end
-----------------------------------------------------------------------------------

Do you have any tip? or a example of a script that I could use?

Thank soo much, I appreciate your help.
Guillermo
 
Posts: 3
Joined: Sat Aug 08, 2015 3:17 pm

Re: interpolate winds in height

Postby mat » Mon Dec 07, 2015 8:17 pm

I have the same problem. Please let me know, if you solve this problem.
mat
 
Posts: 4
Joined: Mon Jul 13, 2015 2:10 am


Return to NCL

Who is online

Users browsing this forum: No registered users and 2 guests