Commit 3c34625e authored by patrick.lambert's avatar patrick.lambert
Browse files

Merge branch 'exploration_GR3D_process' of...

Merge branch 'exploration_GR3D_process' of gitlab-ssh.irstea.fr:SimAquaLife/GR3D into SpawnerRunAnalysis
parents 906e0d48 1321df01
......@@ -184,8 +184,8 @@ Stich2020_sel <- read_csv("../NEA_calibration_offline/Stich_Table 9.csv") %>%
mutate(L0_theo = vonBertalanffyLengthAtHatch(Linf, K, t0))
#create a data frame and compute L at age with values from Stich
growthInOffshore <- expand_grid(basin_name = nea_riverBasinFeatures$basin_name , age = seq(0,14.75,.25)) %>%
mutate(season = case_when(
growthInOffshore <- expand_grid(basin_name = nea_riverBasinFeatures$basin_name , age = seq(0,9.75,.25)) %>%
mutate(season = case_when (
(age - floor(age)) == 0.00 ~ 'spring',
(age - floor(age)) == 0.25 ~ 'summer',
(age - floor(age)) == 0.50 ~ 'fall',
......@@ -587,7 +587,7 @@ growParOptim <- data.frame(value = growth_optimal$par) %>%
rownames_to_column("parameter")
#Rdata
save(growth_optimal, res, res_B, res_C, file = "growth_optimal.RData")
#save(growth_optimal, res, res_B, res_C, file = "growth_optimal.RData")
#csv
write_csv(growParOptim, "growParOptim.csv")
......@@ -613,6 +613,7 @@ dataVerif %>% group_by(metapop, age) %>%
geom_line(aes(y = LStich)) +
geom_line(aes(y = L))
save(dataVerif, growth_optimal,res, res_B, res_C, file = "growth_optimal.RData")
# thermal response curve with average seasonal temperature experienced by fish
dataTemperatureMetapop <- dataVerif %>%
......@@ -636,11 +637,10 @@ data.frame(temperature = seq(0,40,0.1)) %>%
```{r draw growth curves}
load("growth_optimal.RData")
#load("growth_optimal.RData")
growthCurves = computeGrowOpt(growth_optimal$par, growthInOffshore)
save(growthCurves, file = "growthCurves.RData")
#growth curve according to metapopulations
growthCurves %>%
......@@ -651,7 +651,8 @@ growthCurves %>%
#scale_x_continuous(limits = c(0, 10)) +
geom_hline(yintercept = 45, color = "pink", linetype =1)+ #female
geom_hline(yintercept = 40, color = "lightblue", linetype = 1)+
facet_wrap(.~ metapop, ncol =3)
geom_vline(aes(age), xintercept = 8, linetype = 1)+
facet_wrap(.~ metapop, ncol =1)
#temperature effect
temp <- seq(0,45,0.1)
......@@ -680,30 +681,6 @@ df %>%
```
```{r growth try, echo = FALSE, warning=FALSE}
#k depending on water temperature in ofsshore basins
kTempEffect = function(kopt, temp, Tmin, Topt, Tmax){
kTemp <- kopt * temperatureEffect(temp,
Tmin,
Topt,
Tmax)
return(kTemp)}
#Generic function
vonBertalanffyGrowthWithTempEffect = function(temp, age, L0, Linf, Kopt, Tmin, Topt, Tmax){
koptTemp = kTempEffect(Kopt, temp, Tmin, Topt, Tmax)
t0 = log(1 - L0 / Linf) / koptTemp
return(Linf * (1 - exp(-koptTemp * (age - t0))))
}
```
......
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