The strong interactions of shock waves caused by stellar pulsation, the formation of molecules and dust grains and a variable radiation field present a considerable challenge when modelling the atmospheres and circumstellar envelopes of pulsating asymptotic giant branch stars. In this paper we present dynamic model atmospheres of long-period variables which allow a consistent computation of near-infrared molecular features and their variability with phase. We discuss the effects of grey radiative transfer, of molecular opacities and of shock waves on the atmospheric structures and on the resulting wind properties. We find that the gas absorption coefficient used in the dynamical calculation has a considerable influence on the structure of the atmosphere, the mass loss and the observable spectral features. Therefore, we stress the importance of using reasonable mean gas opacities in grey dynamic models. Most topics discussed in this paper concern both C- and O-rich atmospheres but the quantitative results are mainly based on C-rich models. Synthetic spectra resulting from selected C- and O-rich models have been presented and compared to observations in several recent papers. A systematic investigation of observable properties of our C-rich models will be the subject of a second paper in this series.
A&A 340, 497