  We consider the initial boundary value problem for the inhomogeneous
time-fractional diffusion equation with a homogeneous Dirichlet boundary
condition and a nonsmooth right hand side data in a bounded convex polyhedral
domain. We analyze two semidiscrete schemes based on the standard Galerkin and
lumped mass finite element methods. Almost optimal error estimates are obtained
for right hand side data $f(x,t)\in L^\infty(0,T;\dot H^q(\Omega))$, $-1< q \le
1$, for both semidiscrete schemes. For lumped mass method, the optimal
$L^2(\Omega)$-norm error estimate requires symmetric meshes. Finally, numerical
experiments for one- and two-dimensional examples are presented to verify our
theoretical results.
