A comprehensive surface-groundwater flow model