The time-variable coastal upwelling during CODE 2 is simulated using a mixing-advection coupled model. The agreement between model results and observations is generally good. During periods of strong equatorward wind stress, shelf water is cold and weakly stratified, and a front moves offshore; during periods of wind relaxation, surface temperature rises markedly, but the subsurface front usually does not go back toward the coast. At the onset of each wind event, a quick cooling of the surface layer is first caused by wind mixing followed closely by offshore advection of upwelled cold water. Due to the combined effect of mixing and advection, convergence occurs at the shoreward side and divergence occurs at the seaward side of the front. Consequently, a double-cell circulation is formed.