Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGR
Commits
cba36bf1
Commit
cba36bf1
authored
Mar 29, 2019
by
Delaigue Olivier
Browse files
v1.2.12.9 CLEAN check added in TransfoParam* funs
parent
da3856fd
Changes
10
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
cba36bf1
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.12.
8
Version: 1.2.12.
9
Date: 2019-03-29
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
...
...
NEWS.rmd
View file @
cba36bf1
...
...
@@ -13,7 +13,7 @@ output:
### 1.2.12.
8
Release Notes (2019-03-28)
### 1.2.12.
9
Release Notes (2019-03-28)
...
...
@@ -89,6 +89,8 @@ output:
- <code>plot.OutputsModel()</code> does not return a warning message anymore when <code>Qobs = NULL</code>.
- Inputs of <code>TransfoParam*()</code> functions are now checked.
- The order of authors has been updated in the DESCRIPTION and the CITATION files.
____________________________________________________________________________________
...
...
R/TransfoParam_CemaNeige.R
View file @
cba36bf1
...
...
@@ -4,7 +4,7 @@ TransfoParam_CemaNeige <- function(ParamIn, Direction) {
NParam
<-
2L
## check
_
arguments
## check
arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
...
...
@@ -22,16 +22,18 @@ TransfoParam_CemaNeige <- function(ParamIn, Direction) {
## transformation
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
[,
2
]
<-
exp
(
ParamIn
[,
2
])
/
200
### CemaNeige X2 (degree-day melt coefficient)
}
if
(
Direction
==
"RT"
)
{
ParamOut
<-
ParamIn
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
ParamIn
[,
1
]
*
19.98
-
9.99
### CemaNeige X1 (weighting coefficient for snow pack thermal state)
ParamOut
[,
2
]
<-
log
(
ParamIn
[,
2
]
*
200
)
### CemaNeige X2 (degree-day melt coefficient)
}
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
...
...
R/TransfoParam_CemaNeigeHyst.R
View file @
cba36bf1
...
...
@@ -4,7 +4,7 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
NParam
<-
4L
## check
_
arguments
## check
arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
...
...
@@ -16,7 +16,7 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
stop
(
"'Direction' must be a character vector of length 1 equal to 'RT' or 'TR'"
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
sprintf
(
"the CemaNeige module with linear hysteresis requires %i parameters"
,
NParam
))
stop
(
sprintf
(
"the CemaNeige module with linear hysteresis requires %i parameters"
,
NParam
))
}
...
...
@@ -36,6 +36,8 @@ TransfoParam_CemaNeigeHyst <- function(ParamIn, Direction) {
ParamOut
[,
4
]
<-
(
ParamIn
[,
4
]
-
0.5
)
*
19.98
### Hyst CV
}
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
...
...
R/TransfoParam_GR1A.R
View file @
cba36bf1
TransfoParam_GR1A
<-
function
(
ParamIn
,
Direction
)
{
NParam
<-
1
Bool
<-
is.matrix
(
ParamIn
)
## number of model parameters
NParam
<-
1L
NParam
<-
2L
if
(
Bool
==
FALSE
)
{
ParamIn
<-
rbind
(
ParamIn
)
}
## check arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
}
if
(
!
inherits
(
ParamIn
,
"matrix"
))
{
stop
(
"'ParamIn' must be of class 'matrix'"
)
}
if
(
!
inherits
(
Direction
,
"character"
)
|
length
(
Direction
)
!=
1
|
any
(
!
Direction
%in%
c
(
"RT"
,
"TR"
)))
{
stop
(
"'Direction' must be a character vector of length 1 equal to 'RT' or 'TR'"
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
paste
(
"the GR1A model requires
"
,
NParam
,
"
parameters"
,
sep
=
""
))
stop
(
sprintf
(
"the GR1A model requires
%i
parameters"
,
NParam
))
}
## transformation
if
(
Direction
==
"TR"
)
{
ParamOut
<-
(
ParamIn
+
10.0
)
/
8
}
...
...
@@ -18,10 +29,12 @@ TransfoParam_GR1A <- function(ParamIn, Direction) {
ParamOut
<-
ParamIn
*
8
-
10.0
}
if
(
Bool
==
FALSE
)
{
ParamOut
<-
ParamOut
[
1
,
]
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
return
(
ParamOut
)
}
R/TransfoParam_GR2M.R
View file @
cba36bf1
TransfoParam_GR2M
<-
function
(
ParamIn
,
Direction
)
{
NParam
<-
2
Bool
<-
is.matrix
(
ParamIn
)
## number of model parameters
NParam
<-
2L
if
(
Bool
==
FALSE
)
{
ParamIn
<-
rbind
(
ParamIn
)
## check arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
}
if
(
!
inherits
(
ParamIn
,
"matrix"
))
{
stop
(
"'ParamIn' must be of class 'matrix'"
)
}
if
(
!
inherits
(
Direction
,
"character"
)
|
length
(
Direction
)
!=
1
|
any
(
!
Direction
%in%
c
(
"RT"
,
"TR"
)))
{
stop
(
"'Direction' must be a character vector of length 1 equal to 'RT' or 'TR'"
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
paste
(
"the GR2M model requires
"
,
NParam
,
"
parameters"
,
sep
=
""
))
stop
(
sprintf
(
"the GR2M model requires
%i
parameters"
,
NParam
))
}
## transformation
if
(
Direction
==
"TR"
)
{
ParamOut
<-
ParamIn
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
])
ParamOut
[,
2
]
<-
ParamIn
[,
2
]
/
4
+
2.5
}
if
(
Direction
==
"RT"
)
{
ParamOut
<-
ParamIn
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
])
ParamOut
[,
2
]
<-
(
ParamIn
[,
2
]
-
2.5
)
*
4
}
if
(
Bool
==
FALSE
)
{
ParamOut
<-
ParamOut
[
1
,
]
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
return
(
ParamOut
)
}
R/TransfoParam_GR4H.R
View file @
cba36bf1
TransfoParam_GR4H
<-
function
(
ParamIn
,
Direction
){
TransfoParam_GR4H
<-
function
(
ParamIn
,
Direction
)
{
NParam
<-
4
;
Bool
<-
is.matrix
(
ParamIn
);
if
(
Bool
==
FALSE
){
ParamIn
<-
rbind
(
ParamIn
);
}
if
(
ncol
(
ParamIn
)
!=
NParam
){
stop
(
paste
(
"the GR4H model requires "
,
NParam
,
" parameters"
,
sep
=
""
))
}
if
(
Direction
==
"TR"
){
ParamOut
<-
ParamIn
;
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
]);
### GR4H X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
]
/
3
);
### GR4H X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
]);
### GR4H X3 (routing store capacity)
ParamOut
[,
4
]
<-
480
+
(
480
-
0.5
)
*
(
ParamIn
[,
4
]
-
9.99
)
/
19.98
;
### GR4H X4 (unit hydrograph time constant)
}
if
(
Direction
==
"RT"
){
ParamOut
<-
ParamIn
;
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
]);
### GR4H X1 (production store capacity)
ParamOut
[,
2
]
<-
3
*
asinh
(
ParamIn
[,
2
]);
### GR4H X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
]);
### GR4H X3 (routing store capacity)
ParamOut
[,
4
]
<-
(
ParamIn
[,
4
]
-
480
)
*
19.98
/
(
480
-
0.5
)
+
9.99
;
### GR4H X4 (unit hydrograph time constant)
## number of model parameters
NParam
<-
4L
## check arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
}
if
(
!
inherits
(
ParamIn
,
"matrix"
))
{
stop
(
"'ParamIn' must be of class 'matrix'"
)
}
if
(
!
inherits
(
Direction
,
"character"
)
|
length
(
Direction
)
!=
1
|
any
(
!
Direction
%in%
c
(
"RT"
,
"TR"
)))
{
stop
(
"'Direction' must be a character vector of length 1 equal to 'RT' or 'TR'"
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
sprintf
(
"the GR4H model requires %i parameters"
,
NParam
))
}
## transformation
if
(
Direction
==
"TR"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
])
### GR4H X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
]
/
3
)
### GR4H X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
])
### GR4H X3 (routing store capacity)
ParamOut
[,
4
]
<-
480
+
(
480
-
0.5
)
*
(
ParamIn
[,
4
]
-
9.99
)
/
19.98
### GR4H X4 (unit hydrograph time constant)
}
if
(
Direction
==
"RT"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
])
### GR4H X1 (production store capacity)
ParamOut
[,
2
]
<-
3
*
asinh
(
ParamIn
[,
2
])
### GR4H X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
])
### GR4H X3 (routing store capacity)
ParamOut
[,
4
]
<-
(
ParamIn
[,
4
]
-
480
)
*
19.98
/
(
480
-
0.5
)
+
9.99
### GR4H X4 (unit hydrograph time constant)
}
if
(
Bool
==
FALSE
){
ParamOut
<-
ParamOut
[
1
,];
}
return
(
ParamOut
);
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
return
(
ParamOut
)
}
R/TransfoParam_GR4J.R
View file @
cba36bf1
TransfoParam_GR4J
<-
function
(
ParamIn
,
Direction
){
TransfoParam_GR4J
<-
function
(
ParamIn
,
Direction
)
{
NParam
<-
4
;
Bool
<-
is.matrix
(
ParamIn
);
if
(
Bool
==
FALSE
){
ParamIn
<-
rbind
(
ParamIn
);
}
if
(
ncol
(
ParamIn
)
!=
NParam
){
stop
(
paste
(
"the GR4J model requires "
,
NParam
,
" parameters"
,
sep
=
""
))
}
if
(
Direction
==
"TR"
){
ParamOut
<-
ParamIn
;
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
]);
### GR4J X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
]);
### GR4J X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
]);
### GR4J X3 (routing store capacity)
ParamOut
[,
4
]
<-
20+19.5
*
(
ParamIn
[,
4
]
-9.99
)
/
19.98
;
### GR4J X4 (unit hydrograph time constant)
}
if
(
Direction
==
"RT"
){
ParamOut
<-
ParamIn
;
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
]);
### GR4J X1 (production store capacity)
ParamOut
[,
2
]
<-
asinh
(
ParamIn
[,
2
]);
### GR4J X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
]);
### GR4J X3 (routing store capacity)
ParamOut
[,
4
]
<-
9.99+19.98
*
(
ParamIn
[,
4
]
-20
)
/
19.5
;
### GR4J X4 (unit hydrograph time constant)
## number of model parameters
NParam
<-
4L
## check arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
}
if
(
!
inherits
(
ParamIn
,
"matrix"
))
{
stop
(
"'ParamIn' must be of class 'matrix'"
)
}
if
(
!
inherits
(
Direction
,
"character"
)
|
length
(
Direction
)
!=
1
|
any
(
!
Direction
%in%
c
(
"RT"
,
"TR"
)))
{
stop
(
"'Direction' must be a character vector of length 1 equal to 'RT' or 'TR'"
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
sprintf
(
"the GR4J model requires %i parameters"
,
NParam
))
}
## transformation
if
(
Direction
==
"TR"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
])
### GR4J X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
])
### GR4J X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
])
### GR4J X3 (routing store capacity)
ParamOut
[,
4
]
<-
20
+
19.5
*
(
ParamIn
[,
4
]
-
9.99
)
/
19.98
### GR4J X4 (unit hydrograph time constant)
}
if
(
Direction
==
"RT"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
])
### GR4J X1 (production store capacity)
ParamOut
[,
2
]
<-
asinh
(
ParamIn
[,
2
])
### GR4J X2 (groundwater exchange coefficient)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
])
### GR4J X3 (routing store capacity)
ParamOut
[,
4
]
<-
9.99
+
19.98
*
(
ParamIn
[,
4
]
-
20
)
/
19.5
### GR4J X4 (unit hydrograph time constant)
}
if
(
Bool
==
FALSE
){
ParamOut
<-
ParamOut
[
1
,];
}
return
(
ParamOut
);
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
return
(
ParamOut
)
}
R/TransfoParam_GR5J.R
View file @
cba36bf1
TransfoParam_GR5J
<-
function
(
ParamIn
,
Direction
){
NParam
<-
5
;
Bool
<-
is.matrix
(
ParamIn
);
if
(
Bool
==
FALSE
){
ParamIn
<-
rbind
(
ParamIn
);
}
if
(
ncol
(
ParamIn
)
!=
NParam
){
stop
(
paste
(
"the GR5J model requires "
,
NParam
,
" parameters"
,
sep
=
""
))
}
if
(
Direction
==
"TR"
){
ParamOut
<-
ParamIn
;
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
]);
### GR5J X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
]);
### GR5J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
]);
### GR5J X3 (routing store capacity)
ParamOut
[,
4
]
<-
20+19.5
*
(
ParamIn
[,
4
]
-9.99
)
/
19.98
;
### GR5J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
(
ParamIn
[,
5
]
+
9.99
)
/
19.98
;
### GR5J X5 (groundwater exchange coefficient 2)
}
if
(
Direction
==
"RT"
){
ParamOut
<-
ParamIn
;
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
]);
### GR5J X1 (production store capacity)
ParamOut
[,
2
]
<-
asinh
(
ParamIn
[,
2
]);
### GR5J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
]);
### GR5J X3 (routing store capacity)
ParamOut
[,
4
]
<-
9.99+19.98
*
(
ParamIn
[,
4
]
-20
)
/
19.5
;
### GR5J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
ParamIn
[,
5
]
*
19.98
-
9.99
;
### GR5J X5 (groundwater exchange coefficient 2)
TransfoParam_GR5J
<-
function
(
ParamIn
,
Direction
)
{
## number of model parameters
NParam
<-
5L
## check arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
}
if
(
!
inherits
(
ParamIn
,
"matrix"
))
{
stop
(
"'ParamIn' must be of class 'matrix'"
)
}
if
(
!
inherits
(
Direction
,
"character"
)
|
length
(
Direction
)
!=
1
|
any
(
!
Direction
%in%
c
(
"RT"
,
"TR"
)))
{
stop
(
"'Direction' must be a character vector of length 1 equal to 'RT' or 'TR'"
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
sprintf
(
"the GR4J model requires %i parameters"
,
NParam
))
}
## transformation
if
(
Direction
==
"TR"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
])
### GR5J X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
])
### GR5J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
])
### GR5J X3 (routing store capacity)
ParamOut
[,
4
]
<-
20
+
19.5
*
(
ParamIn
[,
4
]
-
9.99
)
/
19.98
### GR5J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
(
ParamIn
[,
5
]
+
9.99
)
/
19.98
### GR5J X5 (groundwater exchange coefficient 2)
}
if
(
Direction
==
"RT"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
])
### GR5J X1 (production store capacity)
ParamOut
[,
2
]
<-
asinh
(
ParamIn
[,
2
])
### GR5J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
])
### GR5J X3 (routing store capacity)
ParamOut
[,
4
]
<-
9.99
+
19.98
*
(
ParamIn
[,
4
]
-
20
)
/
19.5
### GR5J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
ParamIn
[,
5
]
*
19.98
-
9.99
### GR5J X5 (groundwater exchange coefficient 2)
}
if
(
Bool
==
FALSE
){
ParamOut
<-
ParamOut
[
1
,];
}
return
(
ParamOut
);
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
return
(
ParamOut
)
}
R/TransfoParam_GR6J.R
View file @
cba36bf1
TransfoParam_GR6J
<-
function
(
ParamIn
,
Direction
)
{
NParam
<-
6
Bool
<-
is.matrix
(
ParamIn
)
## number of model parameters
NParam
<-
6L
if
(
Bool
==
FALSE
)
{
ParamIn
<-
rbind
(
ParamIn
)
## check arguments
isVecParamIn
<-
is.vector
(
ParamIn
)
if
(
isVecParamIn
)
{
ParamIn
<-
matrix
(
ParamIn
,
nrow
=
1
)
}
if
(
!
inherits
(
ParamIn
,
"matrix"
))
{
stop
(
"'ParamIn' must be of class 'matrix'"
)
}
if
(
!
inherits
(
Direction
,
"character"
)
|
length
(
Direction
)
!=
1
|
any
(
!
Direction
%in%
c
(
"RT"
,
"TR"
)))
{
stop
(
"'Direction' must be a character vector of length 1 equal to 'RT' or 'TR'"
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
sprintf
(
"the GR6J model requires %i parameters"
,
NParam
))
}
## transformation
if
(
Direction
==
"TR"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
])
### GR6J X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
])
### GR6J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
])
### GR6J X3 (routing store capacity)
ParamOut
[,
4
]
<-
20
+
19.5
*
(
ParamIn
[,
4
]
-
9.99
)
/
19.98
### GR6J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
ParamIn
[,
5
]
/
5
.
### GR5J X5 (groundwater exchange coefficient 2)
ParamOut
[,
6
]
<-
exp
(
ParamIn
[,
6
])
### GR6J X6 (coefficient for emptying exponential store)
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
exp
(
ParamIn
[,
1
])
### GR6J X1 (production store capacity)
ParamOut
[,
2
]
<-
sinh
(
ParamIn
[,
2
])
### GR6J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
exp
(
ParamIn
[,
3
])
### GR6J X3 (routing store capacity)
ParamOut
[,
4
]
<-
20
+
19.5
*
(
ParamIn
[,
4
]
-
9.99
)
/
19.98
### GR6J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
ParamIn
[,
5
]
/
5
### GR6J X5 (groundwater exchange coefficient 2)
ParamOut
[,
6
]
<-
exp
(
ParamIn
[,
6
])
### GR6J X6 (coefficient for emptying exponential store)
}
if
(
Direction
==
"RT"
)
{
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
])
### GR6J X1 (production store capacity)
ParamOut
[,
2
]
<-
asinh
(
ParamIn
[,
2
])
### GR6J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
])
### GR6J X3 (routing store capacity)
ParamOut
[,
4
]
<-
9.99
+
19.98
*
(
ParamIn
[,
4
]
-
20
)
/
19.5
### GR6J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
ParamIn
[,
5
]
*
5
.
### GR5J X5 (groundwater exchange coefficient 2)
ParamOut
[,
6
]
<-
log
(
ParamIn
[,
6
])
### GR6J X6 (coefficient for emptying exponential store)
ParamOut
<-
ParamIn
ParamOut
[,
1
]
<-
log
(
ParamIn
[,
1
])
### GR6J X1 (production store capacity)
ParamOut
[,
2
]
<-
asinh
(
ParamIn
[,
2
])
### GR6J X2 (groundwater exchange coefficient 1)
ParamOut
[,
3
]
<-
log
(
ParamIn
[,
3
])
### GR6J X3 (routing store capacity)
ParamOut
[,
4
]
<-
9.99
+
19.98
*
(
ParamIn
[,
4
]
-
20
)
/
19.5
### GR6J X4 (unit hydrograph time constant)
ParamOut
[,
5
]
<-
ParamIn
[,
5
]
*
5
### GR6J X5 (groundwater exchange coefficient 2)
ParamOut
[,
6
]
<-
log
(
ParamIn
[,
6
])
### GR6J X6 (coefficient for emptying exponential store)
}
if
(
Bool
==
FALSE
)
{
ParamOut
<-
ParamOut
[
1
,
]
## check output
if
(
isVecParamIn
)
{
ParamOut
<-
as.vector
(
ParamOut
)
}
return
(
ParamOut
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment