Calibration does not work when upstream catchments are both gauged and ungauged
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