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
IN-WOP
airGRiwrm
Commits
25e04582
Commit
25e04582
authored
Sep 02, 2021
by
Dorchies David
Browse files
Revert "fix(CreateInputsCrit): wrong Qobs in Lavenne criteria (temporary fix)"
This reverts commit
839d28ac
.
parent
839d28ac
Pipeline
#26825
passed with stage
in 5 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
R/Calibration.GRiwrmInputsModel.R
View file @
25e04582
...
...
@@ -85,19 +85,12 @@ getInputsCrit_Lavenne <- function(id, OutputsModel, InputsCrit) {
stop
(
"'InputsCrit[[id]]' must be of class InputsCritLavenneFunction"
)
}
AprioriId
<-
attr
(
InputsCrit
[[
id
]],
"AprioriId"
)
Lavenne_
DATA
<-
attr
(
InputsCrit
[[
id
]],
"Lavenne_
DATA
"
)
Lavenne_
FUN
<-
attr
(
InputsCrit
[[
id
]],
"Lavenne_
FUN
"
)
AprParamR
<-
OutputsModel
[[
AprioriId
]]
$
Param
if
(
!
inherits
(
OutputsModel
[[
AprioriId
]],
"SD"
))
{
# Add neutral velocity parameter for upstream catchment
AprParamR
<-
c
(
NA
,
AprParamR
)
}
AprCrit
<-
ErrorCrit
(
InputsCrit
[[
AprioriId
]],
OutputsModel
[[
AprioriId
]])
$
CritValue
CreateInputsCrit_Lavenne
(
FUN_CRIT
=
Lavenne_DATA
$
FUN_CRIT
,
InputsModel
=
Lavenne_DATA
$
InputsModel
,
RunOptions
=
Lavenne_DATA
$
RunOptions
,
Obs
=
Lavenne_DATA
$
Obs
,
AprParamR
=
AprParamR
,
AprCrit
=
AprCrit
,
k
=
Lavenne_DATA
$
k
,
transfo
=
Lavenne_DATA
$
transfo
)
return
(
Lavenne_FUN
(
AprParamR
,
AprCrit
))
}
R/CreateInputsCrit.GRiwrmInputsModel.R
View file @
25e04582
...
...
@@ -6,7 +6,6 @@ CreateInputsCrit.GRiwrmInputsModel <- function(InputsModel,
Obs
,
AprioriIds
=
NULL
,
k
=
0.15
,
transfo
=
""
,
...
)
{
# Parameter checks
...
...
@@ -66,18 +65,32 @@ CreateInputsCrit.GRiwrmInputsModel <- function(InputsModel,
)
if
(
!
is.null
(
AprioriIds
)
&&
IM
$
id
%in%
names
(
AprioriIds
))
{
# De Lavenne regularisation for this sub-catchment
attr
(
InputsCrit
[[
IM
$
id
]],
"Lavenne_
DATA
"
)
<-
list
(
attr
(
InputsCrit
[[
IM
$
id
]],
"Lavenne_
FUN
"
)
<-
CreateLavenneFunction
(
InputsModel
=
IM
,
FUN_CRIT
=
FUN_CRIT
,
RunOptions
=
RunOptions
[[
IM
$
id
]],
Obs
=
Obs
[,
IM
$
id
],
k
=
k
,
transfo
=
transfo
...
)
attr
(
InputsCrit
[[
IM
$
id
]],
"AprioriId"
)
<-
AprioriIds
[
IM
$
id
]
class
(
InputsCrit
[[
IM
$
id
]])
<-
c
(
"InputsCritLavenneFunction"
,
class
(
InputsCrit
[[
IM
$
id
]]))
}
}
return
(
InputsCrit
)
}
CreateLavenneFunction
<-
function
(
InputsModel
,
FUN_CRIT
,
RunOptions
,
Obs
,
k
,
...
)
{
function
(
AprParamR
,
AprCrit
)
{
CreateInputsCrit_Lavenne
(
FUN_CRIT
=
FUN_CRIT
,
InputsModel
=
InputsModel
,
RunOptions
=
RunOptions
,
Obs
=
Obs
,
AprParamR
=
AprParamR
,
AprCrit
=
AprCrit
,
k
=
k
,
...
)
}
}
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