  We study the effects of HD molecules on thermochemical evolution of the
primordial gas behind shock waves, possibly arised in the process of galaxy
formation. We find the critical shock velocity when deuterium transforms
efficiently into HD molecules which then dominate gas cooling. Above this
velocity the shocked gas is able to cool down to the temperature of the cosmic
microwave background. Under these conditions the corresponding Jeans mass
depends only on redshift and initial density of baryons $M_J \propto
\delta_c^{-0.5} (1+z)^{0.5}$. At $z\simgt 45$ HD molecules heat shocked gas,
and at larger redshift their contribution to thermal evolution becomes
negligible.
