  Stellar flares present challenges to the potential habitability of
terrestrial planets orbiting M dwarf stars through inducing changes in the
atmospheric composition and irradiating the planet's surface in large amounts
of ultraviolet light. To examine their impact, we have coupled a general
circulation model with a photochemical kinetics scheme to examine the response
and changes of an Earth-like atmosphere to stellar flares and coronal mass
ejections. We find that stellar flares increase the amount of ozone in the
atmosphere by a factor of 20 compared to a quiescent star. We find that coronal
mass ejections abiotically generate significant levels of potential
bio-signatures such as N$_2$O. The changes in atmospheric composition cause a
moderate decrease in the amount of ultraviolet light that reaches the planets
surface, suggesting that while flares are potentially harmful to life, the
changes in the atmosphere due to a stellar flare act to reduce the impact of
the next stellar flare.
