A FORTRAN program for profile and wavefront reduction