Notes on a theory of the thermocline