Gibbs oscillations in the truncated spectral representation of the earth's topography are strongly reduced by determining its spectral coefficients as a minimum of a nonuniformly weighted, nonquadratic cost function. The cost function penalizes the difference between spectral and true topography with weights that are explicit functions of the topographic height and its gradient. The sensitivity of the Canadian Climate Centre general circulation model's climate to the presence of Gibbs oscillations is determined for T32 and T48 resolutions by comparing the climates with optimal spectral topography to those with standard spectral topography. The main effect of Gibbs oscillations in the standard spectral topography is to induce spurious grid-scale ripples in the surface fluxes, which, for the surface energy balance, can be on the order of several tens of watts per square meter. Ripples in the surface fluxes are nearly absent in the model climate with the optimal spectral topography.