In this project we will construct a Monte Carlo calculation of radiative transfer in a planetary atmosphere. The radiative transfer will be simulated using a random walk of photons through the atmosphere. In this calculaiton, photons are emitted by the planet's surface and random walk their way through absorption and reemission in the atmosphere until they eventually escape to space or are reabsorbed by the ground.
The background to this calculation is presented in the accompanying lecture (found here). The purpose of these instructions is to suggest a way to develop the program and pose some questions for investigation to be answered in your report.
It is a good idea to begin by developing the script for a single random walk through the atmosphere. In Exercise 9 you developed a similar random walk through a number of layers. Here, the problem is almost the same, with the new twist that the layers are nearly transparent. Thus, each time you encounter a layer, there is only a small chance that the photon will be absorbed and reemitted.
How do we set up the layers in the atmosphere, and what is the chance of absorption in each layer? We take as an input to the program the total optical depth of the atmosphere. Then we must divide the atmosphere into a large enough number of layers so that, for each layer, the chance of absorption is small (that is much less than one as in the lecture notes). Obviously, for a given total optical depth, the appoximation that the chance of absorption is small will be better for larger and larger numbers of layers. But, also obviously the program will take longer to run with larger numbers of layers. So the artistry here is to pick an optical thickness for the layers that is small enough for an accurate calculation, but big enough so that the calculation does not take forever. In your report you must be prepared to justify your use of a particular value and demonstrate that it gives the correct answer.
Once we have a single random walk doing the right thing, lets add an outer loop to perform a large number of random walks. Here you will want to keep track of some of the critical data in the calculation:
Now that we have the random walk results, we must relate them to the real physical quantities in the atmosphere. As described in the lecture, we normalize all quantities to the emission from the top of the atmosphere, which we know should be equivalent to the rate of emission from a blackbody at temperature Teff. See lecture for specific formulae.
For a given effective temperature, input by the user, and for a given optical depth, input by the user, your program should produce:
You will need to decide how many trial photons are required to get accurate answers. In this case, we will define "accurate" to mean that the ground temperature is derived to an accuracy of 0.2K. In your report, you should be sure to tell the number of trial photons used and justify your selection.
Run your program for the following nominal case and present the results. Please note that, although these values are very similar to the actual situation for the Earth, you should not expect them to exactly reproduce values of atmospheric and ground temperatures found in tables or on Wikipedia.
To make our calculation easy, we have divided the atmosphere into layers of equal optical depth. In the real atmosphere, these layers would have different thickness since the optical depth depends on the mass of the layer and the density of air decreases with altitude.
The density of air in the Earth's atmosphere, d, follows the exponential law:
d(h) = d(0) exp(-z(km)/8(km))
where z is the altitude and 8 km is the e-folding scale of the exponential law (known as the scale height in atmospheric physics.) Each of your optical depth layers must have the same amount of material in it, so we can use this relationship for density versus height to derive the height corresponding to each layer, assuming that the opacity only depends on the amount of material. Make a graph of the temperature derived from the model versus the actual height in the atmosphere. How does this compare to the temperature profile of the Earth's atmosphere?
As with exercises, please copy your report, your final script, and any other relevant materials to a subdirectory named "Project 1" within your directory in the area where assignments are submitted: e.g. ~schloerb/ph281/username/Project1/.