In the outermost level of the nested iteration scheme we also iterate for the temperature structure of the atmosphere using a generalization of the Unsöld-Lucy temperature correction scheme to spherical geometry and NLTE model calculations. This has proven to work very well even in extreme NLTE cases such as nova and supernova atmospheres. The temperature correction procedure also requires virtually no memory and CPU time overheads. The Unsöld-Lucy correction scheme (see Mihalas  for a discussion of this and other temperature correction schemes), uses the global constraint equation of energy conservation to find corrections to the temperature that will fulfill energy conservation better than the previous temperatures. We have found it to be more stable than a Newton-Raphson linearization scheme and it allows us to separate the temperature corrections from the statistical equations discussed above.
To derive the Unsöld-Lucy correction, one uses the fact that
the ratios of the wavelength averaged absorption and
Dropping terms of order (v/c), one can then
use the angular moments of the SSRTE to show that in order to
obtain radiation equilibrium B should be corrected by an amount
where is the ``Eddington factor'' and is the second angular moment of the mean intensity. describes all additional sources of energy such as mechanical energy supplied by winds or non-thermal ionization due to -ray deposition.
The first term in Eq. 35 corresponds simply to a iteration term and will thus provide too small temperature corrections in the inner parts of the atmosphere (but work fine in the outer, optically thin parts). The second term of Eq. 35, however, is the dominant term in the inner parts of the atmosphere. It provides a very good approximation to the temperature corrections deep inside the atmosphere. Following , we found that it is sometimes better to modify this general scheme by, e.g., excluding the contributions of extremely strong lines to the opacity averages used in the calculations because they tend to dominate the average opacity but do not contribute as much to the total error in the energy conservation constraint.