A semi-Lagrangian double Fourier method for the shallow water equations on the sphere