Mie.py
: Computes scattering and absorption cross sections for Mie scattering. This is a Python translation of the widely available program bhmie
, which you can find on the Web in both Fortran and c versions. For those who want more computational speed, you can try building a compiled version with mie.c
, which uses the auxiliary file complex.c
. Advanced users could use swig to build these into a fast Python tool for mie scattering calculations. The graphs in the text were done using Mie.py, though, which is fast enough. plotAlbedo.py :
A simple script to make plots of the analytic result for conservative scattering albedo. Not used in the text, but useful for exploring the formulas given in the section on basic solutions to the two-stream equations. ccmCloud.py
:
This script makes plots of the effect of clouds on OLR and albedo, using the ccm radiation code. It needs to import ccmradFunctions.py, located in the Chapter4Scripts directory. You can either put a copy of ccmradFunctions.py into the directory from which you are running ccmCloud.py, or you can put a copy in any directory in your PYTHONPATH
. As for all ccm radiation code calculations, this requires that you have installed the climt_lite package. ERBECloudPlot.py :
[**Write script to do ERBE cloud plots. This a variant on the Chapter 3 ERBE plot script.]TwoStreamScatterSimple.py
:
This is the simplest version of numerical solution of the two-stream equations using the ODE method. It will fail when the atmosphere becomes too optically thick.TwoStreamScatter.py
:
This is the full implementation of the piecewise ODE method for solving the two-stream equations, which can handle atmospheres that are arbitrarily optically thick. It was used to make the flux plot in the section on the piecewise ODE method. TwoStreamScatterEsum.py
:
This is an extension of the piecewise ODE solution which uses the exponential sum method to do real-gas computations. It was used to make the plot of the effect of a CO2 ice cloud on OLR in an Early Mars atmosphere.tridiag.py
:
Implements solution of a tridiagonal linear system, and illustrates its use in solving a simple two-point boundary value problem using the matrix method. This is a simpler illustration of the technique that would be used for solving the two-stream equations by the matrix method, which would instead use the Numerical Recipes routine bandec.c (I will eventually provide a Python translation of that). Actually, the two-stream equations could be reduced to a single second-order ODE for the net flux, but at the expense of making the boundary conditions complicated. StellarTransmissionProfile.py
:
Computes and plots the vertical profile of flux of incoming stellar radiation for various real-gas atmosphers. Used to make the M vs. G star plots in the section on atmospheric stellar absorption. This Uses miniClimt.py, and miniClimtFancy.py, from the Chapter 4 Chapter Scripts. These routines need to be placed in the directory from which you are running StellarTransmissionProfile.py, or alternatively you need to put a copy of these scripts in any directory in your PYTHONPATH
. RadConvEqTrop.py
:
Uses the homebrew radiation code in a modified time-stepping loop to compute radiative-convective equilibrium including the effects of atmospheric stellar absorption. Unlike the radiative-convective code in the Chapter 4 scripts collection, this one takes the incoming flux as a given, and computes the surface temperature that puts the system in equilibrium. This script uses miniClimt.py. (see instructions for previous script)ccmRadConv.py
:
This does the same thing as RadConvEqTrop.py, but uses the ccm radiation code instead so that multiple greenhouse gases can be treated, at least in fairly Earthlike regimes. It was used to make the plots in the text regarding the influence of ozone on vertical structure. This uses climt_lite directly, rather than going through ccmradFunctions.py. [**CLEAN UP SCRIPT]