Ungauged node: crash on diversion to node outside the sub-network
In the case of an ungauged node which is also a Diversion to a node located outside the sub-network containing the ungauged nodes and the gauged donor node, the calibration crashes with the following error:
Error in InputsModel$Qupstream[Runoptions$IndPeriod_Run, i] <- OutputsModel[[InputsModel$UpstreamNodes[i]]][[InputsModel$UpstreamVarQ[i]]] :
number of items to replace is not a multiple of replacement length
Here below a simple case study that rises this error:
graph LR
id_54032[54032]
id_54001[54001]
id_54095[54095]
id_54095[54095]
id_54001 -->| 45 km| id_54032
id_54095 -->| 42 km| id_54001
id_54095 -->| 100 km| id_54032
class id_54032,id_54001 IntermediateGauged
class id_54095,id_54095 UpstreamUngaugedDiversion
classDef default stroke:#333
classDef UpstreamUngauged fill:#eef
classDef UpstreamGauged fill:#aaf
classDef IntermediateUngauged fill:#efe
classDef IntermediateGauged fill:#afa
classDef DirectInjection fill:#faa
classDef Reservoir fill:#9de
classDef UpstreamUngaugedDiversion fill:#eef, stroke:#faa, stroke-width:3px
classDef UpstreamGaugedDiversion fill:#aaf, stroke:#faa, stroke-width:3px
classDef IntermediateUngaugedDiversion fill:#efe, stroke:#faa, stroke-width:3px
classDef IntermediateGaugedDiversion fill:#afa, stroke:#faa, stroke-width:3px
linkStyle 2 stroke:#faa, stroke-width:2px,stroke-dasharray: 5 5;