Upload
dinhtuong
View
215
Download
1
Embed Size (px)
Citation preview
model-calibration
Alexander Keth
2017-08-16
Contents
0.1 User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1 Whole system plots! 4
1.1 Overall biomass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Biomass timeseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Biomass@age timeseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Number timeseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Number@age timeseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 SSB & Recruitment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.7 Biomass benchmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.8 Biomass benchmark 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.9 Physics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Physics 13
2.1 Chl_a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 Denitrifiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 NH3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 NO3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Temp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6 salt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.7 Fluxes 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.8 Fluxes 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.9 Relative change of water column height compared to nominal_dz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3 Calibration plots 22
3.1 Structural nitrogen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2 Reserve nitrogen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3 Biomass per ageclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4 Eat per ageclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5 Growth per ageclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.6 Growth in relation to initial conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.7 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.8 Biomass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4 Distribution plots 30
4.1 Numbers @ age . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.2 Biomass @ age . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5 Diet Plots 32
5.1 Diet plot 1: Cephalopod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2 Diet plot 2: Diatom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.3 Diet plot 3: Labile detritus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.4 Diet plot 4: Megazoobenthos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.5 Diet plot 5: Refractory detritus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.6 Diet plot 6: Shallow piscivorous fish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.7 Diet plot 7: Small planktivorous fish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6 Spatial Plots 1 40
6.1 Spatial Plot 1: Carrion3 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2 Spatial Plot 2: Cephalopod 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.3 Spatial Plot 3: Diatom 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.4 Spatial Plot 4: Labile detritus 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.5 Spatial Plot 5: Megazoobenthos 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.6 Spatial Plot 6: Refractory detritus 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.7 Spatial Plot 7: Shallow piscivorous fish 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.8 Spatial Plot 8: Shallow piscivorous fish 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.9 Spatial Plot 9: Small planktivorous fish 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.10 Spatial Plot 10: Small planktivorous fish 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7 Spatial Plots 2 50
7.1 Spatial Plot 1: Carrion3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.2 Spatial Plot 2: Cephalopod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.3 Spatial Plot 3: Diatom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7.4 Spatial Plot 4: Labile detritus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.5 Spatial Plot 5: Megazoobenthos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.6 Spatial Plot 6: Refractory detritus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7.7 Spatial Plot 7: Shallow piscivorous fish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.8 Spatial Plot 8: Small planktivorous fish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
NOTE: This vigentte is optimised for longer simulation runs. Therefore the output is not as pleasant due to the fact that the dummy setas file have a running time of 5 years.
In order to use this vignette make sure to render model-preprocess.Rmd first. Either save the resulting list of dataframes as shown in data-raw/data-vignette-model-preprocess.R
or render both vignettes model-preprocess.Rmd and model-calibration.Rmd in the same R-instance. Of course, you can also use a personalised version of mode-preprocess.Rmd.
Please make sure to add all resulting dataframes to the list of dataframes at the end of the preprocess vignette and change model-calibration.Rmd accordingly.
library("atlantistools")
library("ggplot2")
library("gridExtra")
fig_height2 <- 11
gen_labels <- list(x = "Time [years]", y = "Biomass [t]")
# You should be able to build the vignette either by clicking on "Knit PDF" in RStudio or with
# rmarkdown::render("model-calibration.Rmd")
0.1 User Input
This section is used to read in the SETAS dummy files. Please change this accordingly.
result <- preprocess
d <- system.file("extdata", "setas-model-new-trunk", package = "atlantistools")
# External recruitment data
ex_rec_ssb <- read.csv(file.path(d, "setas-ssb-rec.csv"), stringsAsFactors = FALSE)
# External biomass data
ex_bio <- read.csv(file.path(d, "setas-bench.csv"), stringsAsFactors = FALSE)
# bgm file
bgm <- file.path(d, "VMPA_setas.bgm")
1 Whole system plots!
1.1 Overall biomass
df_bio <- combine_groups(result$biomass, group_col = "species", combine_thresh = 10)
## Joining, by = "species"
plot <- plot_bar(df_bio)
update_labels(plot, labels = gen_labels)
0.0e+00
4.0e+07
8.0e+07
1.2e+08
1.6e+08
0 1 2 3
Time [years]
Bio
mas
s [t]
speciesCarrion3CephalopodDiatomLabile detritusMegazoobenthosRefractory detritusShallow piscivorous fishSmall planktivorous fish
1.2 Biomass timeseries
plot <- plot_line(result$biomass)
update_labels(plot, labels = gen_labels)
Smallplanktivorous
fish
Carrion3 Cephalopod Diatom Labiledetritus Megazoobenthos Refractory
detritus
Shallowpiscivorous
fish
0 1 2 3
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
2.5e+05
5.0e+05
7.5e+05
1.0e+06
2e+07
4e+07
6e+07
2.4e+03
2.4e+03
2.4e+03
2.4e+03
2.4e+03
2.4e+03
2e+07
4e+07
6e+07
8e+07
6.0e+06
8.0e+06
1.0e+07
1.2e+07
1.0e+05
1.5e+05
2.0e+05
2.5e+05
1.1e−10
1.1e−10
1.1e−10
8.0e+02
9.0e+02
1.0e+03
1.1e+03
1.2e+03
1.3e+03
Time [years]
Bio
mas
s [t]
1.3 Biomass@age timeseries
plot <- plot_line(result$biomass_age, col = "agecl")
update_labels(p = plot, labels = c(gen_labels, list(colour = "Ageclass")))
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 3
5.0e+01
1.0e+02
1.5e+02
2.0e+02
1e+04
2e+04
3e+04
Time [years]
Bio
mas
s [t]
Ageclass 3 4 5 6 7 8 9 10
1.4 Number timeseries
plot <- plot_line(result$nums)
update_labels(p = plot, labels = list(x = "Time [years]", y = "Numbers"))
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 31.1e+08
1.2e+08
1.3e+08
1.4e+08
1.5e+08
1.6e+08
2.5e+08
5.0e+08
7.5e+08
Time [years]
Num
bers
1.5 Number@age timeseries
plot <- plot_line(result$nums_age, col = "agecl")
update_labels(p = plot, labels = list(x = "Time [years]", y = "Numbers", colour = "Ageclass"))
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 3
2e+07
4e+07
6e+07
2e+08
4e+08
6e+08
Time [years]
Num
bers
Ageclass 1 2 3 4 5 6 7 8 9 10
1.6 SSB & Recruitment
plot_rec(result$ssb_rec, ex_data = ex_rec_ssb)
FPS FVSShallow
piscivorousfish
Smallplanktivorous
fish
0 250 500 750 1000 1250 0 1000 2000 3000 4000 5000 6000 2000 4000 6000 1000 1050 1100 1150
2.5e+04
5.0e+04
7.5e+04
2e+05
4e+05
6e+05
2e+05
4e+05
6e+05
2.5e+04
5.0e+04
7.5e+04
1.0e+05
SSB [tonnes]
Rec
ruits
[tho
usan
ds]
model atlantis dummy0
584
153316
79
Time
1.7 Biomass benchmark
names(ex_bio)[names(ex_bio) == "biomass"] <- "atoutput"
data <- result$biomass
data$model <- "atlantis"
comp <- rbind(ex_bio, data, stringsAsFactors = FALSE)
# Show atlantis as first factor!
comp$model <- factor(comp$model, levels = c("atlantis", sort(unique(comp$model))[sort(unique(comp$model)) != "atlantis"]))
# Create plot
plot <- plot_line(comp, col = "model")
update_labels(plot, gen_labels)
Shallowpiscivorous
fish
Smallplanktivorous
fish
Carrion3 Cephalopod Diatom Labiledetritus Megazoobenthos Mesozooplankton Refractory
detritus
0 1 2 3 0 1 2 3
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
2e+07
4e+07
6e+07
2.8e+00
3.0e+00
3.2e+00
3.4e+00
3.6e+00
3.8e+00
5.0e+02
1.0e+03
1.5e+03
2.0e+03
2e+07
4e+07
6e+07
8e+07
5e+06
1e+07
5.0e+04
1.0e+05
1.5e+05
2.0e+05
2.5e+05
8.0e+02
1.0e+03
1.2e+03
1.4e+03
1.1e−10
1.1e−10
1.1e−10
2.5e+05
5.0e+05
7.5e+05
1.0e+06
Time [years]
Bio
mas
s [t]
model atlantis dummy
1.8 Biomass benchmark 2
plot <- plot_line(result$biomass) %>% update_labels(labels = gen_labels)
plot_add_range(plot, ex_bio)
Shallowpiscivorous
fish
Smallplanktivorous
fish
Carrion3 Cephalopod Diatom Labiledetritus Megazoobenthos Mesozooplankton Refractory
detritus
0 1 2 3 0 1 2 3
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
2e+07
4e+07
6e+07
3.0e+00
3.2e+00
3.4e+00
3.6e+00
3.8e+00
5.0e+02
1.0e+03
1.5e+03
2.0e+03
2e+07
4e+07
6e+07
8e+07
5e+06
1e+07
5.0e+04
1.0e+05
1.5e+05
2.0e+05
2.5e+05
8.0e+02
1.0e+03
1.2e+03
1.4e+03
1.1e−10
1.1e−10
1.1e−10
2.5e+05
5.0e+05
7.5e+05
1.0e+06
Time [years]
Bio
mas
s [t]
model dummy
1.9 Physics
plot <- plot_line(result$physics, wrap = NULL)
custom_grid(plot, grid_x = "polygon", grid_y = "variable")
1 2 3 4 5
Chl_a
Denitrifiction
NH3
NO3
Temp
salt
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
1e+02
2e+02
3e+02
1e−01
2e−01
3e−01
4e−01
5e−01
3.0e+01
6.0e+01
9.0e+01
1.2e+02
1e+01
2e+01
3e+01
4e+01
5e+01
4.0e+00
8.0e+00
1.2e+01
1.6e+01
3.5e+01
3.5e+01
3.5e+01
time
atou
tput
2 Physics
physics <- result$physics %>%
flip_layers() %>%
split(., .$variable)
plots <- lapply(physics, plot_line, wrap = NULL) %>%
lapply(., custom_grid, grid_x = "polygon", grid_y = "layer")
for (i in seq_along(plots)) {
cat(paste0("## ", names(plots)[i]), sep = "\n")
plot <- update_labels(plots[[i]], labels = list(y = names(plots)[i]))
print(plot)
cat("\n\n")
}
2.1 Chl_a
1 2 3 4 5
1
2
3
4
5
6
7
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
2.5e−02
5.0e−02
7.5e−02
5.0e−02
1.0e−01
1.5e−01
2.0e−01
2.5e−01
4.0e−01
8.0e−01
1.2e+00
4.0e−01
8.0e−01
1.2e+00
1.6e+00
5.0e−02
1.0e−01
1.5e−01
2.0e−01
9.2e−03
9.6e−03
1.0e−02
1e+02
2e+02
3e+02
time
Chl
_a
2.2 Denitrifiction
1 2 3 4 5
7
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
1e−01
2e−01
3e−01
4e−01
5e−01
time
Den
itrifi
ctio
n
2.3 NH3
1 2 3 4 5
1
2
3
4
5
6
7
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
2e+01
4e+01
6e+01
2e+01
4e+01
6e+01
1.0e+01
1.5e+01
2.0e+01
3.0e+01
6.0e+01
9.0e+01
1.2e+02
2.5e+01
2.8e+01
3.0e+01
3.2e+01
3.5e+01
3.3e+01
3.3e+01
3.3e+01
3.0e+01
6.0e+01
9.0e+01
1.2e+02
time
NH
3
2.4 NO3
1 2 3 4 5
1
2
3
4
5
6
7
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
5.2e+00
5.4e+00
5.6e+00
5.8e+00
6.0e+00
6.0e+00
6.4e+00
6.8e+00
7.2e+00
1.0e+01
1.1e+01
1.2e+01
1.3e+01
2e+01
3e+01
4e+01
5e+01
2.5e+01
2.6e+01
2.6e+01
2.6e+01
3.3e+01
3.3e+01
3.3e+01
2e+01
3e+01
4e+01
5e+01
time
NO
3
2.5 Temp
1 2 3 4 5
1
2
3
4
5
6
7
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
1.3e+01
1.5e+01
1.7e+01
1.3e+01
1.5e+01
1.7e+01
1.2e+01
1.3e+01
1.4e+01
1.5e+01
1.6e+01
1.2e+01
1.3e+01
1.4e+01
1.5e+01
1.0e+011.1e+011.2e+011.3e+011.4e+011.5e+01
5.0e+00
7.5e+00
1.0e+01
1.2e+01
1.5e+01
5.0e+00
7.5e+00
1.0e+01
1.2e+01
1.5e+01
time
Tem
p
2.6 salt
1 2 3 4 5
1
2
3
4
5
6
7
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
3.5e+01
time
salt
2.7 Fluxes 1
plot <- flip_layers(result$flux) %>%
plot_line(wrap = NULL, col = "variable")
custom_grid(plot, grid_x = "polygon", grid_y = "layer")
1 2 3 4 5
1
2
3
4
5
6
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
−2e+04
−1e+04
0e+00
1e+04
−4e+04
−2e+04
0e+00
−1e+05
−5e+04
0e+00
−1.5e+05
−1.0e+05
−5.0e+04
0.0e+00
5.0e+04
−2e+05−1e+05
0e+001e+052e+053e+05
−5e+04
0e+00
5e+04
time
atou
tput
variable eflux vflux
2.8 Fluxes 2
plot <- flip_layers(result$sink) %>%
plot_line(wrap = NULL, col = "variable")
custom_grid(plot, grid_x = "polygon", grid_y = "layer")
1 2 3 4 5
1
2
3
4
5
6
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
1e+00
2e+00
3e+00
4e+00
5e+00
6e+00
1e+00
2e+00
3e+00
4e+00
5e+00
1e+00
2e+00
3e+00
4e+00
5e+00
6e+00
2.5e+00
5.0e+00
7.5e+00
2.0e+00
4.0e+00
6.0e+00
8.0e+00
1.0e+01
1.2e+01
1.0e+00
1.5e+00
2.0e+00
2.5e+00
3.0e+00
time
atou
tput
variable hdsink hdsource
2.9 Relative change of water column height compared to nominal_dz
check_dz <- result$dz %>%
dplyr::left_join(result$nominal_dz, by = c("polygon", "layer")) %>%
dplyr::mutate(check_dz = atoutput.x / atoutput.y) %>%
dplyr::filter(!is.na(check_dz)) # remove sediment layer
plot <- plot_line(check_dz, x = "time", y = "check_dz", wrap = "polygon", col = "layer")
update_labels(plot, list(x = "Time [years]", y = expression(dz/nominal_dz)))
1 2 3 4 5
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
6e−01
8e−01
1e+00
4e−01
6e−01
8e−01
1e+00
1.0e+00
1.0e+00
1.1e+00
1.2e+00
1.0e+00
1.0e+00
1.1e+00
1.2e+00
1.0e+00
1.0e+00
1.1e+00
1.2e+00
Time [years]
dzno
min
al_d
z
factor(layer) 0 1 2 3 4 5 6
3 Calibration plots
3.1 Structural nitrogen
df_rel <- convert_relative_initial(result$structn_age)
plot <- plot_line(df_rel, col = "agecl")
plot <- update_labels(plot, list(x = "Time [years]", y = expression(SN/SN[init])))
plot_add_box(plot)
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 3
5.0e−01
1.0e+00
1.5e+00
6.0e−01
9.0e−01
1.2e+00
Time [years]
SN
SN
init
factor(agecl) 1 2 3 4 5 6 7 8 9 10
3.2 Reserve nitrogen
df_rel <- convert_relative_initial(result$resn_age)
plot <- plot_line(df_rel, col = "agecl")
plot <- update_labels(plot, list(x = "Time [years]", y = expression(RN/RN[init])))
plot_add_box(plot)
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 3
5.0e−01
1.0e+00
1.5e+00
5.0e−01
7.5e−01
1.0e+00
1.2e+00
1.5e+00
Time [years]
RN
RN
init
factor(agecl) 1 2 3 4 5 6 7 8 9 10
3.3 Biomass per ageclass
df_rel <- convert_relative_initial(result$biomass_age)
plot <- plot_line(df_rel, col = "agecl")
plot <- update_labels(plot, list(x = "Time [years]", y = expression(Biomass/Biomass[init])))
plot_add_box(plot)
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 3
5.0e−01
1.0e+00
1.5e+00
2e+00
4e+00
6e+00
Time [years]
Bio
mas
sB
iom
ass i
nit
factor(agecl) 3 4 5 6 7 8 9 10
3.4 Eat per ageclass
df_rel <- convert_relative_initial(result$eat_age)
plot <- plot_line(df_rel, col = "agecl")
plot <- update_labels(plot, list(x = "Time [years]", y = expression(Cons./Cons.[init])))
plot_add_box(plot)
Shallowpiscivorous
fish
Smallplanktivorous
fish
1 2 3 1 2 3
4.0e−01
8.0e−01
1.2e+00
1.6e+00
1e+00
2e+00
Time [years]
Con
s.C
ons.
init
factor(agecl) 1 2 3 4 5 6 7 8 9 10
3.5 Growth per ageclass
df_rel <- convert_relative_initial(result$growth_age)
plot <- plot_line(df_rel, col = "agecl")
plot <- update_labels(plot, list(x = "Time [years]", y = expression(Growth/Growth[init])))
plot_add_box(plot)
Shallowpiscivorous
fish
Smallplanktivorous
fish
1 2 3 1 2 3
5.0e−01
7.5e−01
1.0e+00
1.2e+00
1.5e+00
5.0e−01
7.5e−01
1.0e+00
1.2e+00
1.5e+00
Time [years]
Gro
wth
Gro
wth
init
factor(agecl) 1 2 3 4 5 6 7 8 9 10
3.6 Growth in relation to initial conditions
plot <- plot_line(result$growth_rel_init, y = "gr_rel", col = "agecl")
update_labels(plot, list(y = expression((Growth - Growth[req])/Growth[req])))
Shallowpiscivorous
fish
Smallplanktivorous
fish
1 2 3 1 2 3
−5e−01
0e+00
5e−01
0e+00
2e+02
4e+02
6e+02
8e+02
time
(Gro
wth
−G
row
thre
q)G
row
thre
q
factor(agecl) 1 2 3 4 5 6 7 8 9 10
3.7 Numbers
df_rel <- convert_relative_initial(result$nums_age)
plot <- plot_line(df_rel, col = "agecl")
plot <- update_labels(plot, list(x = "Time [years]", y = expression(Numbers/Numbers[init])))
plot_add_box(plot)
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 3
1e+00
2e+00
3e+00
4e+00
5e+00
4.0e+00
8.0e+00
1.2e+01
1.6e+01
Time [years]
Num
bers
Num
bers
init
factor(agecl) 1 2 3 4 5 6 7 8 9 10
3.8 Biomass
df_rel <- convert_relative_initial(result$biomass)
plot <- plot_line(df_rel)
plot <- update_labels(plot, list(x = "Time [years]", y = expression(Biomass/Biomass[init])))
plot_add_box(plot)
Cephalopod Diatom Labiledetritus Megazoobenthos Refractory
detritus
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 35.0e−01
7.5e−01
1.0e+00
1.2e+00
1.5e+00
5.0e−01
1.0e+00
1.5e+00
2.0e+00
5.0e−01
1.0e+00
1.5e+00
5.0e−01
7.5e−01
1.0e+00
1.2e+00
1.5e+00
5.0e−01
1.0e+00
1.5e+00
5.0e−01
1.0e+00
1.5e+00
2.0e+00
2.5e+00
1e+00
2e+00
3e+00
Time [years]
Bio
mas
sB
iom
ass i
nit
4 Distribution plots
4.1 Numbers @ age
df <- agg_perc(result$nums_age, groups = c("time", "species"))
plot <- plot_bar(df, fill = "agecl", wrap = "species")
update_labels(plot, labels = list(x = "Time [years]", y = "Numbers [%]"))
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 30.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Time [years]
Num
bers
[%]
factor(agecl) 1 2 3 4 5 6 7 8 9 10
4.2 Biomass @ age
df <- agg_perc(result$biomass_age, groups = c("time", "species"))
plot <- plot_bar(df, fill = "agecl", wrap = "species")
update_labels(plot, labels = list(x = "Time [years]", y = "Biomass [%]"))
Shallowpiscivorous
fish
Smallplanktivorous
fish
0 1 2 3 0 1 2 30.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Time [years]
Bio
mas
s [%
]
factor(agecl) 3 4 5 6 7 8 9 10
5 Diet Plots
## Joining, by = c("time", "pred", "agecl", "prey")
## Joining, by = c("time", "pred", "agecl", "prey")
5.1 Diet plot 1: Cephalopod
Diet proportions for species: Cephalopod
agecl: 1
1 20.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
dato
r pe
rspe
ctiv
e
preyCephalopodSmall planktivorous fish
agecl: 6 agecl: 7 agecl: 8 agecl: 9 agecl: 10
agecl: 1 agecl: 2 agecl: 3 agecl: 4 agecl: 5
1 2 1 2 1 2 1 2 1 2
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
y pe
rspe
ctiv
e
predShallow piscivorous fishCephalopod
5.2 Diet plot 2: Diatom
Diet proportions for species: Diatom
agecl: 6 agecl: 7 agecl: 8 agecl: 9 agecl: 10
agecl: 1 agecl: 2 agecl: 3 agecl: 4 agecl: 5
1 2 1 2 1 2 1 2 1 2
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
y pe
rspe
ctiv
e
predSmall planktivorous fishShallow piscivorous fish
5.3 Diet plot 3: Labile detritus
Diet proportions for species: Labile detritus
agecl: 6 agecl: 7 agecl: 8 agecl: 9 agecl: 10
agecl: 1 agecl: 2 agecl: 3 agecl: 4 agecl: 5
1 2 1 2 1 2 1 2 1 2
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
y pe
rspe
ctiv
e
predSmall planktivorous fishMegazoobenthos
5.4 Diet plot 4: Megazoobenthos
Diet proportions for species: Megazoobenthos
agecl: 1
1 20.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
dato
r pe
rspe
ctiv
e
preyRefractory detritusLabile detritus
5.5 Diet plot 5: Refractory detritus
Diet proportions for species: Refractory detritus
agecl: 6 agecl: 7 agecl: 8 agecl: 9 agecl: 10
agecl: 1 agecl: 2 agecl: 3 agecl: 4 agecl: 5
1 2 1 2 1 2 1 2 1 2
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
y pe
rspe
ctiv
e
predSmall planktivorous fishMegazoobenthos
5.6 Diet plot 6: Shallow piscivorous fish
Diet proportions for species: Shallow piscivorous fish
agecl: 6 agecl: 7 agecl: 8 agecl: 9 agecl: 10
agecl: 1 agecl: 2 agecl: 3 agecl: 4 agecl: 5
1 2 1 2 1 2 1 2 1 2
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
dato
r pe
rspe
ctiv
e
preyCephalopodDiatomShallow piscivorous fishSmall planktivorous fish
agecl: 8 agecl: 9 agecl: 10
agecl: 3 agecl: 4 agecl: 5 agecl: 6 agecl: 7
1 2 1 2 1 2
1 2 1 20.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
y pe
rspe
ctiv
e
predShallow piscivorous fish
5.7 Diet plot 7: Small planktivorous fish
Diet proportions for species: Small planktivorous fish
agecl: 6 agecl: 7 agecl: 8 agecl: 9 agecl: 10
agecl: 1 agecl: 2 agecl: 3 agecl: 4 agecl: 5
1.0 1.5 2.0 2.5 1.0 1.5 2.0 2.5 1.0 1.5 2.0 2.5 1.0 1.5 2.0 2.5 1.0 1.5 2.0 2.5
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
dato
r pe
rspe
ctiv
e
preyDiatomLabile detritusRefractory detritusSmall planktivorous fish
agecl: 6 agecl: 7 agecl: 8 agecl: 9 agecl: 10
agecl: 1 agecl: 2 agecl: 3 agecl: 4 agecl: 5
1 2 1 2 1 2 1 2 1 2
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
0.0e+00
2.5e−01
5.0e−01
7.5e−01
1.0e+00
Pre
y pe
rspe
ctiv
e
predShallow piscivorous fishCephalopodSmall planktivorous fish
6 Spatial Plots 1
## Joining, by = "polygon"
6.1 Spatial Plot 1: Carrion3 1
0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146 148 150 152 154146 148 150 152 154146 148 150 152 154146 148 150 152 154146 148 150 152 154146 148 150 152 154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.1 0.2biomass distribution
Species: Carrion3 with stanza: 1
0 12
34
5
6 7
8
910
6.2 Spatial Plot 2: Cephalopod 1
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.1 0.2 0.3biomass distribution
Species: Cephalopod with stanza: 1
0 12
34
5
6 7
8
910
6.3 Spatial Plot 3: Diatom 1
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.05 0.10 0.15biomass distribution
Species: Diatom with stanza: 1
0 12
34
5
6 7
8
910
6.4 Spatial Plot 4: Labile detritus 1
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.1 0.2 0.3 0.4biomass distribution
Species: Labile detritus with stanza: 1
0 12
34
5
6 7
8
910
6.5 Spatial Plot 5: Megazoobenthos 1
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.32 0.33 0.34 0.35 0.36biomass distribution
Species: Megazoobenthos with stanza: 1
0 12
34
5
6 7
8
910
6.6 Spatial Plot 6: Refractory detritus 1
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.1 0.2 0.3 0.4 0.5biomass distribution
Species: Refractory detritus with stanza: 1
0 12
34
5
6 7
8
910
6.7 Spatial Plot 7: Shallow piscivorous fish 1
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.25 0.50 0.75biomass distribution
Species: Shallow piscivorous fish with stanza: 1
0 12
34
5
6 7
8
910
6.8 Spatial Plot 8: Shallow piscivorous fish 2
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.2 0.4 0.6 0.8biomass distribution
Species: Shallow piscivorous fish with stanza: 2
0 12
34
5
6 7
8
910
6.9 Spatial Plot 9: Small planktivorous fish 1
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.05 0.10 0.15 0.20 0.25biomass distribution
Species: Small planktivorous fish with stanza: 1
0 12
34
5
6 7
8
910
6.10 Spatial Plot 10: Small planktivorous fish 2
0 0.4 0.8 1.2 1.6 2 3
1
2
3
4
5
6
7
146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154146148150152154
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
−46
−44
−42
long
lat
0.05 0.10 0.15 0.20 0.25biomass distribution
Species: Small planktivorous fish with stanza: 2
0 12
34
5
6 7
8
910
7 Spatial Plots 2
## Joining, by = c("time", "polygon")
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
7.1 Spatial Plot 1: Carrion3
1 2 3 4 5
1 2 3 1 2 3 1 2 3 1 2 3 1 2 31.4e−25
1.5e−24
2.8e−24
4.1e−24
5.4e−24
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
1e−112e−113e−114e−115e−11
Biomass [t]
Species: Carrion3 with stanza: 1
0 12
34
5
6 7
8
910
7.2 Spatial Plot 2: Cephalopod
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
2e−08
4e−08
6e−08
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
2e+04
4e+04
6e+04
Biomass [t]
Species: Cephalopod with stanza: 1
0 12
34
5
6 7
8
910
7.3 Spatial Plot 3: Diatom
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
1e−06
2e−06
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
1e+06
2e+06
3e+06
4e+06
Biomass [t]
Species: Diatom with stanza: 1
0 12
34
5
6 7
8
910
7.4 Spatial Plot 4: Labile detritus
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
2e−07
4e−07
6e−07
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
1e+07
2e+07
3e+07
4e+07Biomass [t]
Species: Labile detritus with stanza: 1
0 12
34
5
6 7
8
910
7.5 Spatial Plot 5: Megazoobenthos
1 2 3
0 1 2 30 1 2 30 1 2 3
4e−10
6e−10
8e−10
1e−09
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
8.0e+02
8.5e+02
9.0e+02Biomass [t]
Species: Megazoobenthos with stanza: 1
0 12
34
5
6 7
8
910
7.6 Spatial Plot 6: Refractory detritus
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
5.0e−07
1.0e−06
1.5e−06
2.0e−06
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
1e+07
2e+07
3e+07
Biomass [t]
Species: Refractory detritus with stanza: 1
0 12
34
5
6 7
8
910
7.7 Spatial Plot 7: Shallow piscivorous fish
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
1e−07
2e−07
3e−07
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
1e+05
2e+05
3e+05
Biomass [t]
Species: Shallow piscivorous fish with stanza: 1
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
1e−07
2e−07
3e−07
4e−07
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
1e+05
2e+05
3e+05
Biomass [t]
Species: Shallow piscivorous fish with stanza: 2
0 12
34
5
6 7
8
910
7.8 Spatial Plot 8: Small planktivorous fish
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
5.0e−12
1.0e−11
1.5e−11
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
5.0e+00
1.0e+01
1.5e+01Biomass [t]
Species: Small planktivorous fish with stanza: 1
1 2 3 4 5
0 1 2 30 1 2 30 1 2 30 1 2 30 1 2 3
1e−10
2e−10
3e−10
4e−10
Time [years]
Bio
mas
sden
sity
[t/m
^−3]
1e+02
2e+02
3e+02
4e+02Biomass [t]
Species: Small planktivorous fish with stanza: 2
0 12
34
5
6 7
8
910