Calculating catchment area with divergent flow based on a regular grid