Three-dimensional model of atoll hydrodynamics