Commit 083e9fdf authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

style: format comments in CreateCalibOptions

Showing with 12 additions and 12 deletions
+12 -12
...@@ -21,7 +21,7 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -21,7 +21,7 @@ CreateCalibOptions <- function(FUN_MOD,
if (!is.logical(IsSD) | length(IsSD) != 1L) { if (!is.logical(IsSD) | length(IsSD) != 1L) {
stop("'IsSD' must be a logical of length 1") stop("'IsSD' must be a logical of length 1")
} }
##check_FUN_MOD ## check FUN_MOD
BOOL <- FALSE BOOL <- FALSE
if (identical(FUN_MOD, RunModel_GR4H)) { if (identical(FUN_MOD, RunModel_GR4H)) {
...@@ -87,7 +87,7 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -87,7 +87,7 @@ CreateCalibOptions <- function(FUN_MOD,
return(NULL) return(NULL)
} }
##check_FUN_CALIB ## check FUN_CALIB
BOOL <- FALSE BOOL <- FALSE
if (identical(FUN_CALIB, Calibration_Michel)) { if (identical(FUN_CALIB, Calibration_Michel)) {
...@@ -100,9 +100,9 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -100,9 +100,9 @@ CreateCalibOptions <- function(FUN_MOD,
} }
##check_FUN_TRANSFO ## check FUN_TRANSFO
if (is.null(FUN_TRANSFO)) { if (is.null(FUN_TRANSFO)) {
##_set_FUN1 ## set FUN1
if (identical(FUN_MOD, RunModel_GR4H) | if (identical(FUN_MOD, RunModel_GR4H) |
identical(FUN_MOD, RunModel_CemaNeigeGR4H)) { identical(FUN_MOD, RunModel_CemaNeigeGR4H)) {
FUN_GR <- TransfoParam_GR4H FUN_GR <- TransfoParam_GR4H
...@@ -140,17 +140,17 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -140,17 +140,17 @@ CreateCalibOptions <- function(FUN_MOD,
stop("'FUN_GR' was not found") stop("'FUN_GR' was not found")
return(NULL) return(NULL)
} }
##_set_FUN2 ## set FUN2
if (IsHyst) { if (IsHyst) {
FUN_SNOW <- TransfoParam_CemaNeigeHyst FUN_SNOW <- TransfoParam_CemaNeigeHyst
} else { } else {
FUN_SNOW <- TransfoParam_CemaNeige FUN_SNOW <- TransfoParam_CemaNeige
} }
##_set_FUN_LAG ## set FUN_LAG
if (IsSD) { if (IsSD) {
FUN_LAG <- TransfoParam_Lag FUN_LAG <- TransfoParam_Lag
} }
##_set_FUN_TRANSFO ## set FUN_TRANSFO
if (sum(ObjectClass %in% c("GR4H", "GR5H", "GR4J", "GR5J", "GR6J", "GR2M", "GR1A", "CemaNeige")) > 0) { if (sum(ObjectClass %in% c("GR4H", "GR5H", "GR4J", "GR5J", "GR6J", "GR2M", "GR1A", "CemaNeige")) > 0) {
if (!IsSD) { if (!IsSD) {
FUN_TRANSFO <- FUN_GR FUN_TRANSFO <- FUN_GR
...@@ -252,7 +252,7 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -252,7 +252,7 @@ CreateCalibOptions <- function(FUN_MOD,
return(NULL) return(NULL)
} }
##NParam ## NParam
if ("GR4H" %in% ObjectClass) { if ("GR4H" %in% ObjectClass) {
NParam <- 4 NParam <- 4
} }
...@@ -299,7 +299,7 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -299,7 +299,7 @@ CreateCalibOptions <- function(FUN_MOD,
NParam <- NParam + 1 NParam <- NParam + 1
} }
##check_FixedParam ## check FixedParam
if (is.null(FixedParam)) { if (is.null(FixedParam)) {
FixedParam <- rep(NA, NParam) FixedParam <- rep(NA, NParam)
} else { } else {
...@@ -317,7 +317,7 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -317,7 +317,7 @@ CreateCalibOptions <- function(FUN_MOD,
} }
} }
##check_SearchRanges ## check SearchRanges
if (is.null(SearchRanges)) { if (is.null(SearchRanges)) {
ParamT <- matrix(c(rep(-9.99, NParam), rep(+9.99, NParam)), ParamT <- matrix(c(rep(-9.99, NParam), rep(+9.99, NParam)),
ncol = NParam, byrow = TRUE) ncol = NParam, byrow = TRUE)
...@@ -341,7 +341,7 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -341,7 +341,7 @@ CreateCalibOptions <- function(FUN_MOD,
} }
} }
##check_StartParamList_and_StartParamDistrib__default_values ## check StartParamList and StartParamDistrib default values
if (("HBAN" %in% ObjectClass & is.null(StartParamList) & is.null(StartParamDistrib))) { if (("HBAN" %in% ObjectClass & is.null(StartParamList) & is.null(StartParamDistrib))) {
if ("GR4H" %in% ObjectClass) { if ("GR4H" %in% ObjectClass) {
ParamT <- matrix(c(+5.12, -1.18, +4.34, -9.69, ParamT <- matrix(c(+5.12, -1.18, +4.34, -9.69,
...@@ -440,7 +440,7 @@ CreateCalibOptions <- function(FUN_MOD, ...@@ -440,7 +440,7 @@ CreateCalibOptions <- function(FUN_MOD,
} }
##check_StartParamList_and_StartParamDistrib__format ## check StartParamList and StartParamDistrib format
if ("HBAN" %in% ObjectClass & !is.null(StartParamList)) { if ("HBAN" %in% ObjectClass & !is.null(StartParamList)) {
if (!is.matrix(StartParamList)) { if (!is.matrix(StartParamList)) {
stop("'StartParamList' must be a matrix") stop("'StartParamList' must be a matrix")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment