Hello Jean,
Actually in the wave equation the velocity is eliminated from the continuity equation, to get the depth. There is theoretically two differences with the primitive equations:
1) there must be mass-lumping of mass-matrix for velocity.
2) divergence of gradient) is really Laplacian in primitive equations, it is the diffusion matrix in wave equation (this is a reason for more stability, because this slight mistake will in fact smooth instabilities).
BUT, in version 6.1, there is an implicitation on depth that is set to 1 in wave equation (line TETAC = 1.D0 in lecdon_telemac2d.f), this may be also a reason why it is more stable. This will be removed in version 6.2, to enable more accurate computations of tsunamis.
The conjugate gradient has nothing to see with stability. It is just that with wave equation the matrix of the linear system to be solved is symmetric. With primitive equations it is not (and the system is much larger because it couples depth and velocity). In this latter case solvers like GMRES or normal equation must be used.
The message "ill-posed problem" occurs when you have at the exit velocities that enter the domain. It may happen with von Karman eddies or after a bend. It is just a warning, but sometimes these entering velocity may grow to infinity (they are free, so it is still a solution of Saint-Venant equations). Unless you see strange recirculations on the exit or crashes, you can discard the message.
With best regards,
Jean-Michel Hervouet