diff --git a/R/RunModel.Supervisor.R b/R/RunModel.Supervisor.R index e28e79aa2b37ac8637dfbedebd70c1814a57a77c..5dd28fa70ad9cc83c3745feb2889c0db9f79079d 100644 --- a/R/RunModel.Supervisor.R +++ b/R/RunModel.Supervisor.R @@ -160,7 +160,11 @@ RunModel.Supervisor <- function(x, RunOptions, Param, ...) { for (id in SD_Ids) { StateEnd <- x$OutputsModel[[id]]$StateEnd - x$OutputsModel[[id]] <- OutputsModelGR[[id]] + if (inherits(x$InputsModel[[id]], "GR")) { + x$OutputsModel[[id]] <- OutputsModelGR[[id]] + } else { + x$OutputsModel[[id]]$DatesR <- x$InputsModel[[1]]$DatesR[IndPeriod_Run] + } for (outputVar in outputVars[[id]]) { x$OutputsModel[[id]][[outputVar]] <- x$storedOutputs[[outputVar]][, id] } diff --git a/man-examples/RunModel.Supervisor.R b/man-examples/RunModel.Supervisor.R index 49ba3988cabfe0fead217c892860ef04ac47151d..55995bcce7346bf54f1b338898a06b67931c8c46 100644 --- a/man-examples/RunModel.Supervisor.R +++ b/man-examples/RunModel.Supervisor.R @@ -108,14 +108,4 @@ OM_dam <- RunModel(sv, Param = P_severn) # Plotting the time series of flows and reservoir storage -oldpar <- par(mfrow=c(2,1), - mar = c(2,3.3,1.2,0.5), - mgp = c(2,1,0)) -plot(attr(OM_dam, "Qm3s")[, c("DatesR", "54095", "Dam", "54057")], - ylim = c(0, 200)) -Vres <- as.Qm3s(DatesR = OM_dam$Dam$DatesR, - "Simulated volume" = OM_dam$Dam$Vsim / 1E6) -plot(Vres, - main = "Simulated reservoir storage", - ylab = expression("Storage (Mm" ^ "3" * ")")) -par(oldpar) +plot(OM_dam$Dam) diff --git a/man/RunModel.GR.Rd b/man/RunModel.GR.Rd index 8731eaa72237a52b28a539013670ae7eca555449..d2dfb30d13af6d148afda93b06336149169cbe98 100644 --- a/man/RunModel.GR.Rd +++ b/man/RunModel.GR.Rd @@ -21,9 +21,10 @@ If \code{InputsModel} parameter has been created for using a semi-distributed (SD) lag model (See \code{\link[airGR]{CreateInputsModel}}), the list value contains an extra item named \code{QsimDown} which is a numeric series of simulated discharge [mm/time step] related to the run-off contribution of the downstream sub-catchment. } \description{ -Function which performs a single model run with the provided function over the selected period. +Run ONLY the rainfall-runoff model, upstream flow routing and Diversions are +not processed. } \details{ -This function runs \link[airGR:RunModel]{airGR::RunModel} and add an item \code{Qsim_m3} to the returned -\emph{OutputsModel} object. +This function runs \link[airGR:RunModel]{airGR::RunModel} (without lag) and add an item \code{Qsim_m3} +to the returned \emph{OutputsModel} object. } diff --git a/man/RunModel.Supervisor.Rd b/man/RunModel.Supervisor.Rd index ee26829f2083ba345d1e189991c838183b6ecbac..8adb2ac8862c8a2d6277850cf020aa5ce462c67c 100644 --- a/man/RunModel.Supervisor.Rd +++ b/man/RunModel.Supervisor.Rd @@ -132,15 +132,5 @@ OM_dam <- RunModel(sv, Param = P_severn) # Plotting the time series of flows and reservoir storage -oldpar <- par(mfrow=c(2,1), - mar = c(2,3.3,1.2,0.5), - mgp = c(2,1,0)) -plot(attr(OM_dam, "Qm3s")[, c("DatesR", "54095", "Dam", "54057")], - ylim = c(0, 200)) -Vres <- as.Qm3s(DatesR = OM_dam$Dam$DatesR, - "Simulated volume" = OM_dam$Dam$Vsim / 1E6) -plot(Vres, - main = "Simulated reservoir storage", - ylab = expression("Storage (Mm" ^ "3" * ")")) -par(oldpar) +plot(OM_dam$Dam) }