In this work we discuss the finite difference method of calculating the steady flows of an ideal incompressible fluid with surface waves in canals with complicated coastline, which have an entrance, an exit, and vertical impermeable walls. In the numerical solution we use the new dependent variables, viz. the stream function ψ and the vorticity ω. We discuss the problems of constructing the finite difference approximations on curvilinear nonorthogonal grids that adapt to a priori given function, organizing the iterative process, describing the geometry of a basin. We give the results of the calculation of the problem of the steady fluid flow with surface waves in a basin of complicated shape.