# Filling the H, B and A blocks

The H block is filled at the same time as the RANGE list. Some -1 values are placed in this H block, at locations (i, j).

During the first step:

• The column j is given through the downstream reach of the loop
• The line i is given through the negative reach belonging to the same line of the REACH array.

Ex:

=> H(3,5) = -1

=> H(3,4) = -1

=> H(1,2) = -1

During the second step (if any):

• The column j is given through the positive reach
• The line i is given through the negative reach belonging to the same line of the REACH array.

The B block is filled with the equality relations between the water elevations at the distributory nodes. Each line of the REACH array is analyzed and we keep the free pairs of positive reaches.

REACH :
Line 136-2Line 25-4 Pairs [3 , 6] and [2 , 4]Line 324

The B block is filled from the bottom. One relation is written for each i line of the B block. The reaches indicates the j columns.

At the last line (i = 5, the loop contains 5 reaches), is written the equality relation between the water elevations at the upstream node of reaches 3 and 6.

=>

At the last but one line (i = 4), is written the equality relation between the water elevations at the upstream node of reaches 2 and 4.

=>

The A block is filled with the discharge continuity equations at the nodes that are not downstream node of a loop.

One i line of the A block corresponds to each line of the REACH array. The j column is given thanks to the reach.

The line i=1 of the A block corresponds to the first line of the REACH array.

Positive reach n°3 => RANGE(j)=3 => j=5 => A(1,5)=1
Positive reach n°6 => RANGE(j)=6 => j=4 => A(1,4)=1
Negative reach n°2 => RANGE(j)=2 => j=3 => A(1,3)=-1

The line i=2 of the A block corresponds to the second line of the REACH array.

Positive reach n°5 => RANGE(j)=5 => j=2 => A(2,2)=1
Negative reach n°4 => RANGE(j)=4 => j=1 => A(2,1)=-1

The line i=3 of the A block corresponds to the third line of the REACH array.

Positive reach n°2 => RANGE(j)=2 => j=3 => A(3,3)=1
Positive reach n°4 => RANGE(j)=4 => j=1 => A(3,1)=1

We have just examined how the model takes into account the network topology. We must now examine how to characterize the geometry of the reaches, basic element of all hydraulic calculations.