We present the error analysis of a B-spline based finite-element approximation of the stream-function formulation of the large scale wind-driven ocean circulation. In particular, we derive optimal error estimates for h-refinement using a Nitsche-type variational formulations of the two simplied linear models of the stationary quasigeostrophic equations, namely the Stommel and Stommel--Munk models. Numerical results on rectangular and embedded geometries confirm the error analysis