Abstract. Observations, mixed-layer theory and the DutchLarge-Eddy Simulation model (DALES) are used to analyze the dynamics of the boundary layer during an intensive operational period (1 July 2011) of the Boundary Layer Late Afternoon and Sunset Turbulence campaign. Continuous measurements made by remote sensing and in situ instruments in combination with radio soundings, and measurements done by remotely piloted aircraft systems and two manned aircrafts probed the vertical structure and the temporal evolution of the boundary layer during the campaign. The initial vertical profiles of potential temperature, specific humidity and wind, and the temporal evolution of the surface heat and moisture fluxes prescribed in the models runs are inspired by some of these observations. The research focuses on the role played by the residual layer during the morning transition and by the large-scale subsidence on the evolution of the boundary layer. By using DALES, we show the importance of the dynamics of the boundary layer during the previous night in the development of the boundary layer at the morning. DALES numerical experiments including the residual layer are capable of modeling the observed sudden increase of the boundary-layer depth during the morning transition and the subsequent evolution of the boundary layer. These simulations show a large increase of the entrainment buoyancy flux when the residual layer is incorporated into the mixed layer. We also examine how the inclusion of the residual layer above a shallow convective boundary layer modifies the turbulent kinetic energy budget.Large-scale subsidence mainly acts when the boundary layer is fully developed, and, for the studied day, it is necessary to be considered to reproduce the afternoon observations.Finally, we also investigate how carbon dioxide (CO 2 ) mixing ratio stored the previous night in the residual layer plays a fundamental role in the evolution of the CO 2 mixing ratio during the following day.