The stability of the semi-implicit method of time integration of the primitive equations is examined when the actual temperature deviates from the reference profile about which the implicitly treated gravity wave terms are linearized. The stability criterion is shown in general to be much more stringent than might he assumed from a simple analytical solution. Instability may occur when there exists a region in which the static stability of the actual atmosphere differs significantly from that of the reference atmosphere, and for realistic actual profiles and commonly chosen reference profiles it is likely to arise at vertical resolutions that are little higher than those used in previous tests of the scheme. Stabilization is achieved either by an appropriate change of reference profile or by a modification of the time-averaging of gravity wave terms. Both may result in a small further reduction in gravity wave phase speeds. Alternatives are mentioned which give better phase speeds at the expense of a reduced time step.