The assumption that surfaces of constant temperature and potential vorticity coincide leads to an exact, time-dependent reduction of the ideal thermocline equations in an ocean basin of arbitrary shape. After modifications to include forcing, dissipation, and the presence of the equator, these reduced equations form the basis for numerical models that are both more realistic and easier to solve than the conventional two-layer model.