Commit 29196719 authored by Bruno Bonte's avatar Bruno Bonte
Browse files

modif for simus

parent 2b3e1f83
......@@ -227,7 +227,8 @@ library(gridExtra)
reachsOfCormas <- NULL
inOutCanals <- NULL
seepage <- NULL
if (with_cormas) {
reach_Runoff = j2kGetOneValueAllReachs("Runoff") %>%
tbl_df()
......@@ -453,6 +454,7 @@ library(gridExtra)
qFromSeepage$idHRU,
qFromSeepage$q)
}
}
####### F. Run new j2k daily step #######
if (with_J2K) {
if (makeWaterBalance) {storedWater <- rbind(storedWater, j2kWaterBalanceStorages())} # To calculate the water balance
......@@ -548,7 +550,9 @@ library(gridExtra)
geom_point(aes(x = nextday, y = storage + inWater - outWater, color = "PastStoragePlusBalance")) +
ylab("Litres")
totalSeepage <- seepage %>%
if (with_cormas) {
#Cormas related balance analysis
totalSeepage <- seepage %>%
ungroup() %>%
group_by(date) %>%
summarise(seepage=sum(q))
......@@ -592,12 +596,13 @@ cormasWaterSummary %>%
irrigatedFarmPlots %>%
tbl_df()
}
# Fonction qui plot les variables des bilans fait par J2k sur l'ensemble de la simu
library(gtable)
library(grid)
plot_bilan <- function (period = c(300,400)){
wL <- waterSummary %>%
wL <- waterSummary %>%
arrange(day) %>%
#filter(day > nbDays) %>%
mutate(inWater = rain + snow) %>%
......
......@@ -59,7 +59,8 @@ localWaterSummary <- union(localWaterSummaryBigH, localWaterSummaryWithPlots)
localWaterSummary %>%
ggplot() +
geom_line(aes(y = outflow, x = day, color = hruType))
# geom_line(aes(y = outflow, x = day, color = hruType)) +
geom_line(aes(y = hruStorage, x = day, color = hruType))
localWaterSummary %>%
select(day, outflow, hruType) %>%
......@@ -70,7 +71,7 @@ localWaterSummary %>%
geom_line(aes(y = diffoutFlow, x = day))
#Plotting global water loss for verification
waterSummary %>%
globalWaterSummaryBigH %>%
arrange(day) %>%
mutate(inWater = rain + snow) %>%
mutate(outWater = etact + runoff) %>%
......@@ -80,4 +81,49 @@ waterSummary %>%
mutate(waterBalance = inWater - outWater) %>%
mutate(waterLoss = storageNextDay - storage - waterBalance) %>%
ggplot() +
geom_line(aes(x = day, y = waterLoss))
\ No newline at end of file
geom_line(aes(x = day, y = waterLoss))
globalWaterSummaryWithPlots %>%
arrange(day) %>%
mutate(inWater = rain + snow) %>%
mutate(outWater = etact + runoff) %>%
mutate(storage = hruStorage + reachStorage) %>%
mutate(storageNextDay = lead(storage)) %>%
mutate(deltaS = storageNextDay - storage) %>%
mutate(waterBalance = inWater - outWater) %>%
mutate(waterLoss = storageNextDay - storage - waterBalance) %>%
ggplot() +
geom_line(aes(x = day, y = waterLoss))
#Plotting local water loss for verification
localWaterSummaryBigH %>%
arrange(day) %>%
mutate(inWater = rain + snow) %>%
mutate(outWater = etact + outflow) %>%
mutate(storage = hruStorage) %>%
mutate(storageNextDay = lead(storage)) %>%
mutate(deltaS = storageNextDay - storage) %>%
mutate(waterBalance = inWater - outWater) %>%
mutate(deltaS = storageNextDay - storage) %>%
mutate(waterLoss = deltaS - waterBalance) %>%
filter(day > 0) %>%
mutate(cumWaterLoss = cumsum(waterLoss)) %>%
ggplot() +
geom_line(aes(x = day, y = waterLoss, color = "loss")) +
ggtitle("Bilan Hrus 16637")
localWaterSummaryWithPlots %>%
arrange(day) %>%
mutate(inWater = rain + snow) %>%
mutate(outWater = etact + outflow) %>%
mutate(storage = hruStorage) %>%
mutate(storageNextDay = lead(storage)) %>%
mutate(deltaS = storageNextDay - storage) %>%
mutate(waterBalance = inWater - outWater) %>%
mutate(deltaS = storageNextDay - storage) %>%
mutate(waterLoss = deltaS - waterBalance) %>%
filter(day > 0) %>%
mutate(cumWaterLoss = cumsum(waterLoss)) %>%
ggplot() +
geom_line(aes(x = day, y = waterLoss, color = "loss")) +
ggtitle("Bilan Hrus 8560,16637t,8563,11104,12464")
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