;*********************** ; coneff_8.ncl ; ; Concepts illustrated: ; - Drawing pressure/height contours ; - Selectively coloring between contour levels (using an old method) ; ;*********************** 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/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" ;=========================== begin ;************************* ; get data ;************************* f = addfile("atmos.nc","r") u = f->U(0,:,:,:) ;************************* ; convert to pressure levels ;************************* hyam = f->hyam hybm = f->hybm ps = f->PS p0 = 1000. pres3d = (/1000,950,800,700,600,500,400,300,200/) pres3d@units= "mb" uint=(/vinth2p(u,hyam,hybm,pres3d,ps(0,:,:),2,\ p0,2,False)/) uint!0 = "plev" uint&plev = pres3d uint!1 = "lat" uint&lat = u&lat uint!2 = "lon" uint&lon = u&lon uint@long_name = "Zonal Wind" uzon=uint(:,:,0) uzon=dim_avg(uint) ;=========================== ; plot parameters ;=========================== wks = gsn_open_wks ("ps", "coneff" ) ; open workstation res = True ; plot mods desired res@gsnDraw = False ; do not draw res@gsnFrame = False ; do not advance frame res@cnLevelSpacingF = 4.0 ; contour level spacing res@cnInfoLabelOn = False ; turn off contour label plot = gsn_csm_pres_hgt(wks, uzon, res ) plot = ColorShadeLeGeContour(plot,10.,"salmon",20.,"cyan") draw(plot) frame(wks) end