diff --git a/NAMESPACE b/NAMESPACE index 138db937ab679c768065c17552e32dd0effebf62..c63da5247d87d1bb4c397d034ff35faf24281f0e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -38,7 +38,6 @@ export(ErrorCrit_NSE) export(ErrorCrit_RMSE) export(Imax) export(PE_Oudin) -export(PEdaily_Oudin) export(plot.OutputsModel) ### to remove from version 2.0 export(RunModel) export(RunModel_CemaNeige) diff --git a/R/Calibration.R b/R/Calibration.R index a66c78154e42b49ab80a61db832a6327da4dd962..3cce7b368bb73854c59f6a6ab2cd91af40731302 100644 --- a/R/Calibration.R +++ b/R/Calibration.R @@ -3,17 +3,15 @@ Calibration <- function(InputsModel, InputsCrit, CalibOptions, FUN_MOD, - FUN_CRIT, # deprecated FUN_CALIB = Calibration_Michel, FUN_TRANSFO = NULL, verbose = TRUE, ...) { FUN_MOD <- match.fun(FUN_MOD) - if (!missing(FUN_CRIT)) { - FUN_CRIT <- match.fun(FUN_CRIT) - } + FUN_CALIB <- match.fun(FUN_CALIB) + if (!is.null(FUN_TRANSFO)) { FUN_TRANSFO <- match.fun(FUN_TRANSFO) } diff --git a/R/Calibration_Michel.R b/R/Calibration_Michel.R index 462cd26185a8d7b89f69269b36e8a40389d0359e..854ab723146e860f20b7e884b7523b68a570cd05 100644 --- a/R/Calibration_Michel.R +++ b/R/Calibration_Michel.R @@ -3,16 +3,12 @@ Calibration_Michel <- function(InputsModel, InputsCrit, CalibOptions, FUN_MOD, - FUN_CRIT, # deprecated FUN_TRANSFO = NULL, verbose = TRUE, ...) { FUN_MOD <- match.fun(FUN_MOD) - if (!missing(FUN_CRIT)) { - FUN_CRIT <- match.fun(FUN_CRIT) - } # Handling 'FUN_TRANSFO' from direct argument or provided by 'CaliOptions' if (!is.null(FUN_TRANSFO)) { @@ -56,9 +52,6 @@ Calibration_Michel <- function(InputsModel, if (!inherits(CalibOptions, "HBAN")) { stop("'CalibOptions' must be of class 'HBAN' if 'Calibration_Michel' is used") } - if (!missing(FUN_CRIT)) { - warning("argument 'FUN_CRIT' is deprecated. The error criterion function is now automatically get from the 'InputsCrit' object") - } ##_variables_initialisation ParamFinalR <- NULL diff --git a/R/CreateInputsCrit.R b/R/CreateInputsCrit.R index 049e89a037ab60bcec6fc11b082bd324459e8143..04e02e7386b93903e0257a804c5c88b9ce7f319a 100644 --- a/R/CreateInputsCrit.R +++ b/R/CreateInputsCrit.R @@ -1,16 +1,13 @@ CreateInputsCrit <- function(FUN_CRIT, InputsModel, RunOptions, - Qobs, # deprecated Obs, VarObs = "Q", BoolCrit = NULL, transfo = "", Weights = NULL, - Ind_zeroes = NULL, # deprecated epsilon = NULL, - warnings = TRUE, - verbose = TRUE) { # deprecated + warnings = TRUE) { ObjectClass <- NULL @@ -18,25 +15,6 @@ CreateInputsCrit <- function(FUN_CRIT, ## ---------- check arguments - if (!missing(Qobs)) { - if (missing(Obs)) { - if (warnings) { - warning("argument 'Qobs' is deprecated. Please use 'Obs' and 'VarObs' instead") - } - Obs <- Qobs - # VarObs <- "Qobs" - } else { - warning("argument 'Qobs' is deprecated. The values set in 'Obs' will be used instead") - } - } - if (!missing(Ind_zeroes) & warnings) { - warning("deprecated 'Ind_zeroes' argument") - } - if (!missing(verbose)) { - warning("deprecated 'verbose' argument. Use 'warnings', instead") - } - - ## check 'InputsModel' if (!inherits(InputsModel, "InputsModel")) { stop("'InputsModel' must be of class 'InputsModel'") diff --git a/R/ErrorCrit.R b/R/ErrorCrit.R index e6ef4b4ef3f858c286e68cb680fb23ac191646fb..291337d967744bc7ec2dc3b2fee177a48a92478a 100644 --- a/R/ErrorCrit.R +++ b/R/ErrorCrit.R @@ -1,4 +1,4 @@ -ErrorCrit <- function(InputsCrit, OutputsModel, FUN_CRIT, warnings = TRUE, verbose = TRUE) { +ErrorCrit <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = TRUE) { ## ---------- Arguments check @@ -9,10 +9,6 @@ ErrorCrit <- function(InputsCrit, OutputsModel, FUN_CRIT, warnings = TRUE, verbo if (!inherits(OutputsModel, "OutputsModel")) { stop("OutputsModel must be of class 'OutputsModel'") } - if (!missing(FUN_CRIT)) { - warning("deprecated 'FUN_CRIT' argument. The error criterion function is now automatically get from the 'InputsCrit' object", call. = FALSE) - } - ## ---------- Criterion computation diff --git a/R/PEdaily_Oudin.R b/R/PEdaily_Oudin.R deleted file mode 100644 index 33472c886280417bb7ba0bf4619bfea29376f239..0000000000000000000000000000000000000000 --- a/R/PEdaily_Oudin.R +++ /dev/null @@ -1,119 +0,0 @@ -PEdaily_Oudin <- function(JD, - Temp, - LatRad, # deprecated - Lat, - LatUnit = c("rad", "deg")) { - - ## ---------- deprecated function - - .Deprecated(new = "PEdaily_Oudin", package = NULL, - - msg = "deprecated function\nplease, use PE_Oudin() instead", - - old = as.character(sys.call(sys.parent()))[1L]) - - ## ---------- check arguments - - if (!missing(LatRad)) { - warning("Deprecated \"LatRad\" argument. Please, use \"Lat\" instead.") - if (missing(Lat)) { - Lat <- LatRad - } - } - if (!(inherits(JD, "numeric") | inherits(JD, "integer"))) { - stop("'JD' must be of class 'numeric'") - } - if (!(inherits(Temp, "numeric") | inherits(Temp, "integer"))) { - stop("'Temp' must be of class 'numeric'") - } - if (length(JD) != length(Temp)) { - stop("'Temp' and 'LatUnit' must have the same length") - } - if (!any(LatUnit %in% c("rad", "deg"))) { - stop("'LatUnit' must be one of \"rad\" or \"deg\"") - } - if (!inherits(Lat, "numeric") | length(Lat) != 1) { - stop("'Lat' must be a 'numeric' of length one") - } - if (LatUnit[1L] == "rad" & ((Lat >= pi/2) | (Lat <= -pi/2))) { - stop("'Lat' must be comprised between -pi/2 and +pi/2 degrees") - } - if (LatUnit[1L] == "deg" & ((Lat >= 90) | (Lat <= -90))) { - stop("'Lat' must be comprised between -90 and +90 degrees") - } - if (LatUnit[1L] == "rad") { - FI <- Lat - } - if (LatUnit[1L] == "deg") { - FI <- Lat / (180 / pi) - } - if (any(JD < 0) | any(JD > 366)) { - stop("'JD' must only contain integers from 1 to 366") - } - - - ## ---------- Oudin's formula - - PE_Oudin_D <- rep(NA, length(Temp)) - COSFI <- cos(FI) - AFI <- abs(FI / 42) - - for (k in seq_along(Temp)) { - - TETA <- 0.4093 * sin(JD[k] / 58.1 - 1.405) - COSTETA <- cos(TETA) - COSGZ <- max(0.001, cos(FI - TETA)) - GZ <- acos(COSGZ) - COSOM <- 1 - COSGZ / COSFI / COSTETA - - if (COSOM < -1) { - COSOM <- -1 - } - if (COSOM > 1) { - COSOM <- 1 - } - - COSOM2 <- COSOM * COSOM - - if (COSOM2 >= 1) { - SINOM <- 0 - } else { - SINOM <- sqrt(1 - COSOM2) - } - - OM <- acos(COSOM) - COSPZ <- COSGZ + COSFI * COSTETA * (SINOM/OM - 1) - - if (COSPZ < 0.001) { - COSPZ <- 0.001 - } - - ETA <- 1 + cos(JD[k] / 58.1) / 30 - GE <- 446 * OM * COSPZ * ETA - - if (is.na(Temp[k])) { - PE_Oudin_D[k] <- NA - } else { - if (Temp[k] >= -5.0) { - PE_Oudin_D[k] <- GE * (Temp[k] + 5) / 100 / 28.5 - } else { - PE_Oudin_D[k] <- 0 - } - } - - } - - if (any(is.na(Temp))) { - if (any(is.na(PE_Oudin_D))) { - warning("'Temp' time series, and therefore the returned 'PE' time series, contain missing value(s)") - } else { - warning("'Temp' time series contains missing value(s)") - } - } - if (!any(is.na(Temp)) & any(is.na(PE_Oudin_D))) { - warning("returned 'PE' time series contains missing value(s)") - } - - return(PE_Oudin_D) - -} diff --git a/man/Calibration.Rd b/man/Calibration.Rd index 7368556f2202b4d24ecfbc9badb85d888fd3fd3c..65d8ee7a3fcd5f91e8d6a57408ae4c2ee285bb85 100644 --- a/man/Calibration.Rd +++ b/man/Calibration.Rd @@ -15,7 +15,7 @@ Calibration algorithm that optimises the error criterion selected as objective f \usage{ Calibration(InputsModel, RunOptions, InputsCrit, CalibOptions, - FUN_MOD, FUN_CRIT, FUN_CALIB = Calibration_Michel, + FUN_MOD, FUN_CALIB = Calibration_Michel, FUN_TRANSFO = NULL, verbose = TRUE, ...) } @@ -31,8 +31,6 @@ Calibration(InputsModel, RunOptions, InputsCrit, CalibOptions, \item{FUN_MOD}{[function] hydrological model function (e.g. \code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}})} -\item{FUN_CRIT}{[function] error criterion function (e.g. \code{\link{ErrorCrit_RMSE}}, \code{\link{ErrorCrit_NSE}})} - \item{FUN_CALIB}{(deprecated) [function] calibration algorithm function (e.g. \code{\link{Calibration_Michel}}), \code{default = Calibration_Michel}} \item{FUN_TRANSFO}{(optional) [function] model parameters transformation function, if the \code{FUN_MOD} used is native in the package \code{FUN_TRANSFO} is automatically defined} diff --git a/man/Calibration_Michel.Rd b/man/Calibration_Michel.Rd index 28de8c4424cc84889a83fdbd9a123d5329c7af3f..6befd8b0c9293d84e43fffe5490c594de3ddbd12 100644 --- a/man/Calibration_Michel.Rd +++ b/man/Calibration_Michel.Rd @@ -19,7 +19,7 @@ Then a steepest descent local search algorithm is performed, starting from the r \usage{ Calibration_Michel(InputsModel, RunOptions, InputsCrit, CalibOptions, - FUN_MOD, FUN_CRIT, FUN_TRANSFO = NULL, verbose = TRUE, ...) + FUN_MOD, FUN_TRANSFO = NULL, verbose = TRUE, ...) } @@ -34,8 +34,6 @@ Calibration_Michel(InputsModel, RunOptions, InputsCrit, CalibOptions, \item{FUN_MOD}{[function] hydrological model function (e.g. \code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}})} -\item{FUN_CRIT}{(deprecated) [function] error criterion function (e.g. \code{\link{ErrorCrit_RMSE}}, \code{\link{ErrorCrit_NSE}})} - \item{FUN_TRANSFO}{(optional) [function] model parameters transformation function, if the \code{FUN_MOD} used is native in the package \code{FUN_TRANSFO} is automatically defined} \item{verbose}{(optional) [boolean] boolean indicating if the function is run in verbose mode or not, default = \code{TRUE}} diff --git a/man/CreateInputsCrit.Rd b/man/CreateInputsCrit.Rd index eed50f03672fc974f63264c022db962ef7a30433..8debd8f93f11e75c27e5234d256d1008da987307 100644 --- a/man/CreateInputsCrit.Rd +++ b/man/CreateInputsCrit.Rd @@ -9,16 +9,16 @@ \description{ -Creation of the \code{InputsCrit} object required to the \code{ErrorCrit_*} functions. This function is used to define whether the user wants to calculate a single criterion, multiple criteria in the same time, or a composite criterion, which averages several criteria. +Creation of the \code{InputsCrit} object required to the \code{ErrorCrit_*} functions. This function is used to define whether the user wants to calculate a single criterion, multiple criteria in the same time, or a composite criterion, which averages several criteria. } \usage{ CreateInputsCrit(FUN_CRIT, InputsModel, RunOptions, - Qobs, Obs, VarObs = "Q", BoolCrit = NULL, + Obs, VarObs = "Q", BoolCrit = NULL, transfo = "", Weights = NULL, - Ind_zeroes = NULL, epsilon = NULL, - warnings = TRUE, verbose = TRUE) + epsilon = NULL, + warnings = TRUE) } @@ -29,8 +29,6 @@ CreateInputsCrit(FUN_CRIT, InputsModel, RunOptions, \item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details} -\item{Qobs}{(deprecated) [numeric (atomic or list)] series of observed discharges [mm/time step]} - \item{Obs}{[numeric (atomic or list)] series of observed variable ([mm/time step] for discharge or SWE, [-] for SCA)} \item{VarObs}{(optional) [character (atomic or list)] names of the observed variable (\code{"Q"} by default, or one of \code{"SCA"}, \code{"SWE"}])} @@ -41,13 +39,9 @@ CreateInputsCrit(FUN_CRIT, InputsModel, RunOptions, \item{Weights}{(optional) [numeric (atomic or list)] vector of weights necessary to calculate a composite criterion (the same length as \code{FUN_CRIT}) giving the weights to use for elements of \code{FUN_CRIT} [-]. See details} -\item{Ind_zeroes}{(deprecated) [numeric] indices of the time steps where zeroes are observed} - \item{epsilon}{(optional) [numeric (atomic or list)] small value to add to all observations and simulations when \code{"log"} or \code{"inv"} transformations are used [same unit as \code{Obs}]. See details} \item{warnings}{(optional) [boolean] boolean indicating if the warning messages are shown, default = \code{TRUE}} - -\item{verbose}{(deprecated) [boolean] boolean indicating if the function is run in verbose mode or not, default = \code{TRUE}} } @@ -62,9 +56,9 @@ CreateInputsCrit(FUN_CRIT, InputsModel, RunOptions, \emph{$epsilon } \tab [numeric] small value to add to all observations and simulations when \code{"log"} or \code{"inv"} transformations are used [same unit as \code{Obs}] \cr \emph{$Weights } \tab [numeric] vector (same length as \code{VarObs}) giving the weights to use for elements of \code{FUN_CRIT} [-] \cr } - + When \code{Weights = NULL}, \code{CreateInputsCrit} returns an object of class \emph{Single} that is a list such as the one described above. \cr -When \code{Weights} contains at least one \code{NULL} value and \code{Obs} contains a list of observations, \code{CreateInputsCrit} returns an object of class \emph{Multi} that is a list of lists such as the one described above. The \code{\link{ErrorCrit}} function will then compute the different criteria prepared by \code{CreateInputsCrit}. \cr +When \code{Weights} contains at least one \code{NULL} value and \code{Obs} contains a list of observations, \code{CreateInputsCrit} returns an object of class \emph{Multi} that is a list of lists such as the one described above. The \code{\link{ErrorCrit}} function will then compute the different criteria prepared by \code{CreateInputsCrit}. \cr When \code{Weights} is a list of at least 2 numerical values, \code{CreateInputsCrit} returns an object of class \emph{Compo} that is a list of lists such as the one described above. This object will be useful to compute composite criterion with the \code{\link{ErrorCrit}} function. \cr To calculate composite or multiple criteria, it is necessary to use the \code{ErrorCrit} function. The other \code{ErrorCrit_*} functions (e.g. \code{\link{ErrorCrit_RMSE}}, \code{\link{ErrorCrit_NSE}}) can only use objects of class \emph{Single} (and not \emph{Multi} or \emph{Compo}). \cr } @@ -84,7 +78,7 @@ Transformations are simple functions applied to the observed and simulated varia \item \code{""}: no transformation is used (default case) \item \code{"sqrt"}: squared root transformation \item \code{"log"}: logarithmic transformation (see below regarding the specific case of KGE or KGE2) - \item \code{"inv"}: inverse transformation + \item \code{"inv"}: inverse transformation \item \code{"sort"}: sort transformation (the simulated and observed variables are sorted from lowest to highest) \item \code{"boxcox"}: Box-Cox transformation (see below for details) \item numeric: power transformation (see below for details) @@ -114,15 +108,15 @@ library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, Precip = BasinObs$P, PotEvap = BasinObs$E) ## calibration period selection -Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"), +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"), which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31")) ## preparation of RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel, +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation @@ -144,7 +138,7 @@ InputsCritMulti <- CreateInputsCrit(FUN_CRIT = list(ErrorCrit_RMSE, ErrorCrit_NS Obs = list(BasinObs$Qmm[Ind_Run], BasinObs$Qmm[Ind_Run]), VarObs = list("Q", "Q"), transfo = list("", "sqrt"), Weights = NULL) -str(InputsCritMulti) +str(InputsCritMulti) invisible(ErrorCrit(InputsCrit = InputsCritMulti, OutputsModel = OutputsModel)) ## efficiency composite criterion: Nash-Sutcliffe Efficiency mixing @@ -154,7 +148,7 @@ InputsCritCompo <- CreateInputsCrit(FUN_CRIT = list(ErrorCrit_NSE, ErrorCrit_NSE Obs = list(BasinObs$Qmm[Ind_Run], BasinObs$Qmm[Ind_Run]), VarObs = list("Q", "Q"), transfo = list("", "log"), Weights = list(0.4, 0.6)) -str(InputsCritCompo) +str(InputsCritCompo) invisible(ErrorCrit(InputsCrit = InputsCritCompo, OutputsModel = OutputsModel)) } @@ -165,12 +159,12 @@ Olivier Delaigue, Laurent Coron, Guillaume Thirel \references{ -Pushpalatha, R., Perrin, C., Le Moine, N. and Andréassian, V. (2012). - A review of efficiency criteria suitable for evaluating low-flow simulations. +Pushpalatha, R., Perrin, C., Le Moine, N. and Andréassian, V. (2012). + A review of efficiency criteria suitable for evaluating low-flow simulations. Journal of Hydrology, 420-421, 171-182, doi: 10.1016/j.jhydrol.2011.11.055. \cr\cr -Santos, L., Thirel, G. and Perrin, C. (2018). - Technical note: Pitfalls in using log-transformed flows within the KGE criterion. +Santos, L., Thirel, G. and Perrin, C. (2018). + Technical note: Pitfalls in using log-transformed flows within the KGE criterion. Hydrol. Earth Syst. Sci., 22, 4583-4591, doi: 10.5194/hess-22-4583-2018. } diff --git a/man/ErrorCrit.Rd b/man/ErrorCrit.Rd index acb933c6b935ddb68b5ebdc23f6cbe7a736bf42c..f183997c7672c0e30692639d9a51903d03d58ef6 100644 --- a/man/ErrorCrit.Rd +++ b/man/ErrorCrit.Rd @@ -14,7 +14,7 @@ Function which computes an error criterion with the provided function. \usage{ -ErrorCrit(InputsCrit, OutputsModel, FUN_CRIT, warnings = TRUE, verbose = TRUE) +ErrorCrit(InputsCrit, OutputsModel, warnings = TRUE, verbose = TRUE) } @@ -23,8 +23,6 @@ ErrorCrit(InputsCrit, OutputsModel, FUN_CRIT, warnings = TRUE, verbose = TRUE) \item{OutputsModel}{[object of class \emph{OutputsModel}] see \code{\link{RunModel_GR4J}} or \code{\link{RunModel_CemaNeigeGR4J}} for details} -\item{FUN_CRIT}{(deprecated) [function] error criterion function (e.g. \code{\link{ErrorCrit_RMSE}}, \code{\link{ErrorCrit_NSE}})} - \item{warnings}{(optional) [boolean] boolean indicating if the warning messages are shown, default = \code{TRUE}} \item{verbose}{(optional) [boolean] boolean indicating if the function is run in verbose mode or not, default = \code{TRUE}} @@ -64,15 +62,15 @@ library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, Precip = BasinObs$P, PotEvap = BasinObs$E) ## calibration period selection -Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"), +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"), which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31")) ## preparation of RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel, +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation @@ -85,7 +83,7 @@ InputsCritSingle <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, RunOptions = RunOptions, Obs = list(BasinObs$Qmm[Ind_Run]), VarObs = "Q", transfo = "", - Weights = NULL) + Weights = NULL) str(ErrorCrit(InputsCrit = InputsCritSingle, OutputsModel = OutputsModel)) ## 2 efficiency critera: RMSE and the Nash-Sutcliffe Efficiency @@ -93,7 +91,7 @@ InputsCritMulti <- CreateInputsCrit(FUN_CRIT = list(ErrorCrit_RMSE, ErrorCrit_NS InputsModel = InputsModel, RunOptions = RunOptions, Obs = list(BasinObs$Qmm[Ind_Run], BasinObs$Qmm[Ind_Run]), VarObs = list("Q", "Q"), transfo = list("", "sqrt"), - Weights = NULL) + Weights = NULL) str(ErrorCrit(InputsCrit = InputsCritMulti, OutputsModel = OutputsModel)) ## efficiency composite criterion: Nash-Sutcliffe Efficiency mixing @@ -102,7 +100,7 @@ InputsCritCompo <- CreateInputsCrit(FUN_CRIT = list(ErrorCrit_NSE, ErrorCrit_NSE InputsModel = InputsModel, RunOptions = RunOptions, Obs = list(BasinObs$Qmm[Ind_Run], BasinObs$Qmm[Ind_Run]), VarObs = list("Q", "Q"), transfo = list("", "log"), - Weights = list(0.4, 0.6)) + Weights = list(0.4, 0.6)) str(ErrorCrit(InputsCrit = InputsCritCompo, OutputsModel = OutputsModel)) } diff --git a/man/PE_Oudin.Rd b/man/PE_Oudin.Rd index e5e8bb89c05e87e7ff921b52efd8bd218faa0ce1..ab1f96e50ca5a950ada564a7fd4fb64697463cd0 100644 --- a/man/PE_Oudin.Rd +++ b/man/PE_Oudin.Rd @@ -3,7 +3,6 @@ \name{PE_Oudin} \alias{PE_Oudin} -\alias{PEdaily_Oudin} \title{Computation of series of potential evapotranspiration at the daily or hourly time steps with Oudin's formula} @@ -13,9 +12,6 @@ PE_Oudin(JD, Temp, Lat, LatUnit = c("rad", "deg"), TimeStepIn = "daily", TimeStepOut = "daily", RunFortran = FALSE) - -## deprectated function -PEdaily_Oudin(JD, Temp, LatRad, Lat, LatUnit) } @@ -24,8 +20,6 @@ PEdaily_Oudin(JD, Temp, LatRad, Lat, LatUnit) \item{Temp}{[numeric] time series of daily (or hourly) mean air temperature [°C]} -\item{LatRad}{(deprecated)[numeric] latitude of measurement for the temperature series [radians]. Please use \code{Lat} instead} - \item{Lat}{[numeric] latitude of measurement for the temperature series [radians or degrees]. Atomic vector, except if \code{RunFortran = TRUE}, it can be a vector of the same length as \code{Temp}} \item{LatUnit}{[character] latitude unit (default = \code{"rad"} or \code{"deg"})} diff --git a/vignettes/V03_param_sets_GR4J.Rmd b/vignettes/V03_param_sets_GR4J.Rmd index 5409731a0187b2f8fcf33f8543af5fe1befa8f84..29e53e0df8fa0629ddbc9d62eb7b5dc50c42a701 100644 --- a/vignettes/V03_param_sets_GR4J.Rmd +++ b/vignettes/V03_param_sets_GR4J.Rmd @@ -82,7 +82,7 @@ Ind_Cal <- seq(which(format(BasinObs$DatesR, format = "%d/%m/%Y %H:%M")=="01/01/ ## preparation of the RunOptions object for the calibration period RunOptions_Cal <- CreateRunOptions(FUN_MOD = RunModel_GR4J, - InputsModel = InputsModel, IndPeriod_Run = Ind_Cal) + InputsModel = InputsModel, IndPeriod_Run = Ind_Cal) ## efficiency criterion: Nash-Sutcliffe Efficiency InputsCrit_Cal <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, @@ -101,8 +101,7 @@ RunOptions_Val <- CreateRunOptions(FUN_MOD = RunModel_GR4J, ## efficiency criterion (Nash-Sutcliffe Efficiency) on the validation period InputsCrit_Val <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, - RunOptions = RunOptions_Val, Obs = BasinObs$Qmm[Ind_Val]) - + RunOptions = RunOptions_Val, Obs = BasinObs$Qmm[Ind_Val]) ``` # Calibration of the GR4J model with the generalist parameter sets @@ -133,7 +132,8 @@ Param_Best <- unlist(Param_Sets_GR4J[which.max(OutputsCrit_Loop), ]) Param_Best ## validation -OutputsModel_Val <- RunModel_GR4J(InputsModel = InputsModel, RunOptions = RunOptions_Val, Param = Param_Best) +OutputsModel_Val <- RunModel_GR4J(InputsModel = InputsModel, RunOptions = RunOptions_Val, + Param = Param_Best) OutputsCrit_Val <- ErrorCrit_NSE(InputsCrit = InputsCrit_Val, OutputsModel = OutputsModel_Val) ``` @@ -162,7 +162,7 @@ CalibOptions <- CreateCalibOptions(FUN_MOD = RunModel_GR4J, FUN_CALIB = Calibrat ## calibration OutputsCalib <- Calibration(InputsModel = InputsModel, RunOptions = RunOptions_Cal, InputsCrit = InputsCrit_Cal, CalibOptions = CalibOptions, - FUN_MOD = RunModel_GR4J, FUN_CRIT = ErrorCrit_NSE, + FUN_MOD = RunModel_GR4J, FUN_CALIB = Calibration_Michel) OutputsModel_Cal <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions_Cal, Param = OutputsCalib$ParamFinalR, FUN = RunModel_GR4J) @@ -199,10 +199,10 @@ CalibOptions <- CreateCalibOptions(FUN_MOD = RunModel_GR4J, FUN_CALIB = Calibrat ## calibration OutputsCalib <- Calibration(InputsModel = InputsModel, RunOptions = RunOptions_Cal, InputsCrit = InputsCrit_Cal, CalibOptions = CalibOptions, - FUN_MOD = RunModel_GR4J, FUN_CRIT = ErrorCrit_NSE, + FUN_MOD = RunModel_GR4J, FUN_CALIB = Calibration_Michel) OutputsModel_Cal <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions_Cal, - Param = OutputsCalib$ParamFinalR, FUN = RunModel_GR4J) + Param = OutputsCalib$ParamFinalR, FUN = RunModel_GR4J) OutputsCrit_Cal <- ErrorCrit_NSE(InputsCrit = InputsCrit_Cal, OutputsModel = OutputsModel_Cal)