[ncl-talk] How to average monthly wind direction and represent them as wind barbs

Dennis Shea shea at ucar.edu
Wed Dec 11 10:25:44 MST 2019


To compute average wind direction
[1] compute average zonal [u] and meridional [v] components
[2] use the u and v component averages as input to *wind_direction*
<http://www.ncl.ucar.edu/Document/Functions/Contributed/wind_direction.shtml>
to commute the average direction(s)
---
NCL also has a function *wind_stats*
<http://www.ncl.ucar.edu/Document/Functions/Contributed/wind_stats.shtml>


On Wed, Dec 11, 2019 at 3:24 AM Kunal Dayal via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Hi,
>
> I working on mapping wind resources from WRFOUT files.
>
> I can easily plot contour maps of average wind speed for a month but I am
> unable to represent average wind direction in the form of wind barbs.
>
> The code I am using for the average wind speed contour maps is as follows:
> "
> begin
> a =
> addfile("/scale_wlg_persistent/filesets/project/uoa02450/wrf-topo2sstpblmix/wrfout_d03_2017-06-28_00:00:
> 00.nc","r")
> type = "pdf"
> wks = gsn_open_wks(type,"Average Wind Speed - Jul 2017")
> opts = True
> opts at MainTitle = "WIND SPEED"
> pltres = True
> mpres = True
>
> times = wrf_user_getvar(a,"times",-1)
> ntimes = dimsizes(times)
>
> u = wrf_user_getvar(a,"ua",-1)
> v = wrf_user_getvar(a,"va",-1)
> spd = (u*u + v*v)^(0.5)
> spd at description = "Wind Speed"
> spd at units = "m s-1"
>
> spd_avg = dim_avg_n(spd(0:30,:,:,:),0)
> spd_avg at description = "Average Wind Speed"
> spd_avg at units = "m s-1"
>
> res = True
> opts = res
> opts at cnFillOn = True
> opts at cnLinesOn = True
> opts at ContourParameters = (/ 0., 12., 0.5/)
> opts at gsnSpreadColorEnd = -3
> contour_spd_avg = wrf_contour(a,wks,spd_avg(0,:,:),opts)
> delete(opts)
>
> plot = wrf_map_overlays(a,wks,(/contour_spd_avg/),pltres,mpres)
>
> end
> "
> I wish to add monthly average wind direction to the same maps in the form
> of wind barbs.
>
> Appreciate your assistance and advice.
>
> Regards
> Kunal
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191211/dae31089/attachment.html>


More information about the ncl-talk mailing list