Commit bdf18389 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 95ee5985 31d06ade
<list>
<species.DiadromousFishGroup>
<name>species A</name>
<color>
<red>255</red>
<green>0</green>
<blue>0</blue>
<alpha>255</alpha>
</color>
<dMaxDisp>300.0</dMaxDisp>
<nutrientRoutine>
<nutrientsOfInterest>
<string>N</string>
<string>P</string>
</nutrientsOfInterest>
<residenceTime>30.0</residenceTime>
<excretionRate class="hashtable">
<entry>
<string>P</string>
<double>2.17E-6</double>
</entry>
<entry>
<string>N</string>
<double>2.471E-5</double>
</entry>
</excretionRate>
<fishFeaturesPreSpawning class="hashtable">
<entry>
<species.DiadromousFish_-Gender>MALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>bLW_Gonad</string>
<double>3.3838</double>
</entry>
<entry>
<string>aLW_Gonad</string>
<double>-8.8744</double>
</entry>
<entry>
<string>bLW</string>
<double>3.2252</double>
</entry>
<entry>
<string>aLW</string>
<double>0.004095817237891344</double>
</entry>
</hashtable>
</entry>
<entry>
<species.DiadromousFish_-Gender>FEMALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>bLW_Gonad</string>
<double>2.6729</double>
</entry>
<entry>
<string>aLW_Gonad</string>
<double>-5.2425</double>
</entry>
<entry>
<string>bLW</string>
<double>3.3429</double>
</entry>
<entry>
<string>aLW</string>
<double>0.002665367811305362</double>
</entry>
</hashtable>
</entry>
</fishFeaturesPreSpawning>
<fishFeaturesPostSpawning class="hashtable">
<entry>
<species.DiadromousFish_-Gender>MALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>bLW_Gonad</string>
<double>3.8331</double>
</entry>
<entry>
<string>aLW_Gonad</string>
<double>-11.285</double>
</entry>
<entry>
<string>bLW</string>
<double>2.9973</double>
</entry>
<entry>
<string>aLW</string>
<double>0.010383887012522573</double>
</entry>
</hashtable>
</entry>
<entry>
<species.DiadromousFish_-Gender>FEMALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>bLW_Gonad</string>
<double>2.8545</double>
</entry>
<entry>
<string>aLW_Gonad</string>
<double>-6.6234</double>
</entry>
<entry>
<string>bLW</string>
<double>2.9418</double>
</entry>
<entry>
<string>aLW</string>
<double>0.013199187556948952</double>
</entry>
</hashtable>
</entry>
</fishFeaturesPostSpawning>
<juvenileFeatures class="hashtable">
<entry>
<string>bLW</string>
<double>3.0306</double>
</entry>
<entry>
<string>aLW</string>
<double>0.006986429759979109</double>
</entry>
</juvenileFeatures>
<compoCarcassPreSpawning class="hashtable">
<entry>
<species.DiadromousFish_-Gender>MALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>P</string>
<double>0.00666</double>
</entry>
<entry>
<string>N</string>
<double>0.02941</double>
</entry>
</hashtable>
</entry>
<entry>
<species.DiadromousFish_-Gender>FEMALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>P</string>
<double>0.006730000000000001</double>
</entry>
<entry>
<string>N</string>
<double>0.029580000000000002</double>
</entry>
</hashtable>
</entry>
</compoCarcassPreSpawning>
<compoGametes class="hashtable">
<entry>
<species.DiadromousFish_-Gender>MALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>P</string>
<double>0.00724</double>
</entry>
<entry>
<string>N</string>
<double>0.0325</double>
</entry>
</hashtable>
</entry>
<entry>
<species.DiadromousFish_-Gender>FEMALE</species.DiadromousFish_-Gender>
<hashtable>
<entry>
<string>P</string>
<double>0.0032</double>
</entry>
<entry>
<string>N</string>
<double>0.03242</double>
</entry>
</hashtable>
</entry>
</compoGametes>
<compoJuvenile class="hashtable">
<entry>
<string>P</string>
<double>0.00887</double>
</entry>
<entry>
<string>N</string>
<double>0.02803</double>
</entry>
</compoJuvenile>
</nutrientRoutine>
<fileNameInputForInitialObservation>data/input/reality/Obs1900.csv</fileNameInputForInitialObservation>
<centileForRange>0.95</centileForRange>
<parameterSetfileName>data/input/reality/parameterSet.csv</parameterSetfileName>
<parameterSetLine>0</parameterSetLine>
<yearOfTheUpdate>0</yearOfTheUpdate>
<basinsToUpdateFile>data/input/reality/basinsToUpdate.csv</basinsToUpdateFile>
<outputPath>data/output/northeastamerica/</outputPath>
<minYearToWrite>1900</minYearToWrite>
<fileNameFluxes>nutrientFluxes</fileNameFluxes>
<lengthAtHatching>2.8</lengthAtHatching>
<linfVonBertForFemale>76.0</linfVonBertForFemale>
<linfVonBertForMale>76.0</linfVonBertForMale>
<lFirstMaturityForFemale>45.0</lFirstMaturityForFemale>
<lFirstMaturityForMale>40.0</lFirstMaturityForMale>
<processes>
<processesAtBegin>
</processesAtBegin>
<processesEachStep>
<environment.InformTime>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<consoleDisplay>true</consoleDisplay>
</environment.InformTime>
<species.PlopProcess>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<temporisation>0</temporisation>
</species.PlopProcess>
<species.PopulateBasinNetworkSeveralTimesAccordingToBasinSize>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<nbFishPerSI>100000</nbFishPerSI>
<initialLength>2.8</initialLength>
<etaPopulate>40.0</etaPopulate>
<timesOfPopulate>5</timesOfPopulate>
<populateSeason>SPRING</populateSeason>
</species.PopulateBasinNetworkSeveralTimesAccordingToBasinSize>
<species.Age>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
</species.Age>
<species.Grow>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<tempMinGrow>3.0</tempMinGrow>
<tempMaxGrow>26.0</tempMaxGrow>
<tempOptGrow>17.0</tempOptGrow>
<kOptForFemale>0.3236</kOptForFemale>
<kOptForMale>0.2141</kOptForMale>
<sigmaDeltaLVonBert>0.2</sigmaDeltaLVonBert>
</species.Grow>
<species.MigrateFromOffshoreToInshore>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<migrationSeasonToReachInshore>SPRING</migrationSeasonToReachInshore>
</species.MigrateFromOffshoreToInshore>
<species.DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<alpha0Rep>-2.9</alpha0Rep>
<alpha1Rep>19.7</alpha1Rep>
<alpha3Rep>0.0</alpha3Rep>
<meanBvSurface>17351</meanBvSurface>
<standardDeviationBvSurface>35594</standardDeviationBvSurface>
<meanInterDistance>300.0</meanInterDistance>
<standardDeviationInterDistance>978.0</standardDeviationInterDistance>
<pHomingForReachEquil>0.97</pHomingForReachEquil>
<pHomingAfterEquil>0.97</pHomingAfterEquil>
<NbYearForInstallPop>0</NbYearForInstallPop>
<riverMigrationSeason>SPRING</riverMigrationSeason>
<alpha2Rep>0.0</alpha2Rep>
<meanSpawnersLengthAtRepro>45.0</meanSpawnersLengthAtRepro>
<standardDeviationOfSpawnersLengthAtRepro>2.0</standardDeviationOfSpawnersLengthAtRepro>
<weightOfDeathBasin>0.4</weightOfDeathBasin>
</species.DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin>
<species.Survive>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<tempMinSurvivalSpawnerInRiv>8</tempMinSurvivalSpawnerInRiv>
<tempOptSurvivalSpawnerInRiv>17.0</tempOptSurvivalSpawnerInRiv>
<tempMaxSurvivalSpawnerInRiv>26</tempMaxSurvivalSpawnerInRiv>
<survivalProbOptSpawnerInRiv>1.0</survivalProbOptSpawnerInRiv>
<!--<mortalityRateInRiver>0.4</mortalityRateInRiver> -->
<mortalityRateInSea>0.4</mortalityRateInSea>
<mortalityRateInOffshore>0.4</mortalityRateInOffshore>
</species.Survive>
<!--<analysis.WriteEffectiveAndBiomassImportFluxes> <synchronisationMode>ASYNCHRONOUS</synchronisationMode> <exportSeason>SPRING</exportSeason>
<fileNameOutput>effectiveBiomassFluxesBeforeReproduction</fileNameOutput> </anaysis.WriteEffectiveAndBiomassImportFluxes> -->
<species.ReproduceAndSurviveAfterReproductionWithDiagnose>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<reproductionSeason>SPRING</reproductionSeason>
<tempMinRep>10</tempMinRep>
<tempOptRep>17</tempOptRep>
<tempMaxRep>30</tempMaxRep>
<Soffset>-1.0</Soffset>
<eta>2.4</eta>
<ratioS95__S50>1.9</ratioS95__S50>
<a>270000</a>
<delta__t>0.33</delta__t>
<survOptRep>0.0017</survOptRep>
<lambda>4.1E-4</lambda>
<proportionOfFemaleAtBirth>0.5</proportionOfFemaleAtBirth>
<initialLength>2.8</initialLength>
<sigmaRecruitment>0.2</sigmaRecruitment>
<survivalRateAfterReproduction>0.1</survivalRateAfterReproduction>
<maxNumberOfSuperIndividualPerReproduction>100.0
</maxNumberOfSuperIndividualPerReproduction>
<withDiagnose>false</withDiagnose>
<displayFluxesOnConsole>false</displayFluxesOnConsole>
</species.ReproduceAndSurviveAfterReproductionWithDiagnose>
<species.MigrateFromRiverToInshore>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<migrationSeasonToReachInshore>SPRING</migrationSeasonToReachInshore>
<displayFluxesOnConsole>true</displayFluxesOnConsole>
</species.MigrateFromRiverToInshore>
<species.MigrateToOffshore>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<migrationSeasonToReachSummeringOffshore>SPRING</migrationSeasonToReachSummeringOffshore>
</species.MigrateToOffshore>
<species.MigrateBetweenOffshores>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<migrationSeasonToReachWinteringOffshore>AUTOMN</migrationSeasonToReachWinteringOffshore>
<migrationSeasonToReachSummeringOffshore>SPRING</migrationSeasonToReachSummeringOffshore>
</species.MigrateBetweenOffshores>
<environment.updateTemperatureInRIOBasin>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
</environment.updateTemperatureInRIOBasin>
</processesEachStep>
<processesAtEnd>
<analysis.WriteNutrientImportFluxes>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<fileName>nutrientImportfFluxes</fileName>
</analysis.WriteNutrientImportFluxes>
<analysis.WriteNutrientExportFluxes>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<fileName>nutrientExportFluxes</fileName>
</analysis.WriteNutrientExportFluxes>
</processesAtEnd>
</processes>
<useCemetery>false</useCemetery>
</species.DiadromousFishGroup>
</list>
......@@ -204,8 +204,8 @@
<lengthAtHatching>2.8</lengthAtHatching>
<linfVonBertForFemale>76.0</linfVonBertForFemale>
<linfVonBertForMale>76.0</linfVonBertForMale>
<lFirstMaturityForFemale>45.0</lFirstMaturityForFemale>
<lFirstMaturityForMale>40.0</lFirstMaturityForMale>
<lFirstMaturityForFemale>44.8</lFirstMaturityForFemale>
<lFirstMaturityForMale>40.2</lFirstMaturityForMale>
<processes>
<processesAtBegin>
......@@ -237,12 +237,12 @@
<species.Grow>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<tempMinGrow>3.0</tempMinGrow>
<tempMaxGrow>26.0</tempMaxGrow>
<tempOptGrow>17.0</tempOptGrow>
<kOptForFemale>0.3236</kOptForFemale>
<kOptForMale>0.2141</kOptForMale>
<sigmaDeltaLVonBert>0.2</sigmaDeltaLVonBert>
<tempMinGrow>1.7</tempMinGrow>
<tempMaxGrow>27.9</tempMaxGrow>
<tempOptGrow>4.5</tempOptGrow>
<kOptForFemale>0.57</kOptForFemale>
<kOptForMale>0.61</kOptForMale>
<sigmaDeltaLVonBert>2.9</sigmaDeltaLVonBert>
</species.Grow>
<species.MigrateFromOffshoreToInshore>
......@@ -251,29 +251,29 @@
</species.MigrateFromOffshoreToInshore>
<species.DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin>
<riverMigrationSeason>SPRING</riverMigrationSeason>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<alpha0Rep>-2.9</alpha0Rep>
<alpha1Rep>19.7</alpha1Rep>
<alpha0Rep>-40.8</alpha0Rep>
<alpha1Rep>35.8</alpha1Rep>
<alpha2Rep>0.0</alpha2Rep>
<alpha3Rep>0.0</alpha3Rep>
<meanBvSurface>17351</meanBvSurface>
<meanBvSurface>15321</meanBvSurface>
<standardDeviationBvSurface>35594</standardDeviationBvSurface>
<meanInterDistance>300.0</meanInterDistance>
<standardDeviationInterDistance>978.0</standardDeviationInterDistance>
<meanInterDistance>1803.52</meanInterDistance>
<standardDeviationInterDistance>1460.38</standardDeviationInterDistance>
<meanSpawnersLengthAtRepro>45.0</meanSpawnersLengthAtRepro>
<standardDeviationOfSpawnersLengthAtRepro>2.0</standardDeviationOfSpawnersLengthAtRepro>
<weightOfDeathBasin>0.5</weightOfDeathBasin>
<pHomingForReachEquil>0.97</pHomingForReachEquil>
<pHomingAfterEquil>0.97</pHomingAfterEquil>
<NbYearForInstallPop>0</NbYearForInstallPop>
<riverMigrationSeason>SPRING</riverMigrationSeason>
<alpha2Rep>0.0</alpha2Rep>
<meanSpawnersLengthAtRepro>45.0</meanSpawnersLengthAtRepro>
<standardDeviationOfSpawnersLengthAtRepro>2.0</standardDeviationOfSpawnersLengthAtRepro>
<weightOfDeathBasin>0.4</weightOfDeathBasin>
</species.DisperseAndMigrateToRiverWithMultiNomDistriAndDeathBasin>
<species.Survive>
<synchronisationMode>ASYNCHRONOUS</synchronisationMode>
<tempMinSurvivalSpawnerInRiv>8</tempMinSurvivalSpawnerInRiv>
<tempOptSurvivalSpawnerInRiv>17.0</tempOptSurvivalSpawnerInRiv>
<tempMaxSurvivalSpawnerInRiv>26</tempMaxSurvivalSpawnerInRiv>
<tempMinSurvivalSpawnerInRiv>5.1</tempMinSurvivalSpawnerInRiv>
<tempOptSurvivalSpawnerInRiv>16.6</tempOptSurvivalSpawnerInRiv>
<tempMaxSurvivalSpawnerInRiv>24.3</tempMaxSurvivalSpawnerInRiv>
<survivalProbOptSpawnerInRiv>1.0</survivalProbOptSpawnerInRiv>
<!--<mortalityRateInRiver>0.4</mortalityRateInRiver> -->
<mortalityRateInSea>0.4</mortalityRateInSea>
......@@ -323,7 +323,7 @@
<afterReproductionSeason>SUMMER</afterReproductionSeason>
<maximalSurvivalRate>0.1</maximalSurvivalRate>
<!-- <temperatureEffectSurvivalAfterReproduction class="temperatureEffect.LogitEffect"> -->
<!-- <Tref>22</Tref> -->
<!-- <Tref>19.9</Tref> -->
<!-- <alpha>-.1</alpha> -->
<!-- </temperatureEffectSurvivalAfterReproduction> -->
<temperatureEffectSurvivalAfterReproduction class="temperatureEffect.NoEffect">
......
......@@ -96,10 +96,10 @@ strayerSurvival = function(distance, m ){
# Spwaner survival before reproduction
# Dome-shape curve with temperature effect
#-------------------------------------------------------
spawnerSurvivalPreReproduction <- function(Triver,Tmin, Topt, Tmax){
spawnerSurvivalPreReproduction <- function(Triver,Tmin, Topt, Tmax, parSurv){
#River survival
survProbOptRiver = survivePar$survProbOptRiver
survProbOptRiver = parSurv$survProbOptRiver
spRiver = survProbOptRiver * temperatureEffect(Triver, Tmin, Topt, Tmax)
......@@ -114,16 +114,16 @@ spawnerSurvivalPreReproduction <- function(Triver,Tmin, Topt, Tmax){
#See Rougier et al, 2014; 2015 and Jatteau et al., 2017
#----------------------------------------------
#survival of larvae 14dph from Jatteau et al, 2017
stockRecruitementRelationship <- function(Triver,Tmin, Topt, Tmax, survivalStock) {
surfaceWatershed = 84810 #Surface de la Garonne
lambda = reproducePar$lambda
deltaT = reproducePar$deltaT
survOptRep = reproducePar$survOptRep
n = reproducePar$eta #simule l'effet allee
ratioS95_S50 = reproducePar$ratioS95_S50
alpha = reproducePar$a #species fecundity
survProbOptRiver = survivePar$survProbOptRiver
stockRecruitementRelationship <- function(Triver,Tmin, Topt, Tmax, survivalStock, parRep, parSurv, surfaceWatershed = 84810) {
#surfaceWatershed = 84810 Surface de la Garonne
lambda = parRep$lambda
deltaT = parRep$deltaT
survOptRep = parRep$survOptRep
eta = parRep$eta #simule l'effet allee
ratioS95_S50 = parRep$ratioS95_S50
alpha = parRep$a #species fecundity
survProbOptRiver = parSurv$survProbOptRiver
periodAtSea = 5 - deltaT
###--------------------- SR relationship -----------------
......@@ -147,7 +147,7 @@ stockRecruitementRelationship <- function(Triver,Tmin, Topt, Tmax, survivalStock
#p = proportion de g?niteurs participant ? la reproduction en focntion de la quantit? de g?niteur total
#p = 1/(1+exp(-log(19)*(S-n)/(Ratio*surfaceWatershed)))
S95 = n * surfaceWatershed
S95 = eta * surfaceWatershed
S50 = S95/ratioS95_S50
p = 1/(1 + exp(-log(19)*(survivalStock - S50)/(S95 - S50)))
......@@ -156,7 +156,7 @@ stockRecruitementRelationship <- function(Triver,Tmin, Topt, Tmax, survivalStock
#R0 = aj * S * p
alleeEffect = 1/(1 + exp(-log(19)*(survivalStock - n/ratioS95_S50*surfaceWatershed)/(n*surfaceWatershed - n/ratioS95_S50*surfaceWatershed)))
alleeEffect = 1/(1 + exp(-log(19)*(survivalStock - eta/ratioS95_S50*surfaceWatershed)/(eta*surfaceWatershed - eta/ratioS95_S50*surfaceWatershed)))
Rj = (alphaj * survivalStock * alleeEffect)/(betaj + survivalStock * alleeEffect)
......@@ -172,8 +172,17 @@ stockRecruitementRelationship <- function(Triver,Tmin, Topt, Tmax, survivalStock
# ----------------------------------------------
# Spawner survival after reproduction
#----------------------------------------------
#Logit with temperature effect
spawnerSurvivalPostReproduction <- function(Triver,Tref, coeffa, coeffb){
#Logit with temperature effect depending on a Triver
spawnerSurvivalPostReproductionTempRiver <- function(Triver, coeffa, coeffb){
spRiverPostSpawn = (coeffb/ (1 + exp(coeffa*(Triver))))
return(spRiverPostSpawn)
}
#Logit with temperature effect depending on the difference between the river temperature and Tref
spawnerSurvivalPostReproductionTempRef <- function(Triver,Tref, coeffa, coeffb){
spRiverPostSpawn = (coeffb/ (1 + exp(coeffa*(Triver-Tref))))
......@@ -194,7 +203,7 @@ spawnerSurvivalPostReproductionWithBellCurve <- function(Triver, Tmin, Topt, Tma
#P3:
spRiverPostSpawn = coeffb * temperatureEffect(Triver, Tmin, Topt, Tmax)
stockAfterSpawn = S * spRiverPostSpawn
#stockAfterSpawn = S * spRiverPostSpawn
return(spRiverPostSpawn)
}
......
library(dplyr)
library(tidyr)
library(ggplot2)
distance <- as.matrix(read.csv("../../data/input/northeastamerica/distanceGridNEA.csv", row.names = 1, stringsAsFactors = FALSE))
#distance <- as.matrix(read.csv("../../data/input/atlanticarea/distanceGridAA.csv", row.names = 1, stringsAsFactors = FALSE))
distance <- distance %>%
replace(., col(.) == row(.), NA) %>%
as.data.frame() %>% mutate(destination = row.names(.)) %>%
pivot_longer(cols = -destination, names_to = 'departure', values_to = 'distance')
# true values
meanInterDistance <- mean(distance$distance, na.rm = TRUE )
standardDeviationInterDistance <- sd(distance$distance, na.rm = TRUE )
# as in XML from Rougier's application
meanInterDistance = 300
standardDeviationInterDistance = 978
alpha0 = -2.9
alpha1 = 19.7
distance <- distance %>% mutate(logitW = alpha0 - alpha1 * (distance - meanInterDistance) / standardDeviationInterDistance) %>%
mutate(W = 1/(1 + exp(-logitW)))
#filter(departure =='Pearl', destination == 'Escambia')
distance %>% group_by(departure) %>% summarise(sumW = sum(W, na.rm = TRUE)) %>%
#filter(departure == 'Potomac')
ggplot(aes(x = sumW)) + geom_histogram() +
geom_vline(aes(xintercept = mean(sumW)), color="blue", linetype="dashed", size=1)
distance %>% group_by(departure) %>% summarise(sumW = sum(W, na.rm = TRUE)) %>%
summarise(sumW = mean(sumW))
This diff is collapsed.
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