;this is an example 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/WRF_contributed.ncl" begin ;READ IN WRFOUT FILE date="08-10_00" direc1="/nfs/vapor3/local/vol01/scratch/binzhang/wrfout/200608_standard_bc/" fn1=addfile(direc1+"wrfout_d01_2006-"+date+":00:00.nc","r") ;filename direc2="/nfs/vapor3/local/vol01/scratch/binzhang/wrfout/200608_nobc/" fn2=addfile(direc2+"wrfout_d01_2006-"+date+":00:00.nc","r") ;EXTRACT FILED TO BE PLOTTED u1 = fn1->U v1 = fn1->V u2 = fn2->U v2 = fn2->V ;extract the lowest level u1l = u1(:,0,:,:) v1l = v1(:,0,:,:) u2l = u2(:,0,:,:) v2l = v2(:,0,:,:) w1=u1l w2=u1l do i=0,71 do j=0,75 do k=0,99 ; aa=(u1l(i,j,k)^2) + (v1l(i,j,k)^2) ; bb=(u2l(i,j,k)^2) + (v2l(i,j,k)^2) w1(i,j,k) = sqrt((u1l(i,j,k)*u1l(i,j,k))+(v1l(i,j,k)*v1l(i,j,k))) w2(i,j,k) = sqrt((u2l(i,j,k)*u2l(i,j,k))+(v2l(i,j,k)*v2l(i,j,k))) w = w1-w2 end do end do end do wtvg = dim_avg_n(w,0) ;time averaging data wtvg@units="m/s" ; print(max(wtvg)) ; print(min(wtvg)) ;======================================================================= ;SET UP PLOTTING PARAMETERS ;creating workstations to plot to different file off = "pdf" ; output file form ofn = "com_windspeed" ; output file name wks=gsn_open_wks(off,ofn+"_"+date) gsn_define_colormap(wks,"WhViBlGrYeOrRe") ;choose colormap for wks ;assign plotting resources res = True res@gsnMaximize = True res@gsnSpreadColors = True ;use full range of color map res@cnFillOn = True ;turn on color fill res@cnLinesOn = False ;turn off contour lines res@cnLevelSelectionMode = "ManualLevels" ;set explicit contour levels res@cnMinLevelValF = -12 res@cnMaxLevelValF = 12 res@cnLevelSpacingF = 2 res@tiMainString = "Surface_windspeed__SS-NS"+date+"UTC" res@mpDataBaseVersion = "Ncarg4_1" res@mpOutlineOn = True res@mpOutlineSpecifiers=(/"China:states","Taiwan"/) res@mpOutlineBoundarySets = "GeophysicalAndUSStates";"Geophysical" "AllBoundaries" "National" res@mpGridLineColor = "Black" res@mpLimbLineColor = "Black" res@mpNationalLineColor = "Black" res@mpPerimLineColor = "Black" ;======================================================================= ;Use WRF_contributed PROCEDURE TO SET MAP RESOURCES WRF_map_c(fn1,res,0) ;define lat,lon wtvg@lat2d = fn1 ->XLAT(0,:,:) wtvg@lon2d = fn1 ->XLONG(0,:,:) ;plot bc at the lowest level ;plot = gsn_csm_contour_map(wks,wtvg,res) plotpdf = gsn_csm_contour_map(wks,wtvg,res) end