The relation between the flux of temperature (or buoyancy), the vertical temperature gradient and the height above the bottom is investigated in an oceanographic context, using high-resolution temperature measurements. The model for the evolution of a stratified layer by Balmforth et al. (J. Fluid Mech., vol. 355, 1998, pp. 329–358) is reviewed and adapted to the case of a turbulent flow above a wall. Model predictions are compared with the average observational estimates of the flux, exploiting a flux estimation method proposed by Winters & D’Asaro (J. Fluid Mech., vol. 317, 1996, pp. 179–193). This estimation method enables the disentanglement of the dependence of the average flux on the height above the bottom and on the background temperature gradient. The classical N-shaped flux–gradient relation is found in the observations. The model and the observations show similar qualitative behaviour, despite the strong simplifications used in the model. The results shed light on the modulation of the temperature flux by the presence of the boundary, and support the idea of a turbulent flux following a mixing-length argument in a stratified flow. Furthermore, the results support the use of Thorpe scales close to a boundary, if sufficient averaging is performed, suggesting that the Thorpe scales are affected by the boundary in a similar way to the mixing length.