;************************************************* ; barb_1.ncl ; ; Concepts illustrated: ; - Drawing wind barbs vectors over a cylindrical equidistant map ; - Changing the length of the vectors ; - Changing the size of the vectors ; - Decreasing the number of vectors drawn ; ;************************************************ ; ; These files are loaded by default in NCL V6.2.0 and newer ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;************************************************ begin ;************************************************ ; read in netCDF file ;************************************************ a = addfile("/global/scratch/umtropea/conus/ctrl/2d/2012/wind/wrf2d_d01_CTRL_U_201210-201212.nc","r") b = addfile("/global/scratch/umtropea/conus/ctrl/2d/2012/wind/wrf2d_d01_CTRL_V_201210-201212.nc","r") ;************************************************ ; read in zonal [u] and meridional [v] winds ;************************************************ u = a->U(73,:,:) v = b->V(73,:,:) ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("png","barb") ; send graphics to PNG file res = True ; plot mods desired res@gsnAddCyclic = False ; not global res@vcRefMagnitudeF = 10. ; make vectors larger res@vcRefLengthF = 0.050 ; ref vec length res@vcGlyphStyle = "WindBarb" ; select wind barbs res@vcMinDistanceF = 0.025 ; thin out windbarbs res@mpOutlineOn = True ; turn on map outline res@tiMainString = "Default Wind Barbs" ; title plot=gsn_csm_vector_map(wks,u,v,res) ; create plot end