BUG: bad gradient.f90 wrapper