We use the lattice Boltzmann method as the basis for a three-dimensional, numerical ocean circulation model in a rectangular basin. The fundamental dynamical variables are the populations of mass- and buoyancy-particles with prescribed discrete velocities. The particles obey collision rules that correspond, on the macroscopic scale, to planetary geostrophic dynamics. The advantages of the model are simplicity, stability, and massively parallel construction. By the special nature of its construction, the lattice Boltzmann model resolves upwelling boundary layers and unsteady convection. Solutions of the model show many of the features predicted by ocean circulation theories.