 Let's look at the variation of the planetary boundary layer over the course of a typical day. We'll start midday when the sun is out and solar heating of the surface is causing buoyant air parcels to rise until the virtual potential temperature matches that of the overlying air. These air parcels have momentum and they overshoot the level of neutral buoyancy. In the process, they entrain air from the free troposphere. Clouds form in this layer. The rising air parcels collide with the air above them and rub against the air around them, producing a whole range of different eddy sizes in mixing. These large buoyant eddies cycle in tens of minutes, mixing the air. As the sun sets later in the day, there is less solar energy to power the convection that stirs the mixed layer. And the boundary layer collapses, leaving behind a residual layer that contains the mixed layer air that was left over. Emissions from the surface keep pouring into the boundary layer, but the boundary layer height is much lower. With less turbulence in the residual layer, the air can speed up. The faster moving air above the slower moving air in the boundary layer causes a shear to develop between the two air masses, and sporadically, turbulence is generated when the shear breaks down, mixing air and increasing the boundary layer height. At sunrise, solar heating again begins to warm the surface, and the warm parcels rise up, and training residual layer air, until eventually the mixed layer reaches its maximum height again.