Write out 1D files for gradient.