A column of dry air in hydrostatic equilibrium is considered, bounded by two fixed values of the pressure, and the question is asked, what vertical temperature profile maximizes the total entropy of the column? Using an elementary variational calculation, it is shown how the result depends on what is kept fixed in the maximization process. If one assumes that there is no net heat exchange between the column and its surroundings - implying that the vertical integral of the absolute temperature remains constant - an isothermal profile is obtained in accordance with classical thermodynamics and the kinetic theory of gases. If instead the vertical integral of the potential temperature is kept fixed - as argued by several authors to be appropriate in the case of convective mixing - an isentropic profile results. It is argued that, if one wishes to apply the latter constraint, it should be used as an additional, rather than as an alternative, constraint. The variational problem with both constraints leads to a profile in between the isothermal and the isentropic extremes. This profile has the merit of reproducing very accurately the tropospheric part of the U. S. Standard Atmosphere, 1976.