||A model of an active layer of shallow water with horizontally nonuniform density has been developed in the nonhydrostatic approximation. Rayleigh-Taylor instability regimes, as well as the mechanism of the formation of self-similar jets (fingers), have been studied within this model. Their linear stability has been analyzed. It has been shown that nonhydrostaticity decisively affects instability at the final stage. For this reason, collapse predicted for hydrostatic models at this stage slows down and is transformed to the algebraic instability regime.