Physics and ecology of the earth-atmosphere-ionosphere-magnetosphere system