Shallow water modeling in spherical coordinates: equation formulation, numerical implementation, and application