airGRiwrm issueshttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues2024-03-03T10:41:10+01:00https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/143ConvertSD not allowing T < 0 °C2024-03-03T10:41:10+01:00Thirel GuillaumeConvertSD not allowing T < 0 °CconvertSD gives temperatures that are always >= 0 °C, with several values exactly equal to 0 °C.
See below an example with some personal data, I'll try to reproduce that with data from seineBasin2. It seems the argument temperature = T...convertSD gives temperatures that are always >= 0 °C, with several values exactly equal to 0 °C.
See below an example with some personal data, I'll try to reproduce that with data from seineBasin2. It seems the argument temperature = TRUE is not passed to other functions. See in https://gitlab.irstea.fr/in-wop/airGRiwrm/-/blob/dev/R/ConvertMeteoSD.R, `output <- lapply(id_runoff, ConvertMeteoSD, griwrm = x, meteo = meteo)` or
```r
output <- ConvertMeteoSD(
meteo[, upperIDs, drop = FALSE],
areas = areas
)
```
```
> griwrm
id down length model area
1 I5060001_ONDE I6201020_HYDRO&EDF 5.92 RunModel_CemaNeigeGR4J 98.68
2 I6122020_HYDRO&EDF I5060001_ONDE 2.55 RunModel_CemaNeigeGR4J 91.48
3 I6201020_HYDRO&EDF I6211020_HYDRO&EDF 10.29 RunModel_CemaNeigeGR4J 298.47
4 I6302020_HYDRO&EDF I6322010_HYDRO&EDF 5.88 RunModel_CemaNeigeGR4J 138.71
5 I6322010_HYDRO&EDF I6421030_HYDRO&EDF 17.45 RunModel_CemaNeigeGR4J 183.04
6 I6211020_HYDRO&EDF I5110200_RCS 13.91 RunModel_CemaNeigeGR4J 375.54
7 I5110200_RCS I6421030_HYDRO&EDF 14.40 RunModel_CemaNeigeGR4J 569.54
8 I6421030_HYDRO&EDF <NA> NA RunModel_CemaNeigeGR4J 1009.10
9 I6413010_HYDRO&EDF I6421030_HYDRO&EDF 10.93 RunModel_CemaNeigeGR4J 148.18
TempMean <- as.data.frame(ConvertMeteoSD(griwrm, TempTot, temperature = TRUE))
> summary(TempMean)
I5060001_ONDE I6122020_HYDRO&EDF I6201020_HYDRO&EDF I6302020_HYDRO&EDF I6322010_HYDRO&EDF I6211020_HYDRO&EDF
Min. : 0.000 Min. :-7.107 Min. : 0.000 Min. :-6.211 Min. : 0.000 Min. : 0.000
1st Qu.: 8.272 1st Qu.: 8.438 1st Qu.: 8.217 1st Qu.: 8.532 1st Qu.: 8.632 1st Qu.: 8.486
Median :11.891 Median :11.968 Median :11.821 Median :12.138 Median :12.240 Median :12.109
Mean :11.928 Mean :12.003 Mean :11.885 Mean :12.204 Mean :12.326 Mean :12.149
3rd Qu.:15.793 3rd Qu.:15.816 3rd Qu.:15.738 3rd Qu.:16.076 3rd Qu.:16.183 3rd Qu.:16.024
Max. :32.557 Max. :32.413 Max. :33.003 Max. :33.561 Max. :34.522 Max. :32.432
I5110200_RCS I6421030_HYDRO&EDF I6413010_HYDRO&EDF DatesR
Min. : 0.00 Min. : 0.000 Min. :-6.677 Min. :1951-01-01 00:00:00
1st Qu.: 8.58 1st Qu.: 8.656 1st Qu.: 8.595 1st Qu.:1988-07-01 12:00:00
Median :12.20 Median :12.267 Median :12.197 Median :2025-12-31 00:00:00
Mean :12.25 Mean :12.340 Mean :12.255 Mean :2025-12-31 00:00:00
3rd Qu.:16.15 3rd Qu.:16.210 3rd Qu.:16.149 3rd Qu.:2063-07-01 12:00:00
Max. :32.68 Max. :34.491 Max. :33.973 Max. :2100-12-31 00:00:00
```https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/136Ungauged nodes: crash with a reservoir and several upstrem nodes2023-07-03T10:51:45+02:00Dorchies DavidUngauged nodes: crash with a reservoir and several upstrem nodesThe calibration crashes with a reservoir with 2 upstream nodes with at least one ungauged:
```mermaid
graph LR
id_54001[54001]
id_54029[54029]
id_54032[54032]
id_Dam[Dam]
id_54001 -->| 45 km| id_Dam
id_54029 -->| 32 km| id_Dam
id_Da...The calibration crashes with a reservoir with 2 upstream nodes with at least one ungauged:
```mermaid
graph LR
id_54001[54001]
id_54029[54029]
id_54032[54032]
id_Dam[Dam]
id_54001 -->| 45 km| id_Dam
id_54029 -->| 32 km| id_Dam
id_Dam -->| 0 km| id_54032
class id_54001 UpstreamUngauged
class id_54029 UpstreamGauged
class id_54032 IntermediateGauged
class id_Dam Reservoir
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
```v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/135Ungauged nodes: X4 transformation not handled with CemaNeige models2023-06-20T15:26:18+02:00Dorchies DavidUngauged nodes: X4 transformation not handled with CemaNeige models`InputsModel$model$hasX4` is always set to `FALSE` in case of CemaNeige model and subsequently the X4 transformation is not handled for the ungauged nodes.`InputsModel$model$hasX4` is always set to `FALSE` in case of CemaNeige model and subsequently the X4 transformation is not handled for the ungauged nodes.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/134Crash with Hysteresis in Cemaneige2023-06-20T15:26:18+02:00Dorchies DavidCrash with Hysteresis in CemaneigeAs reported by @guillaume.thirel, Calibration crashes when using hysteresis in Cemaneige:
```r
OutputsCalib <- suppressWarnings(
+ Calibration(InputsModel, RunOptions, InputsCrit, CalibOptions))
Calibration.GRiwrmInputsModel: Processi...As reported by @guillaume.thirel, Calibration crashes when using hysteresis in Cemaneige:
```r
OutputsCalib <- suppressWarnings(
+ Calibration(InputsModel, RunOptions, InputsCrit, CalibOptions))
Calibration.GRiwrmInputsModel: Processing sub-basin 54057...
Grid-Screening in progress (0%Error in .ArgumentsCheckGR(InputsModel, RunOptions, Param) :
'Param' must be a vector of length 8 and contain no NA
In addition: There were 12 warnings (use warnings() to see them)
```
Reproductible example: [Severn_GR4JCemaNeigeHyst_semiglobal.R](/uploads/b3c3d704e673fee34d0131415404b414/Severn_GR4JCemaNeigeHyst_semiglobal.R)v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/130Ungauged node: Diversion to Reservoir crashes Calibration2024-03-28T08:30:59+01:00Dorchies DavidUngauged node: Diversion to Reservoir crashes CalibrationThe network below crashes either the donor is "54001" (by default) or "54029" (defined manually) with the error:
```
Error in InputsModel$Qupstream[Runoptions$IndPeriod_Run, i] <-
OutputsModel[[InputsModel$UpstreamNodes[i]]][[InputsMod...The network below crashes either the donor is "54001" (by default) or "54029" (defined manually) with the 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
```
```mermaid
graph LR
id_54032[54032]
id_54001[54001]
id_54095[54095]
id_54029[54029]
id_54095[54095]
id_Dam[Dam]
id_54001 -->| 45 km| id_54032
id_54095 -->| 42 km| id_54001
id_54029 -->| 32 km| id_54032
id_54095 -->| 10 km| id_Dam
id_Dam -->| 0 km| id_54029
class id_54032,id_54001,id_54029 IntermediateGauged
class id_54095,id_54095 UpstreamUngaugedDiversion
class id_Dam Reservoir
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 3 stroke:#faa, stroke-width:2px,stroke-dasharray: 5 5;
```v0.7.0https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/128Calibration: crash with a diverted ungauged node2023-05-12T14:44:09+02:00Dorchies DavidCalibration: crash with a diverted ungauged nodeThe network below results in the following error:
`
Error in InputsModel$Qupstream[Runoptions$IndPeriod_Run, i] <- OutputsModel[[InputsModel$UpstreamNodes[i]]][[InputsModel$UpstreamVarQ[i]]]:
le nombre d'objets à remplacer n'est pas mult...The network below results in the following error:
`
Error in InputsModel$Qupstream[Runoptions$IndPeriod_Run, i] <- OutputsModel[[InputsModel$UpstreamNodes[i]]][[InputsModel$UpstreamVarQ[i]]]:
le nombre d'objets à remplacer n'est pas multiple de la taille du remplacement
`
```mermaid
graph LR
id_54001[54001]
id_54095[54095]
id_Dam[Dam]
id_54095[54095]
id_54095 -->| 0 km| id_Dam
id_Dam -->| 42 km| id_54001
id_54095 -->| 42 km| id_54001
class id_54001 IntermediateGauged
class id_54095,id_54095 UpstreamUngaugedDiversion
class id_Dam Reservoir
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 0 stroke:#faa, stroke-width:2px,stroke-dasharray: 5 5;
```v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/127Ungauged node: Diversions are not handled correctly in Calibration2023-05-11T16:58:19+02:00Dorchies DavidUngauged node: Diversions are not handled correctly in CalibrationDuring calibration of ungauged nodes, airGRirwm create a sub-network that is used for calibrating the gauged node and the related ungauged nodes together.
If the original network contains Diversions, the sub-network forget to include Di...During calibration of ungauged nodes, airGRirwm create a sub-network that is used for calibrating the gauged node and the related ungauged nodes together.
If the original network contains Diversions, the sub-network forget to include Diversions located into it.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/126RunModel.Supervisor: error with Diversion node2023-05-11T14:23:21+02:00Dorchies DavidRunModel.Supervisor: error with Diversion nodeIf the GRiwrm object contains Diversion that are not adjoin to the "normal" node in the table, we face this kind of error:
```
Processing: 0%Error in FUN(X[[i]], ...) :
Node 54001 must be a Direct Injection or a Diversion node
```
I...If the GRiwrm object contains Diversion that are not adjoin to the "normal" node in the table, we face this kind of error:
```
Processing: 0%Error in FUN(X[[i]], ...) :
Node 54001 must be a Direct Injection or a Diversion node
```
Its due to an offset in the labels of the node properties list.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/125CreateGRiwrm: several Diversions on the same node do not raise error2023-05-11T13:25:06+02:00Dorchies DavidCreateGRiwrm: several Diversions on the same node do not raise errorTheoretically, it's not possible to have several Diversions on the same node. But CreateGRiwrm does not raise an error in this case.Theoretically, it's not possible to have several Diversions on the same node. But CreateGRiwrm does not raise an error in this case.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/124CreateInputsModel: wrong area of sub-basin with upstream Reservoir, Lag or Di...2023-05-11T11:22:10+02:00Dorchies DavidCreateInputsModel: wrong area of sub-basin with upstream Reservoir, Lag or Direct Injection nodesIf a sub-basin has an upstream node with a model running with `area=NA`, then the area of the sub-basin is miscalculated because it doesn't take into account the area of the basins upstream the node with `area=NA`.
Solution: we need to...If a sub-basin has an upstream node with a model running with `area=NA`, then the area of the sub-basin is miscalculated because it doesn't take into account the area of the basins upstream the node with `area=NA`.
Solution: we need to look upstream the node in order to take into account the area of more upstream nodes.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/123Calibration: crash with ungauged node and multiple Diversions2023-05-11T08:59:50+02:00Dorchies DavidCalibration: crash with ungauged node and multiple Diversionsv0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/122Calibration: Diversion is not handled on upstream nodes2023-04-29T18:02:27+02:00Dorchies DavidCalibration: Diversion is not handled on upstream nodesThe diversion is not taken into account during calibration at least on upstream nodes.
On this small example below, if we define a huge Diversion flow in the node "54095" in order to derive the totality of the flow, the node should not ...The diversion is not taken into account during calibration at least on upstream nodes.
On this small example below, if we define a huge Diversion flow in the node "54095" in order to derive the totality of the flow, the node should not be able to be calibrated because the resulting flow `Qsim` at the node "54095" should be zero.
```mermaid
graph LR
id_54001[54001]
id_54095[54095]
id_54095[54095]
id_54095 -->| 42 km| id_54001
class id_54001 IntermediateGauged
class id_54095,id_54095 UpstreamGaugedDiversion
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 0 stroke:#faa, stroke-width:2px,stroke-dasharray: 5 5;
```v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/117CreateSupervisor: wrong definition of allowed nodes for command2023-03-29T08:29:10+02:00Dorchies DavidCreateSupervisor: wrong definition of allowed nodes for commandThe list of nodes allowed for use as controller actuators or commands (the parameter `U` of `CreateController`), can be wrong if the network contains Diversion nodes.The list of nodes allowed for use as controller actuators or commands (the parameter `U` of `CreateController`), can be wrong if the network contains Diversion nodes.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/116getSD_Ids crashes on upstream nodes with Diversion2023-03-22T08:52:28+01:00Dorchies DavidgetSD_Ids crashes on upstream nodes with DiversionTodo:
- write a test
- fix the bug by removing Diversion from the griwrm object at the beginning of the process
- check get_no_SD_Ids as wellTodo:
- write a test
- fix the bug by removing Diversion from the griwrm object at the beginning of the process
- check get_no_SD_Ids as wellv0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/115Ungauged node: difference of ErrorCrit between Calibration and RunModel2023-02-24T19:05:58+01:00Dorchies DavidUngauged node: difference of ErrorCrit between Calibration and RunModelHow to reproduce:
- Calibrate a little network with at least one ungauged node
- Run the model after calibration
- Compute the same ErrorCrit as the one used for Calibration
- Compare the value of the ErrorCrit of the downstream donor n...How to reproduce:
- Calibrate a little network with at least one ungauged node
- Run the model after calibration
- Compute the same ErrorCrit as the one used for Calibration
- Compare the value of the ErrorCrit of the downstream donor node: they are different
This issue is not arising on this configuration:
```mermaid
graph LR
id_54032[54032]
id_54001[54001]
id_54095[54095]
id_54001 -->| 45 km| id_54032
id_54095 -->| 42 km| id_54001
class id_54032 IntermediateGauged
class id_54001 IntermediateUngauged
class id_54095 UpstreamGauged
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
```
But one experience it on the following cases:
```mermaid
graph LR
id_54032[54032]
id_54001[54001]
id_54029[54029]
id_54001 -->| 45 km| id_54032
id_54029 -->| 32 km| id_54032
class id_54032 IntermediateGauged
class id_54001 UpstreamGauged
class id_54029 UpstreamUngauged
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
```
```mermaid
graph LR
id_54032[54032]
id_54001[54001]
id_54095[54095]
id_54001 -->| 45 km| id_54032
id_54095 -->| 42 km| id_54001
class id_54032,id_54001 IntermediateGauged
class id_54095 UpstreamUngauged
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
```v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/114Ungauged node: crash on diversion to node outside the sub-network2023-02-24T15:40:47+01:00Dorchies DavidUngauged node: crash on diversion to node outside the sub-networkIn 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$Qup...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:
```mermaid
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;
```v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/113Ungauged node: crash with upstream Diversion node2023-02-22T15:28:14+01:00Dorchies DavidUngauged node: crash with upstream Diversion nodeIn case of an existing ungauged node in the model, the calibration process creates a sub-network containing the downstream gauged station, the ungauged stations and the upstream nodes providing the inflows from upstream. As these upstrea...In case of an existing ungauged node in the model, the calibration process creates a sub-network containing the downstream gauged station, the ungauged stations and the upstream nodes providing the inflows from upstream. As these upstream nodes are already calibrated, they just have to provide the flow previously simulated. Therefore, in the sub-network, they act as "Direct Injection" nodes.
The issue arises when one of these upstream nodes has a Diversion, we then get to source of inflows (the flow simulated in the river at the node and the diverted flow) to distribute in the sub-network and the current implementation is not able to distinguish them.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/110Ungauged node: incorrect definition of donor with Reservoir and bug with Dive...2023-02-08T14:10:33+01:00Dorchies DavidUngauged node: incorrect definition of donor with Reservoir and bug with Diversion nodesBug reported by Florian (https://forgemia.inra.fr/in-wop/seinebasin2/-/issues/40).
In case of a reservoir downstream, this one is selected as donor, which is a wrong selection. The next hydrological node downstream should be selected.
...Bug reported by Florian (https://forgemia.inra.fr/in-wop/seinebasin2/-/issues/40).
In case of a reservoir downstream, this one is selected as donor, which is a wrong selection. The next hydrological node downstream should be selected.
In case of a Diversion node downstream, this is one is correctly selected (A Diversion node contains a hydrological model), but apparently the calibration goes wrong.v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/108Calibration does not work when upstream catchments are both gauged and ungauged2022-11-28T10:29:39+01:00Thirel GuillaumeCalibration does not work when upstream catchments are both gauged and ungaugedFound by Léonard Santos
I used the ungauged calibration vignette and I set 54001 as gauged. For 54032, upstream 54001 is therefore gauged and 54029 is ungauged. Under this set up, calibration does not work.
Attached is the code for re...Found by Léonard Santos
I used the ungauged calibration vignette and I set 54001 as gauged. For 54032, upstream 54001 is therefore gauged and 54029 is ungauged. Under this set up, calibration does not work.
Attached is the code for reproducing the error.
```
Calibration.GRiwrmInputsModel: Treating sub-basin 54032...
Crit. KGE2[sqrt(Q)] = 0.9520
SubCrit. KGE2[sqrt(Q)] cor(sim, obs, "pearson") = 0.9601
SubCrit. KGE2[sqrt(Q)] cv(sim)/cv(obs) = 0.9997
SubCrit. KGE2[sqrt(Q)] mean(sim)/mean(obs) = 1.0268
Grid-Screening in progress (0%
Error in InputsModel$Qupstream[Runoptions$IndPeriod_Run, i] <- OutputsModel[[InputsModel$UpstreamNodes[i]]]$Qsim_m3 :
number of items to replace is not a multiple of replacement length
```
[bug_ungauged_calib.R](/uploads/ae1e7e87eac0c96a865a663c11cefcdb/bug_ungauged_calib.R)v0.7.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/107Allow to use node with model RunModel_Lag2022-11-27T10:04:52+01:00Dorchies DavidAllow to use node with model RunModel_LagThe easiest way to simulate nodes that represents canal outlets without impluvium should be to use a model RunModel_Lag to only transfer flows from upstream nodes without taking into account potential run-off.
Unfortunately using `RunMo...The easiest way to simulate nodes that represents canal outlets without impluvium should be to use a model RunModel_Lag to only transfer flows from upstream nodes without taking into account potential run-off.
Unfortunately using `RunModel_Lag` as a model, raises lot of issues which seems to be related to malfunctions on both airGRiwrm and airGR...
For example the following code based on the data available in the vignette Severn_01 crashes:
```r
db <- data.frame(id = c("54095", "DownLag"),
length = c(1, NA),
down = c("DownLag", NA),
area = as.double(c(3722.68, NA)),
model = c("RunModel_GR4J", "RunModel_Lag"),
stringsAsFactors = FALSE)
g <- CreateGRiwrm(db)
IM <- CreateInputsModel(g,
DatesR = DatesR,
Precip = Precip[, "54095", drop = FALSE],
PotEvap = PotEvap[, "54095", drop = FALSE])
```
```
CreateInputsModel.GRiwrm: Processing sub-basin 54095...
CreateInputsModel.GRiwrm: Processing sub-basin DownLag...
Error in if (BasinAreas[length(BasinAreas)] < 0) { :
missing value where TRUE/FALSE needed
```v0.7.0Dorchies DavidDorchies David