  In this paper we consider an initial-boundary value problem with a Caputo
time derivative of order $\alpha\in(0,1)$. The solution typically exhibits a
weak singularity near the initial time and this causes a reduction in the
orders of convergence of standard schemes. To deal with this singularity, the
solution is computed with a fitted difference scheme on a graded mesh. The
convergence of this scheme is analysed using a discrete maximum principle and
carefully chosen barrier functions. Sharp error estimates are proved, which
show an enhancement in the convergence rate compared with the standard L1
approximation on uniform meshes, and also indicate an optimal choice for the
mesh grading. This optimal mesh grading is less severe than the optimal grading
for the standard L1 scheme. Furthermore, the dependence of the error on the
final time forms part of our error estimate. Numerical experiments are
presented which corroborate our theoretical results.
