Computation of water-surface profiles in open channels