which layer of the earth is where weather occurs