Contour Plots
line This contour plot reads in a ccm History Tape that has been converted into a netCDF file. It displays four different elements (U,V,T,and OMEGA) on separategraphs and then goes on to plot all four together using a panel plot.
load "/fs/cgd/data0/shea/nclGSUN/gsn_code.ncl"
load "/fs/cgd/data0/shea/nclGSUN/gsn_csm.ncl"
load "/fs/cgd/data0/shea/nclGSUN/shea_util.ncl"
load "/fs/cgd/data0/shea/nclGSUN/contributed.ncl"

begin

diri = "/tmp/scavarda/"

fili = "dec96.nc"

f = addfile (diri+fili, "r")

lat = f->lat
lon = f->lon
time = f->time
date = f->date
lev = f->lev
datesec = f->datesec

V = f->V({349.5},{250},:,:) ; Meridonial Wind Component

U = f->U({349.5},{250},:,:) ; Zonal Wind Component
T = f->T({349.5},{250},:,:) ;Temperature
OMEGA = f->OMEGA({349.5},10,:,:) ;Vertical Pressure Velocity

T = T - 273.15 ;convert Kelvin -> Celsius

T@units = "(C)" ; Changt unitsn -> Celsius
OMEGA = OMEGA * 0.01 ; Convert Pa -> mb
OMEGA@units = "(mb)" ; conversion done.
datesec = datesec/86400

xwks = gsn_open_wks("x11","wind")

plot = new(4,graphic)
resources = True
resources@tiMainString = "Temperature (C)"
resources@cnFillOn = True ; Turn on contour line fill.
resources@tiXAxisString = lon@long_name
resources@tiYAxisString = lat@long_name
resources@sfXArray = lon
resources@sfYArray = lat
resources@pmLabelBarDisplayMode = "Always" ; Turn on label bar.
resources@lbPerimOn = False ; Turn off perimeter on
resources@tiMainFont = .2
resources@tiXAxisFont = .2
resources@tiYAxisFont = .2
resources@cnLevelSelectionMode = "ManualLevels"
resources@cnMinLevelValF = -100. ; set min contour level
resources@cnMaxLevelValF = 100. ; set max contour level
resources@cnLevelSpacingF = 10. ; set contour spacing
resources@tiMainString = "Zonal Wind Component"

genCmapManualRes(xwks, resources ,"blue","red")

plot(0) = gsn_contour(xwks,U,resources)

resources@tiMainString = "Meridional Wind Component"
plot(1) = gsn_contour(xwks,V,resources)
resources@tiMainString = "Temperature (C)"
plot(2) = gsn_contour(xwks,T,resources)
resources@tiMainString = "Omega (mb)"
plot(3) = gsn_contour(xwks,OMEGA,resources)
gsn_panel(xwks,plot,(/2,2/),resources)

delete(plot)

delete(plot)
delete(plot)
delete(U)
delete(T)
delete(V)
delete(OMEGA)

end