#----------------------------------Description--------------------------- # #This script computes and plots surface longwave #cooling vs Tg with fixed relative humidity, for various CO2. #It also computes and plots the surface cooling as a function of CO2 #for fixed temperature. The atmospheric profile is #the moist adiabat for water/air patched to an isothermal stratosphere. #The calculation is done using the NCAR real-gas radiation model # #The script also computes transparency factors, which are #used in the Workbook calculations, but not plotted or discussed in #the text. # #**ToDo: Move this to the Chapter 6 scripts (but put Chapter 4 scripts #in the $PYTHONPATH so it can get at ccmradFunctions; alternately, #make a soft link between the modules directory and ccmradFunctions). # #------------------------------------------------------------------------ #Data on section of text which this script is associated with Chapter = '6.**' Figure = 'fig:estarWetDry' Table = '' # from ccmradFunctions import * #Set the acceleration of gravity (default is Earth) setGravity(10.) #Set the surface N2/O2 pressure (in Pa. Default is 1.e5). Excludes CO2 ps = 1.e5 #Set the stratospheric temperature (default is 150K) setTstrat(150.) # #Change the following to relative humidities to 1.e-30 #to do the dry case rh = .5 #Free troposphere relative humidity# rhbdd = .8 #Boundary layer relative humidity # Tlist = [200.+ 2.*i for i in range(60)] eStarlists = [] transLists = [] co2list = [1.e-30,1,10.,100.,1000.,10000.,100000.] #The following sets up a list of empty lists, to hold the data for co2 in co2list: eStarlists.append([]) transLists.append([]) for T in Tlist: #There must be a more elegant way to do the following loop #I don't like having to use a list index here! for i in range(len(co2list)): co2 = co2list[i] eStar,eStarSurf = SurfCoeffs(ps,T,rh,rhbdd,co2) #eStarSurf isn't discussed in the text. It's #a result of a boundary layer "correction factor" #evidently applied in ccmrad to account for effects of #water vapor in a sublayer near the surface. It has #the effect of making the change in upward cooling #different from the change in sigma Tg**4 eStarlists[i].append(eStar) # #Now compute transparency factor trans = TopCoeff(ps,T,rh,rhbdd,co2) transLists[i].append(trans) c = Curve() #Titles and labels for plot: # c.addCurve(Tlist,'T','Surface Temperature') i=0 for eStarlist in eStarlists: name = 'eStar%e'%co2list[i] c.addCurve(eStarlist,name) i += 1 plot(c) c1 = Curve() #Titles and labels for plot # c1.addCurve(Tlist,'T','Surface Temperature') i=0 for transList in transLists: name = 'Trans%e'%co2list[i] c1.addCurve(transList,name) i += 1 plot(c1)