def METHOD_NAME():
    tape = Tape()
    set_working_tape(tape)
    mesh = UnitSquareMesh(10, 10)
    V = FunctionSpace(mesh, "CG", 1)
    bc = DirichletBC(V, Constant(1), "on_boundary")
    #g = Function(V)
    x, y = SpatialCoordinate(mesh)
    g = project(sin(x)*sin(y), V, annotate=False)
    expr = sin(g*x)
    f = project(expr, V)
    u = TrialFunction(V)
    v = TestFunction(V)
    u_ = Function(V)
    a = inner(grad(u), grad(v))*dx
    L = f*v*dx
    solve(a == L, u_, bc)
    J = assemble(u_**2*dx)
    Jhat = ReducedFunctional(J, Control(g))
    h = Function(V)
    h.vector()[:] = rand(h.dof_dset.size)
    m = g.copy(deepcopy=True)
    g.block_variable.tlm_value = h
    tape.evaluate_tlm()
    assert (taylor_test(Jhat, m, h, dJdm=J.block_variable.tlm_value) > 1.9)