A finite element distributed catchment model, I. Analytical basis