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
airGRteaching
Commits
87096162
Commit
87096162
authored
Apr 06, 2017
by
unknown
Browse files
v0.1.2.14 garbage collector use remove
parent
d3c3075c
Changes
3
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
87096162
Package: airGRteaching
Type: Package
Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Application)
Version: 0.1.2.1
3
Version: 0.1.2.1
4
Date: 2017-04-06
Authors@R: c(person("Olivier", "Delaigue", role = c("aut", "cre"), email = "airGR@irstea.fr"), person("Laurent", "Coron", role = c("aut")), person("Pierre", "Brigode", role = c("aut")), person("Guillaume", "Thirel", role = c("ctb")))
Depends: airGR (>= 1.0.5.22)
...
...
R/plot.CalGR.R
View file @
87096162
...
...
@@ -40,16 +40,31 @@ plot.CalGR <- function(x, xlab = NULL, ylab = NULL, main = NULL, which = c("per
if
(
any
(
which
[
1L
]
%in%
c
(
"hist"
)))
{
par
(
mar
=
c
(
2.5
,
2.5
,
4.5
,
1
))
ParamLab
<-
data.frame
(
Name
=
c
(
sprintf
(
"X%i"
,
1
:
6
),
sprintf
(
"C%i"
,
1
:
2
)),
Label
=
c
(
"prod. store capacity [mm]"
,
"intercatchment exchange coef. [mm/TimeUnit]"
,
"routing store capacity [mm]"
,
"unit hydrograph time constant [TimeUnit]"
,
"intercatchment exchange threshold [-]"
,
"coefficient for emptying exp. store [mm]"
,
"weighting coef. for snow pack thermal state [-]"
,
"degree-day melt coef. [mm/°C/TimeUnit]"
))
ParamLab
$
Label
<-
gsub
(
"TimeUnit"
,
substr
(
.TypeModelGR
(
x
)
$
TimeUnit
,
1
,
1
),
ParamLab
$
Label
)
par
(
mar
=
c
(
2.5
,
3.5
,
4.5
,
1
),
mgp
=
c
(
2.0
,
0.6
,
0
))
for
(
i
in
seq_len
(
ncol
(
x
$
OutputsCalib
$
HistParamR
)))
{
plot
(
x
$
OutputsCalib
$
HistParamR
[,
i
],
col
=
ifelse
(
grepl
(
"X"
,
nmParam
[
i
]),
"darkorchid3"
,
"darkolivegreen3"
),
plot
(
x
$
OutputsCalib
$
HistParamR
[,
i
],
col
=
ifelse
(
grepl
(
"X"
,
nmParam
[
i
]),
"darkorchid3"
,
"darkolivegreen3"
),
type
=
"b"
,
pch
=
19
,
cex
=
0.8
,
xlab
=
""
,
ylab
=
""
,
main
=
nmParam
[
i
])
xlab
=
""
,
ylab
=
ParamLab
$
Label
[
i
],
main
=
nmParam
[
i
])
}
plot
(
x
$
OutputsCalib
$
HistCrit
,
col
=
"tomato"
,
plot
(
x
$
OutputsCalib
$
HistCrit
,
col
=
"tomato"
,
type
=
"b"
,
pch
=
19
,
cex
=
1.0
,
xlab
=
""
,
ylab
=
""
,
main
=
"Efficiency criteria\nduring the steepest-descent step"
)
xlab
=
""
,
ylab
=
""
,
main
=
sprintf
(
"Efficiency criteria (%s)\nduring the steepest-descent step"
,
gsub
(
".*_"
,
""
,
x
$
CalCrit
)))
}
if
(
any
(
which
[
1L
]
%in%
c
(
"time"
)))
{
...
...
@@ -57,8 +72,7 @@ plot.CalGR <- function(x, xlab = NULL, ylab = NULL, main = NULL, which = c("per
xlab
<-
"Time"
}
if
(
is.null
(
ylab
))
{
yunit
<-
.TypeModelGR
(
x
)
$
TimeUnit
ylab
<-
paste0
(
c
(
"flow [mm/"
,
"precip. [mm/"
),
yunit
,
"]"
)
ylab
<-
paste0
(
c
(
"flow [mm/"
,
"precip. [mm/"
),
.TypeModelGR
(
x
)
$
TimeUnit
,
"]"
)
}
else
{
if
(
length
(
ylab
)
<
2
)
{
ylab
<-
c
(
ylab
,
""
)
...
...
inst/shinySimGR/server.R
View file @
87096162
...
...
@@ -82,8 +82,8 @@ shinyServer(function(input, output, session) {
CRIT
$
Value
<-
as.numeric
(
CRIT
$
Value
)
CRIT
$
Criteria
<-
gsub
(
"\\["
,
" ["
,
CRIT
$
Criteria
)
suppressWarnings
(
rm
(
list
=
ls
()[
!
ls
()
%in%
c
(
"PARAM"
,
"SIM"
,
"CRIT"
)]))
gc
()
#
suppressWarnings(rm(list = ls()[!ls() %in% c("PARAM", "SIM", "CRIT")]))
#
gc()
return
(
list
(
PARAM
=
PARAM
,
SIM
=
SIM
$
ErrorCrit_KGE
$
NO
$
SIM
,
Crit
=
CRIT
))
})
...
...
@@ -168,6 +168,6 @@ shinyServer(function(input, output, session) {
output
$
Criteria
<-
renderTable
({
getRES
()
$
Crit
})
gc
()
#
gc()
})
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