Solution (source code)

= Solution

Let $B_0=\overline{w'b'}$ be the <vertical turbulent buoyancy flux>, positive for heating from below. Its dimensions are length squared per time cubed. The stress velocity and height therefore admit a new dimensionless group $B_0z/u_*^3$. Define the signed <Obukhov length>
$$
\boxed{\ell_O=-\frac{u_*^3}{\kappa B_0},\qquad \zeta=z/\ell_O.}
$$
Stable cooling has $B_0<0,\ell_O>0$; unstable heating has $B_0>0,\ell_O<0$. <Monin-Obukhov similarity theory> expresses the mean shear as
$$
\boxed{\frac{dU}{dz}=\frac{u_*}{\kappa z}\phi_m(\zeta),\qquad \phi_m(0)=1.}
$$
The similarity hypothesis assumes approximately steady, horizontally homogeneous, constant-stress and constant-flux conditions, with the observation level outside the inner sublayer but below the outer-layer scales. Dimensional analysis fixes the arguments and prefactor, not the entire function $\phi_m$. A measured or modeled turbulence closure supplies its form.