function phi_galerk_modelA(phi, V, t, dt, lambda, r, g, k, xstep, T, D)
    noise = sqrt(T * dt / xstep) * sampler(size(phi))
    d = length(size(phi))
    R = CartesianIndices(phi)
    out = similar(phi)
    @. out = (phi - dt * (g * phi^2 + r + lambda * V[1]) * phi + noise)
    out = fft(out)
    for I in R
        out[I] = 1.0 / (1.0 + dt * sum([k[I[i]]^2 for i = 1:d])) * out[I]
    end
    out = ifft(out)
    @. phi = real(out)
end

#t =0.0
#r = 0.1
#g = 0.0
#D = 1.0
#T = 1.0
#lambda = 0.0
#@btime phi_galerk_modelA(phi, V, t, dt, lambda, r, g, k, xstep, T, D)
