  In this work, we analyze a Crank-Nicolson type time stepping scheme for the
subdiffusion equation, which involves a Caputo fractional derivative of order
$\alpha\in (0,1)$ in time. It hybridizes the backward Euler convolution
quadrature with a $\theta$-type method, with the parameter $\theta$ dependent
on the fractional order $\alpha$ by $\theta=\alpha/2$, and naturally
generalizes the classical Crank-Nicolson method. We develop essential initial
corrections at the starting two steps for the Crank-Nicolson scheme, and
together with the Galerkin finite element method in space, obtain a fully
discrete scheme. The overall scheme is easy to implement, and robust with
respect to data regularity. A complete error analysis of the fully discrete
scheme is provided, and a second-order accuracy in time is established for both
smooth and nonsmooth problem data. Extensive numerical experiments are provided
to illustrate its accuracy, efficiency and robustness, and a comparative study
also indicates its competitive with existing schemes.
