Influences of the Ionosphere, Thermosphere and Magnetosphere on Ion Outflows