; stepwise.pro ; IDL program - Explore stepwise cooling in lower stratosphere. ; ATOC 7500 Human Impacts on Weather and Climate ; Author: Carl Drews ; Instructor: Roger Pielke, Sr. ; February 28, 2007 ; To run this script: ; IDL ; .run stepwise ; Debugging in IDL: ; Use the stop statement to pause execution and enter interactive mode. ; Use .step to single-step. ; Use .continue to resume execution. ; This script will produce a PostScript file. ; You can view these with gv. ; Set up the common plotting variables. PRO setupPlotVars !p.font=0 !p.multi = [0,1,3] !p.thick=10.0 & !x.thick=1.0 & !y.thick=1.0 !x.ticklen = 0.03 & !y.ticklen = 0.02 !p.charsize=1.2 END ;;; MAIN PROGRAM BEGINS HERE ; generate the data startYear = 1955 endYear = 2005 numYears = endYear - startYear + 1 years = indgen(numYears) + startYear ; anthropogenic cooling due to ozone depletion (and greenhouse gases) ozone = 1.0 - (years - startYear) / (numYears / 2.0) ; ozone stable before 1960 and after 2000? ozone[0:4] = ozone[5] ozone[numYears-5:numYears-1] = ozone[numYears-6] ; solar forcing (11-year sunspot cycle) solar = 0.2 * sin(2.0 * !pi * (years + 2) / 11.0) ; volcanic eruptions ; The spike appears to come in the following year volcanic = fltarr(numYears) volcanicDegrees = 1.0 ; Agung in 1963 eruptYear = 1963 - startYear volcanic[eruptYear + 1] = volcanicDegrees volcanic[eruptYear + 2] = volcanicDegrees / 2 ; El Chichon in 1982 eruptYear = 1982 - startYear volcanic[eruptYear + 1] = volcanicDegrees volcanic[eruptYear + 2] = volcanicDegrees / 2 ; Pinatubo in 1991 eruptYear = 1991 - startYear volcanic[eruptYear + 1] = volcanicDegrees volcanic[eruptYear + 2] = volcanicDegrees / 2 ; load 16 level color table LoadCT, 12, ncolors = 16 ; output to PostScript file set_plot, 'ps' device, filename="Stepwise.ps", /color, bits=8, /portrait, /helvetica, $ xsize=18, ysize=24, xoffset=1.5, yoffset=2.0 setupPlotVars ; plot the effects separately plot, years, ozone $ , title='Separate Influences on Stratospheric Temperature' $ , yrange = [-1.5, 2.0] $ , xtitle = 'Year (blue = ozone depletion, red = solar, green = volcanic)' $ , ytitle = 'Degrees C' $ , /nodata oplot, years, ozone, color = 6 oplot, years, solar, color = 12 oplot, years, volcanic, color = 3 ; add together the separate forcings totalForcing = ozone + solar + volcanic ; plot the combined effect plot, years, totalForcing $ , title='Combined Stratospheric (Stepwise) Forcing' $ , yrange = [-1.5, 2.0] $ , xtitle = 'Year' $ , ytitle = 'Degrees C' device, /close end