This is a readme file for the new (summer, 2008) version of the climate model. Current working version is in ~mbeach/Desktop/clima. The program is called 'clima.f'. This version of the climate model was inherited from Jacob Haqq-Misra. Jacob did several things to the climate model. Most importantly, he fixed the CH4 absorption coefficients in the thermal infrared. These were being read into the wrong wavelength bins, a mistake that had been in the code ever since CH4 was added (1999). Jacob also fixed several errors that had been discovered by Philip vonParis, a graduate student working with Heike Rauer at the DLR in Berlin. I can remember that the wavelengths were being calculated at the boundaries of the spectral intervals, rather than in the middle. Philip uncovered some other minor errors, as well, and these fixes were incorporated into Jacob's code. Most of these errors got into the code when it was converted into makefile format, sometime around 2004. This summer, I worked with undergraduates Michael Beach and William Lee. We fixed several things: CHANGES TO THE CLIMATE MODEL 1) The pressures that were being passed from the main code to subroutine ir.f were those at the centers of the grid levels, P. In reality, ir.f also needs to know the pressures at the layer boundaries, PF. Both pressure vectors are now passed to ir.f. 2) The smoothing algorithm, which is supposed to operate only in the stratosphere, may have been operating in the upper troposphere as well, especially in regions where CO2 is condensing. That's because the logic had been set up to look for IFLAG=1, i.e., to look for where H2O was condensing and then to smoothe above this level. That's not right, though, because it causes smoothing to occur in the upper troposphere where the temperature profile is supposed to be following a moist (H2O or CO2) adiabat. This may be why Hilary Justh got different answers when she used different (energy conserving and non-conserving) convective algorithms. We changed this so that now the code smoothes only above the cold trap, i.e., the point where the H2O saturation mixing ratio reaches a minimum. Both convective algorithms now give approximately the same answer (although see next comment). 3) We changed the way that the non-energy-conserving convective algorithm works. This algorithm works by adjusting the surface temperature in such a way as to balance the incoming solar flux and outgoing ir flux at the top of the atmosphere. It allows you to quickly get close to the answer in a dense atmosphere. The energy-conserving algorithm, by contrast, takes forever to converge when the atmosphere becomes thick. The logic for the non-conserving convective algorithm had never been properly reworked since the code was converted from a steady-state Newton solver to a time-stepper. That change was made for the Mischna et al. (2000) paper in order to include CO2 clouds and to allow for non-convective layers below these clouds. Consequently, the non-conserving algorithm was not operating very effectively in the time-stepping model. We changed this by i) adjusting the surface temperature itself, rather than the temperature of the first atmospheric layer, and 2) doing things differently when the surface temperature, Ts is increasing and when it is decreasing. When Ts is increasing, all one needs to do is run adiabats up from the surface, layer by layer, and check to see whether each layer is convective. If the radiative lapse rate is steeper than the moist adiabat, then the layer convects; otherwise, it does not. When Ts is decreasing, though, one cannot apply this same logic. If you pull the surface temperature down, then the bottom (half) layer of the atmosphere becomes stable, and the rest of the troposphere does not adjust. To make the logic work, the entire troposphere needs to change temperature along with the surface. So, we fixed this by simply moving the tropospheric temperatures linearly with the surface temperature, all the way up to the cold trap. The resulting temperature profile may depart slightly from a moist adiabat, but the deviations should be small. 4) The best way to run the code, then, is the following: Start from a solution in which the surface temperature is slightly lower than what one is looking for. Run the model 25-50 steps in non-energy-conserving mode (ICONSERVE=0). This should get you close to the solution. Then run the model ~200 steps in energy-conserving mode (ICONSERVE=1) to make sure that the tropospheric temperatures are indeed along a moist adiabat in regions that are convective. In practice, Mike, Will, and I have found that this makes little difference to the calculated surface temperature; however, this is the safe way to proceed because the logic for the energy-conserving mode is, hopefully, correct and self-consistent. 5) We also found that increasing the number of vertical levels in the model makes a significant difference, particularly in atmospheres with a steep tropospheric temperature gradient. The old model typically ran with ND=25. We find that increasing NS to 51 or even 101 increases the calculated surface temperatures in some cases. For example, when we redid the early Mars calculations, we found that surface temperatures increased by about 10 K for dense CO2 atmospheres even when we tuned the present (6 mbar) atmosphere to the same surface temperature. We also found that accuracy can be improved by increasing the ratio of the grid spacing at the top of the model to that at the bottom. This parameter is called FAC. We recommend FAC=4 instead of FAC=2. You just don't need that many levels in the stratosphere if ND is large. 6) Finally, we have created different versions of the model which include different gases. All of our versions now include NO2, which is an important absorber in the near-UV and visible between 300 and 500 nm. In the current version, the mixing ratio of NO2 is constant with altitude. This could be changed, however, with a little work. The current version of the model includes H2O, CO2, and CH4 (and O3 in one interval) in the thermal infrared. The C2H6 loop is commented out to make the model run faster. We also have a version in which the CH4 loop is also commented out (clima_noCH4). This one runs really fast. It would be nice to create a version of the code in which one could pick one's gases and in which they could all vary with altitude, as required.