%function export_coeffs(filename, array, dir)
%
%dir: 'f' - forward, 'r' - reverse

function export_coeffs(filename, array, dir)

fid=fopen(filename,'w');

if (dir == 'r')
     fprintf(fid,' %18.12e,\n',array(end:-1:1));
end

if (dir == 'f')
     fprintf(fid,' %18.12e,\n',array);
end

fclose(fid);
