A multigrid method for linear systems arising from time