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

v1.2.8.1 CLEAN: typo revision in TransfoParam_CemaNeige* fun

parent 020ae847
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.8.0
Version: 1.2.8.1
Date: 2019-03-06
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -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) {
## number of model parameters
NParam <- 2L
## check_arguments
Bool <- is.vector(ParamIn)
if (Bool) {
isVecParamIn <- is.vector(ParamIn)
if (isVecParamIn) {
ParamIn <- matrix(ParamIn, nrow = 1)
}
if (!inherits(ParamIn, "matrix")) {
......@@ -20,6 +20,7 @@ TransfoParam_CemaNeige <- function(ParamIn, Direction) {
}
## transformation
if (Direction == "TR") {
ParamOut <- ParamIn
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) {
ParamOut[, 2] <- log(ParamIn[, 2] * 200) ### CemaNeige X2 (degree-day melt coefficient)
}
if (Bool) {
if (isVecParamIn) {
ParamOut <- as.vector(ParamOut)
}
......
TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
## number of model parameters
NParam <- 4L
## check_arguments
Bool <- is.vector(ParamIn)
if (Bool) {
isVecParamIn <- is.vector(ParamIn)
if (isVecParamIn) {
ParamIn <- matrix(ParamIn, nrow = 1)
}
if (!inherits(ParamIn, "matrix")) {
......@@ -20,6 +20,7 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
}
## transformation
if (Direction == "TR") {
ParamOut <- ParamIn
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) {
ParamOut[, 4] <- (ParamIn[, 4] - 0.5) * 19.98 ### Hyst CV
}
if (Bool) {
if (isVecParamIn) {
ParamOut <- as.vector(ParamOut)
}
......
Markdown is supported
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