Diurnal variations of density and scale height in the upper atmosphere