Title: A self consistent calculation of the dissociation of oxygen in the upper atmosphere