thanks for diving in so deep into the code.
The subcatchment procedure in
routing_sub.py is a subprocedure of routing_kinematic.py to find out if a grid cell is a sub-catchment of another grid-cell.
The catchment and the sub-catchment procedures are used:
- to specify the catchment you want to model e.g. if you put a coordinate into MaskMap, the model calculates the catchment which belongs to that point
- to check the lake and reservoir map and dismiss cells in a lake/reservoir which has the same ID as the outlet point of a lake/res but are not in the same catchment.
Maybe you can explain what you want to do? What is your original problem?