Commit db8393d0 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.8.1 CLEAN: typo revision in TransfoParam_CemaNeige* fun

Showing with 12 additions and 10 deletions
+12 -10
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.8.0 Version: 1.2.8.1
Date: 2019-03-06 Date: 2019-03-06
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -13,7 +13,7 @@ output: ...@@ -13,7 +13,7 @@ output:
### 1.2.8.0 Release Notes (2019-03-06) ### 1.2.8.1 Release Notes (2019-03-06)
......
TransfoParam_CemaNeige <- function(ParamIn, Direction) { TransfoParam_CemaNeige <- function(ParamIn, Direction) {
## number of model parameters
NParam <- 2L NParam <- 2L
## check_arguments ## check_arguments
Bool <- is.vector(ParamIn) isVecParamIn <- is.vector(ParamIn)
if (Bool) { if (isVecParamIn) {
ParamIn <- matrix(ParamIn, nrow = 1) ParamIn <- matrix(ParamIn, nrow = 1)
} }
if (!inherits(ParamIn, "matrix")) { if (!inherits(ParamIn, "matrix")) {
...@@ -20,6 +20,7 @@ TransfoParam_CemaNeige <- function(ParamIn, Direction) { ...@@ -20,6 +20,7 @@ TransfoParam_CemaNeige <- function(ParamIn, Direction) {
} }
## transformation
if (Direction == "TR") { if (Direction == "TR") {
ParamOut <- ParamIn ParamOut <- ParamIn
ParamOut[, 1] <- (ParamIn[, 1] + 9.99) / 19.98 ### CemaNeige X1 (weighting coefficient for snow pack thermal state) ParamOut[, 1] <- (ParamIn[, 1] + 9.99) / 19.98 ### CemaNeige X1 (weighting coefficient for snow pack thermal state)
...@@ -31,7 +32,7 @@ TransfoParam_CemaNeige <- function(ParamIn, Direction) { ...@@ -31,7 +32,7 @@ TransfoParam_CemaNeige <- function(ParamIn, Direction) {
ParamOut[, 2] <- log(ParamIn[, 2] * 200) ### CemaNeige X2 (degree-day melt coefficient) ParamOut[, 2] <- log(ParamIn[, 2] * 200) ### CemaNeige X2 (degree-day melt coefficient)
} }
if (Bool) { if (isVecParamIn) {
ParamOut <- as.vector(ParamOut) ParamOut <- as.vector(ParamOut)
} }
......
TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) { TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
## number of model parameters
NParam <- 4L NParam <- 4L
## check_arguments ## check_arguments
Bool <- is.vector(ParamIn) isVecParamIn <- is.vector(ParamIn)
if (Bool) { if (isVecParamIn) {
ParamIn <- matrix(ParamIn, nrow = 1) ParamIn <- matrix(ParamIn, nrow = 1)
} }
if (!inherits(ParamIn, "matrix")) { if (!inherits(ParamIn, "matrix")) {
...@@ -20,6 +20,7 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) { ...@@ -20,6 +20,7 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
} }
## transformation
if (Direction == "TR") { if (Direction == "TR") {
ParamOut <- ParamIn ParamOut <- ParamIn
ParamOut[, 1] <- (ParamIn[, 1] + 9.99) / 19.98 ### CemaNeige X1 (weighting coefficient for snow pack thermal state) ParamOut[, 1] <- (ParamIn[, 1] + 9.99) / 19.98 ### CemaNeige X1 (weighting coefficient for snow pack thermal state)
...@@ -35,7 +36,7 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) { ...@@ -35,7 +36,7 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
ParamOut[, 4] <- (ParamIn[, 4] - 0.5) * 19.98 ### Hyst CV ParamOut[, 4] <- (ParamIn[, 4] - 0.5) * 19.98 ### Hyst CV
} }
if (Bool) { if (isVecParamIn) {
ParamOut <- as.vector(ParamOut) ParamOut <- as.vector(ParamOut)
} }
......
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