  Earth likely acquired much of its inventory of volatile elements during the
main stage of its formation. Some of Earth's proto-atmosphere must therefore
have survived the giant impacts, collisions between planet-sized bodies, that
dominate the latter phases of accretion. Here we use a suite of 1D hydrodynamic
simulations and impedance match calculations to quantify the effect that
pre-impact surface conditions (such as atmospheric pressure and presence of an
ocean) have on the efficiency of atmospheric and ocean loss from proto-planets
during giant impacts. We find that -- in the absence of an ocean -- lighter,
hotter, and lower-pressure atmospheres are more easily lost. The presence of an
ocean can significantly increase the efficiency of atmospheric loss compared to
the no-ocean case, with a rapid transition between low and high loss regimes as
the mass ratio of atmosphere to ocean decreases. However, contrary to previous
thinking, the presence of an ocean can also reduce atmospheric loss if the
ocean is not sufficiently massive, typically less than a few times the
atmospheric mass. Volatile loss due to giant impacts is thus highly sensitive
to the surface conditions on the colliding bodies. To allow our results to be
combined with 3D impact simulations, we have developed scaling laws that relate
loss to the ground velocity and surface conditions. Our results demonstrate
that the final volatile budgets of planets are critically dependent on the
exact timing and sequence of impacts experienced by their precursor planetary
embryos, making atmospheric properties a highly stochastic outcome of
accretion.
