;************************************************* ; barb_3.ncl ; ; Concepts illustrated: ; - Drawing colored wind barbs vectors over a cylindrical equidistant map ; - Changing the length of the wind barbs ; - Changing the size of the wind barbs ; - Decreasing the number of vectors drawn ; - Adding a color to an existing color map ; - Using the full color map for colored wind barbs ; - Changing the length of a wind barb tick ; - Changing the distance between wind barb ticks ; - Turning off the vector reference annotation label ; - Drawing a map using the medium resolution map outlines ; - Thinning vectors using a minimum distance resource ; ;************************************************ 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 ;************************************************ do ntime = 1,1 ifile = ntime mtime =ntime+10 fn = "/home/nlcheng/huatu111111111/hangce/hangce_nlcheng/fnl/fnlnc/"+ifile+".nc"; a = addfile(fn,"r") ;************************************************ ; read in zonal [u] and meridional [v] winds ;************************************************ do m = 13,13 u = a->UGRD_P0_L100_GLL0(m,:,:) v = a->VGRD_P0_L100_GLL0(m,:,:) t = a->TMP_P0_L100_GLL0(m,:,:) plevel =a->lv_ISBL0(m) plevel=plevel/100 ;************************************************ ; create plot ;************************************************ fon = "fnl"+"201104"+ mtime+"-"+ plevel+"hpa" ; plot filename wks = gsn_open_wks("eps",fon) ; open ps file gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose color map i = NhlNewColor(wks,0.8,0.8,0.8) ; add gray to colormap res = True ; plot mods desired res@gsnSpreadColors = True ; use full colormap res@gsnSpreadColorEnd = -2 ; don't use added gray ;res@lbOrientation = "vertical" ; vertical label bar res@vcRefMagnitudeF = 20.0 ; make vectors larger res@vcRefLengthF = 0.040 ; ref vec length res@vcMinDistanceF = 0.017 ; thin out vectors ;res@vcGlyphStyle = "WindBarb" ; choose wind barbs res@vcMonoWindBarbColor = False ; color barbs by scalar res@vcMinDistanceF = 0.025 ; thin out windbarbs ;res@vcWindBarbTickLengthF = 0.4 ; length of the barb tick ;res@vcWindBarbTickSpacingF = 0.3 ; distance between ticks res@vcRefAnnoOn = False ; turn off ref wind barb res@gsnAddCyclic = False ; regional data res@lbLabelStride = 2 res@tiMainString = fon ; zoom in on map minlat = 0 maxlat = 60 minlon = 55 maxlon = 140 res@mpMinLatF = minlat res@mpMaxLatF = maxlat res@mpMinLonF = minlon res@mpMaxLonF = maxlon res@mpDataBaseVersion = "Ncarg4_1" ; medium resolution coastline ; if we want the color bar to reflect only those values within our chosen ; subregion, then we need to pass the plot template the subset of the data ; in addition to zooming in on the map. plot=gsn_csm_vector_scalar_map_ce(wks,u({minlat:maxlat},{minlon:maxlon}),\ v({minlat:maxlat},{minlon:maxlon}),t({minlat:maxlat},{minlon:maxlon}),res) end do end do end