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
f8e091fa
Commit
f8e091fa
authored
Feb 16, 2017
by
unknown
Browse files
v1.0.5.19 function TransfoParam_CemaNeige() cleaned
parent
f106ffc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
f8e091fa
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.5.1
8
Version: 1.0.5.1
9
Date: 2017-01-23
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")),
...
...
R/TransfoParam_CemaNeige.R
View file @
f8e091fa
TransfoParam_CemaNeige
<-
function
(
ParamIn
,
Direction
){
TransfoParam_CemaNeige
<-
function
(
ParamIn
,
Direction
)
{
NParam
<-
2
Bool
<-
is.matrix
(
ParamIn
)
if
(
Bool
==
FALSE
){
ParamIn
<-
rbind
(
ParamIn
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
){
stop
(
paste
(
"the CemaNeige module requires "
,
NParam
,
" parameters \n"
,
sep
=
""
));
return
(
NULL
)
}
if
(
Direction
==
"TR"
){
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
[,
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)
}
if
(
Bool
==
FALSE
){
ParamOut
<-
ParamOut
[
1
,]
}
if
(
Bool
==
FALSE
)
{
ParamIn
<-
rbind
(
ParamIn
)
}
if
(
ncol
(
ParamIn
)
!=
NParam
)
{
stop
(
paste
(
"the CemaNeige module requires "
,
NParam
,
" parameters \n"
,
sep
=
""
))
return
(
NULL
)
}
if
(
Direction
==
"TR"
)
{
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
[,
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)
}
if
(
Bool
==
FALSE
)
{
ParamOut
<-
ParamOut
[
1
,
]
}
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