[ncl-talk] limit the vertical axis in the wind profile in wrf out file
E Mobarak
mobarak_e at yahoo.com
Sun Jan 6 04:18:45 MST 2019
Hello
I've plotted the wind profile with this script
But y-axis is up to 21,000 meters
How can I limit the vertical axis and draw only the first 5 km?
Thanks for answer
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/wrf/WRF_contributed.ncl"
a1 = addfile(wrfout_d01_2009-02-19_00:00:00.nc,"r")
wks = gsn_open_wks ("png","profile") ; send graphics to PNG file
u1 = wrf_user_getvar(a1,"ua",-1) ; u on mass points
v1 = wrf_user_getvar(a1,"va",-1) ; v on mass points
z1 = wrf_user_getvar(a1,"z",-1) ; u on mass points
res = True
plots = new(4,graphic)
llres = True
llres at ReturnInt = True ;
locs = (/"Ahvaz","bu"/)
lats = (/31.34,30/)
lons = (/44.53,41/)
nlocs = dimsizes(locs)
loc = wrf_user_ll_to_ij(a1, lons, lats, True)
do iloc = 0, nlocs-1
locX = loc(0, iloc) - 1
locY = loc(1, iloc) - 1
times = wrf_user_list_times(a1) ; get times in the file
ntimes = dimsizes(times) ; number of times in the file
it = 10
zz1 = z1(it,:,locY,locX)
uu1 = u1(it,:,locY, locX)
vv1 = v1(it,:,locY, locX)
spd1 = (uu1*uu1 + vv1*vv1)^(0.5)
;------------------ res -------------------------
res = True
res at gsnDraw = False ; Don't draw individual plot.
res at gsnFrame = False ; Don't advance fram
;-----------------------------------------------------
wks = gsn_open_wks ("png","xy-"+locs(iloc)) ; send graphics to PNG file'
uu_plot = gsn_csm_xy(wks,spd1,zz1,res)
draw(uu_plot)
frame(wks)
end do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190106/e6000951/attachment.html>
More information about the ncl-talk
mailing list