  A photoionized gas in thermal equilibrium can display a thermal instability,
with 3 or more solutions in the multi-branch region of the S-shape curve giving
the temperature versus the radiation-to-gas-pressure ratio. Many studies have
been devoted to this curve and to its dependence on different parameters,
always in the optically thin case. The purpose of our study is the thermal
instability in optically thick, stratified media, in total pressure
equilibrium. We have developped a new algorithm to select the hot/cold stable
solution, and thereof to compute a fully consistent photoionization model. We
have implemented it in the TITAN code and computed a set of models encompassing
the range of conditions valid for the Warm Absorber in Active Galactic Nuclei.
We have demonstrated that the thermal instability problem is quite different in
thin or thick media. In thick media the spectral distribution changes as the
radiation progresses inside the ionized gas. This has observational
implications in the emitted/absorbed spectra, ionization states, and
variability. However impossible to know what solution the plasma will adopt
when attaining the multi-solutions regime, we expect the emitted/absorbed
spectrum to be intermediate between those resulting from pure cold and hot
models. Large spectral fluctuations corresponding to the onset of a cold/hot
solution could be observed in timescales of the order of the dynamical time. A
strong turbulence implying supersonic velocities should permanently exist in
the multi-branch region of thick, stratified, pressure equilibrium media.
