From 41bf02ddda436c034bb129ce89b516b6e1796b24 Mon Sep 17 00:00:00 2001 From: unknown <olivier.delaigue@ANPI1430.antony.irstea.priv> Date: Wed, 18 Jan 2017 08:50:27 +0100 Subject: [PATCH] v1.0.4.2 function Calibration_Michel() cleaned (message() function) --- DESCRIPTION | 2 +- R/Calibration_Michel.R | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 68420ade..1df26857 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGR Type: Package Title: Suite of GR hydrological models for precipitation-runoff modelling -Version: 1.0.4.1 +Version: 1.0.4.2 Date: 2017-01-18 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl")), diff --git a/R/Calibration_Michel.R b/R/Calibration_Michel.R index d5d154db..3f457930 100644 --- a/R/Calibration_Michel.R +++ b/R/Calibration_Michel.R @@ -228,13 +228,13 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions NRuns <- NRuns+nrow(CandidatesParamR) if (verbose) { if (Ncandidates > 1) { - message("\t Screening completed (", NRuns, " runs):") + message(sprintf("\t Screening completed (%s runs)", NRuns)) } if (Ncandidates == 1) { message("\t Starting point for steepest-descent local search:") } - message("\t Param = ", paste(formatC(ParamStartR, format = "f", width = 8, digits = 3), collapse = " , ")) - message("\t Crit ", format(CritName, width = 12, justify = "left"), " = ", formatC(CritStart*Multiplier, format = "f", digits = 4)) + message("\t Param = ", paste(sprintf("%8.3f", ParamStartR), collapse = " , ")) + message(sprintf("\t Crit %-12s = %.4f", CritName, CritStart*Multiplier)) } ##Results_archiving________________________________________________________ HistParamR[1, ] <- ParamStartR @@ -452,9 +452,9 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions CritFinal <- CritOptim NIter <- 1 + ITER if (verbose) { - message("\t Calibration completed (", NIter, " iterations, ", NRuns, " runs)") - message("\t Param = ", paste(formatC(ParamFinalR, format = "f", width = 8, digits = 3), collapse = " , ")) - message("\t Crit ", format(CritName, width = 12, justify = "left"), " = ", formatC(CritFinal*Multiplier, format = "f", digits = 4)) + message(sprintf("\t Calibration completed (%s iterations, %s runs)", NIter, NRuns)) + message("\t Param = ", paste(sprintf("%8.3f", ParamFinalR), collapse = " , ")) + message(sprintf("\t Crit %-12s = %.4f", CritName, CritFinal*Multiplier)) } ##Results_archiving_______________________________________________________ HistParamR <- cbind(HistParamR[1:NIter, ]) -- GitLab