begin ;---Open WRF output file filename = "/home/gaurav/wrf_exp/wrfout_d02_2014-10-26_00:00:00-fnl-myjbmj.nc" a = addfile(filename,"r") ;---Read several WRF variables at first time step it = 00 u = wrf_user_getvar(a,"U",it) ; U component of the wind at 10m ;printVarSummary(u) v = wrf_user_getvar(a,"V",it) ; V component of the wind at 10m ;u10 = u10*1.94386 ;v10 = v10*1.94386 u@units = "m/s" v@units = "m/s" wks = gsn_open_wks("png","wind") ;---Set common resources for all plots res = True res@gsnFrame = False res@gsnDraw = True res@gsnLeftString = "" res@gsnRightString = "" ;res@vcMonoLineArrowColor = False ;---Necessary for contours to be overlaid correctly on WRF projection res@tfDoNDCOverlay = True ;---Wind vector plot cmap = read_colormap_file("BlAqGrYeOrReVi200") vec_res = res vec_res@vcFillArrowsOn = True vec_res@vcMinDistanceF = 0.02 vec_res@vcRefLengthF = 0.025 vec_res@vcRefMagnitudeF = 15 vec_res@vcMinFracLengthF = 0.2 vec_res@vcLevelPalette = cmap(6:193,:) vec_res@vcWindBarbColor = "blue" vec_res@vcRefAnnoOn = True kl = 5 vector = gsn_csm_vector(wks,u(kl,:,:),v(kl,:,:),vec_res) ;---Map plot map_res = True map_res@mpLandFillColor = "tan" map_res@mpOceanFillColor = "cornflowerblue" map_res@gsnFrame = True map_res@gsnDraw = False map_res@tmXBLabelFontHeightF = 0.025 ; resize tick labels map_res@tmYLLabelFontHeightF = 0.025 ;---Set map resources based on projection on WRF output file map_res = wrf_map_resources(a,map_res) map = gsn_csm_map(wks,map_res) ;vector = gsn_csm_vector(wks,u,v,vec_res) overlay(map,vector) draw(map) ; This will draw all overlaid plots and the map frame(wks) end