Direct and Indirect Thermospheric Heating Sources for Solar Cycles 21–23