Solar and solar wind energy drivers for O+ and O2+ ion escape at Mars