[1] Basal hydrology is acknowledged as a fundamental control on glacier dynamics, especially in cases where surface meltwater reaches the bed. For many glaciers at midlatitudes, basal drainage is influenced by subaerial, englacial, and subsurface water flow. One of the major shortcomings of existing basal hydrology models is the treatment of the glacier bed as an isolated system. We present theoretical and computational models that couple glacier surface runoff, englacial water storage and transport, subglacial drainage, and subsurface groundwater flow. Each of the four model components is represented as a two-dimensional, vertically integrated layer that communicates with its neighbors through water exchange. Governing equations are derived from the law of mass conservation and are expressed as a balance between the internal distribution of water and external sources. The numerical exposition of this theory is a time-dependent finite difference model that can be used to simulate glacier drainage. In this paper we outline the theory and conduct simple tests using an idealized glacier geometry. In the companion paper, the model is tailored to Trapridge Glacier, Yukon Territory, Canada, where results are compared with measurements of subglacial water pressure.