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

passage grand buech

parent 6f77608e
......@@ -34,7 +34,7 @@ library(gridExtra)
makeWaterBalance <- T; if (makeWaterBalance) { storedWater <- NULL; inOutWater <-NULL ;localStoredWater <- NULL; localInOutWater <-NULL}
# If original big Hrus are used (not hru plot and thus no cormas)
bigHrus <- T
bigHrus <- F
# If orginial big Hrus are used, link must be made between cormas HRU plots and J2K big HRUS
if (bigHrus) {
......@@ -58,7 +58,8 @@ library(gridExtra)
####### 2.2 Specification for J2K/JAMS #######
hydro_warmup_doy_nb <- as.numeric(difftime(date_start_crop, date_start_hydro,units='days')-1)
jams_file_name <- "cowat_for_new_com_module.jam"
#jams_file_name <- "cowat_for_new_com_module.jam"
jams_file_name <- "cowat_for_new_com_module_GB.jam"
if (bigHrus) {
jams_file_name <- "cowat_for_new_com_module-bigHrus.jam"
}
......@@ -192,15 +193,18 @@ library(gridExtra)
if (makeWaterBalance) {
storedWater <- rbind(storedWater, j2kWaterBalanceStorages())
# Testing local balance. Only during warming-up.
localStoredWater <- rbind(localStoredWater, j2kLocalWaterBalanceStorages(selectedHrus = c(548, 554, 567, 634, 696)))
#localStoredWater <- rbind(localStoredWater, j2kLocalWaterBalanceStorages(selectedHrus = c(548, 554, 567, 634, 696)))
localStoredWater <- rbind(localStoredWater, j2kLocalWaterBalanceStorages(selectedHrus = c(11104, 8563, 12464, 8560, 16637)))
}
# Making step by step j2k simu
j2kMakeStep()
if (makeWaterBalance) {
inOutWater <- rbind(inOutWater, j2kWaterBalanceFlows())
# Testing local balance. Only during warming-up.
localInOutWater <- rbind(localInOutWater, j2kLocalWaterBalanceFlows(selectedHrus = c(548, 554, 567, 634, 696),
lastHru = 567))
#localInOutWater <- rbind(localInOutWater, j2kLocalWaterBalanceFlows(selectedHrus = c(548, 554, 567, 634, 696),
#lastHru = 567))
localInOutWater <- rbind(localInOutWater, j2kLocalWaterBalanceFlows(selectedHrus = c(11104, 8563, 12464, 8560, 16637),
lastHru = 16637))
}
}
......@@ -474,7 +478,7 @@ library(gridExtra)
mutate(deltaS = storageNextDay - storage) %>%
mutate(waterBalance = inWater - outWater) %>%
mutate(waterLoss = storageNextDay - storage - waterBalance) %>%
filter(day > 150) %>%
filter(day > 0) %>%
#mutate(cumWaterLoss = cumsum(waterLoss)) %>%
ggplot() +
geom_line(aes(x = day, y = waterLoss))
......@@ -490,11 +494,11 @@ library(gridExtra)
mutate(waterBalance = inWater - outWater) %>%
mutate(deltaS = storageNextDay - storage) %>%
mutate(waterLoss = deltaS - waterBalance) %>%
filter(day > 150) %>%
filter(day > 0) %>%
mutate(cumWaterLoss = cumsum(waterLoss)) %>%
ggplot() +
geom_line(aes(x = day, y = waterLoss, color = "loss")) +
ggtitle("Hrus 548, 554, 567, 634, 696")
ggtitle("Bilan Hrus 11104p, 8563p, 12464p, 8560p, 16637t")
# geom_line(aes(x = day, y = - outWater, color = "outWater")) +
# geom_line(aes(x = day, y = deltaS, color = "deltaS")) +
# geom_line(aes(x = day, y = - etact, color = "et")) +
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
# reachs_grand_buech.par created by B.Richard 15 march 2021 with slope and width corrections from april 2020
ID to-reach length slope sinuosity rough width
0 0 0 0 1 0 0
999999 999999 99999 90999999 9999 9999
n/a n/a m % n/a n/a m
62200 0 1780 0.8427 1.16 30 32.5
62400 62200 3404 0.6169 1.13 30 7.5
62600 62400 150 2 1 30 7.5
62800 62600 1707 0.8787 1.13 30 7.5
63000 62800 502 3.5857 1.07 30 7.5
63200 62800 966 0.9317 1.24 30 7.5
63400 63200 874 1.9451 1.07 30 7.5
63600 63200 3107 1.0621 1.21 30 7.5
63800 63600 85 3.5294 1.08 30 7.5
64000 63600 1706 0.9379 1.22 30 7.5
64200 64000 986 1.3185 1.12 30 7.5
64400 64200 1238 4.6042 1.09 30 7.5
64600 64200 1515 1.0561 1.22 30 7.5
64800 64600 321 2.8037 1.05 30 7.5
65000 64800 458 1.7467 1.08 30 7.5
65200 65000 96 2.0833 1.06 30 7.5
65400 65000 747 2.8112 1.11 30 7.5
65600 64800 608 2.6316 1.08 30 7.5
65800 64600 3216 2.2388 1.14 30 7.5
66000 65800 341 5.5718 1.08 30 7.5
66200 65800 2274 5.7608 1.12 30 7.5
66400 64000 1303 2.9163 1.13 30 7.5
66600 62600 680 1.0294 1.17 30 32.5
66800 66600 4754 0.8624 1 30 32.5
67000 66800 1394 2.2238 1.13 30 32.5
67200 66800 1078 0.6494 1.09 30 32.5
67400 67200 1061 0.8483 1.24 30 7.5
67600 67200 572 1.2238 1.19 30 32.5
67800 67600 2300 1 1.26 30 32.5
68000 67800 3067 10.5641 1.08 30 7.5
68200 67800 658 0.7599 1.13 30 32.5
68400 68200 5303 1.1126 1.12 30 7.5
68600 68400 1741 1.2636 1.1 30 7.5
68800 68600 785 1.0191 1.27 30 32.5
69000 68800 1805 1.0526 1.41 30 32.5
69200 69000 3300 5.6364 1.1 30 7.5
69400 69000 2450 1.4694 1.19 30 7.5
69600 69400 1392 2.0833 1.26 30 7.5
69800 69600 518 1.7375 1.17 30 7.5
70000 69600 100 3 1 30 7.5
70200 70000 4046 2.694 1.16 30 7.5
70400 70200 4337 3.5508 1.09 30 7.5
70600 70400 1229 18.9585 1.2 30 7.5
70800 70400 562 11.21 1.1 30 7.5
71000 70200 1035 9.5652 1.08 30 7.5
71200 71000 366 13.9344 1.08 30 7.5
71400 71000 252 11.1111 1.07 30 7.5
71600 70000 5453 4.7313 1.12 30 7.5
71800 71600 835 14.012 1.1 30 7.5
72000 71600 281 7.1174 1.08 30 7.5
72200 69400 1292 0.6966 1.09 30 7.5
72400 72200 1220 8.9344 1.12 30 7.5
72600 72200 1588 0.6927 1.24 30 7.5
72800 72600 1665 0.9009 1.22 30 7.5
73000 72800 789 1.9011 1.1 30 7.5
73200 73000 25 2.42025 1 30 7.5
73400 73200 3266 2.9394 1.1 30 7.5
73600 73200 2559 8.6362 1.12 30 7.5
73800 73000 3868 5.0672 1.36 30 7.5
74000 72800 3440 7.2384 1.09 30 7.5
74200 72600 3604 8.2686 1.1 30 7.5
74400 68800 916 6.2227 1.05 30 7.5
74600 68600 5027 6.1667 1.06 30 7.5
74800 68400 1803 10.538 1.08 30 32.5
75000 68200 146 1.3699 1.17 30 7.5
75200 75000 1157 1.0372 1.35 30 7.5
75400 75200 4431 2.4374 1.11 30 7.5
75600 75400 1242 2.8986 1.18 30 7.5
75800 75600 1609 9.1361 1.09 30 7.5
76000 75600 3791 5.6977 1.08 30 7.5
76200 75400 986 4.2596 1.11 30 7.5
76400 75200 1347 7.8693 1.09 30 7.5
76600 75000 171 6.4327 1.08 30 7.5
76800 67600 2199 3.8654 1.26 30 7.5
77000 76800 3483 4.7947 1.16 30 7.5
77200 77000 216 11.5741 1.07 30 7.5
77400 77000 2723 8.8505 1.16 30 7.5
77600 76800 472 15.678 1.13 30 7.5
77800 66600 2897 0.932 1.46 30 7.5
78000 62400 693 2.7417 1.15 30 7.5
......@@ -4,7 +4,9 @@ library(dplyr)
library(tidyr)
library(stringr)
hrus <- read.table("superjams/data/J2K_cowat/parameter/hru.par",
#hrus <- read.table("superjams/data/J2K_cowat/parameter/hru.par",
#hrus <- read.table("superjams/data/J2K_cowat/parameter/hru_cowat_10_ok2.par",
hrus <- read.table("superjams/data/J2K_cowat/parameter/hru_cowat_10_cor_grand_buech.par",
skip = 5,
sep= "\t",
dec = ".") %>%
......@@ -14,7 +16,8 @@ hrus <- read.table("superjams/data/J2K_cowat/parameter/hru.par",
colnames(hrus) <- c("id", "area", "x", "y", "subbassin", "to_poly", "to_reach")
reachs <- read.table("superjams/data/J2K_cowat/parameter/reach_cor2_delete_duplicate.par",
#reachs <- read.table("superjams/data/J2K_cowat/parameter/reach_cor2_delete_duplicate.par",
reachs <- read.table("superjams/data/J2K_cowat/parameter/reachs_grand_buech.par",
skip = 5,
sep= "\t",
dec = ".") %>%
......@@ -35,8 +38,8 @@ ymax <- max(hrus$y)
yL <- ymax - ymin
# Ici on prend juste le petit bassin nord-ouest
ymin <- 6394625
xmax <- 918612
#ymin <- 6394625
#xmax <- 918612
# On regarde tous les sous-bassins apparaissant dans de cette fenetre
windowsSubssasins <- hrus %>%
......@@ -86,6 +89,8 @@ sub1Edges <- rbind(sub1HruEdges,
sub1G <- graph_from_edgelist(sub1Edges %>% as.matrix())
hruNtw <- graph_from_edgelist(sub1HruEdges %>% as.matrix())
# La liste des noeuds du réseaux comprend les Hrus et les reachs
vertexList <- V(sub1G)
......@@ -107,6 +112,12 @@ vertexPositions <- union(reachsPositions %>%
select(x,y, vertexId),
hrusPositions %>%
select(x,y, vertexId))
#vertexPositions <- rbind(reachsPositions %>%
# select(x,y, vertexId),
# hrusPositions %>%
# select(x,y, vertexId))
# On stocke dans cette table les attributs des noeuds
# Attention ils doivent être dans le même ordre que lea liste des noueds (vertexList)
# Assuré par le le "left_join"
......@@ -130,16 +141,17 @@ vertexAtributes <- vertexAtributes %>%
mutate(x = replace_na(x, mx)) %>%
mutate(y = replace_na(y,ymin))
subnum = "north-west"
#pdf(paste0("subassin_", subnum,".pdf"), height = 16, width = 11) #en A3 pour tout le bassin
pdf(paste0("topology_", subnum,".pdf"), paper ="a4")
#subnum = "north-west-hru-ploy"
subnum = "all-GB"
pdf(paste0("topology_", subnum,".pdf"), height = 16, width = 11) #en A3 pour tout le bassin
#pdf(paste0("topology_", subnum,".pdf"), paper ="a4")
plot(sub1G,
edge.arrow.size=.2,
vertex.size = vertexAtributes %>%
pull(area) / 250000,
vertex.label.cex=0.25,
#vertex.label.dist=0, #en A3 on met les noms des noeuds dans les noeuds.
vertex.label.dist=0.3,#en A4 on met les noms des noeuds au dessus des noeuds.
vertex.label.dist=0, #en A3 on met les noms des noeuds dans les noeuds.
#vertex.label.dist=0.3,#en A4 on met les noms des noeuds au dessus des noeuds.
#layout = vertexAtributes %>% # Commenter cette ligne et les deux suivante si on ne veux pas les coordonnées
# select(x,y) %>% # intéressant si on veut regarder seulement la topologie sur certains sous-bassins par exemple
# as.matrix(),
......@@ -164,3 +176,4 @@ plot(sub1G,
)
dev.off()
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