BEGIN Initialize Define topography, initialize flow field, tracer distributions FOR each time step DO Forward Step Calculate velocity time derivatives Calculate tracer field time derivatives Step forward state variables Update density field Inversion Step Solve elliptic problem to ensure non-divergent flow.

END FOR END