  This is one of our series works on discrete energy analysis of the
variable-step BDF schemes. In this part, we present stability and convergence
analysis of the third-order BDF (BDF3) schemes with variable steps for linear
diffusion equations, see e.g. [SIAM J. Numer. Anal., 58:2294-2314] and [Math.
Comp., 90: 1207-1226] for our previous works on the BDF2 scheme. To this aim,
we first build up a discrete gradient structure of the variable-step BDF3
formula under the condition that the adjacent step ratios are less than 1.4877,
by which we can establish a discrete energy dissipation law. Mesh-robust
stability and convergence analysis in the $L^2$ norm are then obtained. Here
the mesh robustness means that the solution errors are well controlled by the
maximum time-step size but independent of the adjacent time-step ratios. We
also present numerical tests to support our theoretical results.
