  We study the changes in physical and chemical conditions during the collapse
of a pre--protostellar core, starting from initial conditions appropriate to a
dense molecular cloud and proceeding to the ``completely depleted'' limit. We
follow the evolution of the ionization degree and the ionic composition as
functions of time and density. The processes of freeze--out on to the dust
grains and coagulation of the grains were treated simultaneously with the
chemical evolution of the medium.When proceeding at close to its maximum rate,
coagulation has important consequences for the degree of ionization and the
ionic composition of the medium, but its effect on the freeze--out of the
neutral species is modest.An innovation of our study is to calculate the grain
charge distribution which is significant because H+ ions recombine on the
surfaces of negatively charged grains. We also consider the observational
result that N-containing species, such as NH3 and N2H+,remain in the gas phase
at densities for which CO and other C--containing molecules appear to have
frozen on to grain surfaces. We conclude that recent measurements of the
adsorption energies of N2 and CO invalidate the interpretation of these
observations in terms of the relative volatilities of N2 and CO. We consider an
alternative explanation,in terms of low sticking coefficients for either
molecular or atomic N. We find that, irrespective of the nitrogen chemistry,the
main gas phase ion is either H+ or H3+ (and its deuterated isotopes) at
densities above 10^5; whether H+ or H3+ predominates depends sensitively on the
rate of increase in grain size (decrease in grain surface area per unit volume
of gas) during core contraction.Our calculations show that H+ will predominate
if grain coagulation proceeds at close to its maximum rate, and H3+ otherwise.
