GR3D_NEA_XML_parameters.R 1.82 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#read the XML file to upload the set of parameters included in GR3D-US
fishXML <- xmlToList(xmlParse("../../data/input/northeastamerica/fishRIOBasin_Sapidissima.xml"))

#Upload parameters linked to reproduction
reproducePar = data.frame(t(unlist(fishXML[[1]][["processes"]][["processesEachStep"]][["species.ReproduceAndSurviveAfterReproductionWithDiagnose"]]))) %>% 
  select(-c(synchronisationMode, reproductionSeason, proportionOfFemaleAtBirth,
            sigmaRecruitment, maxNumberOfSuperIndividualPerReproduction, withDiagnose,
            displayFluxesOnConsole)) %>% 
  rename("TminRep" = "tempMinRep",
         "ToptRep" = "tempOptRep",
         "TmaxRep" = "tempMaxRep",
         "ratioS95_S50" = "ratioS95__S50",
         "deltaT" = "delta__t") %>% 
  mutate_all(~as.numeric(as.character(.))) 

#Upload parameters linked to survival in river 
survivePar = data.frame(t(unlist(fishXML[[1]][["processes"]][["processesEachStep"]][["species.Survive"]]))) %>% 
  select(-synchronisationMode) %>% 
  rename("TminSurv" = "tempMinSurvivalSpawnerInRiv", 
         "ToptSurv" = "tempOptSurvivalSpawnerInRiv",
         "TmaxSurv" = "tempMaxSurvivalSpawnerInRiv",
         "survProbOptRiver" = "survivalProbOptSpawnerInRiv") %>% 
  mutate_all(~as.numeric(as.character(.))) 


#Upload parameters linked to growth at sea
growPar = data.frame(t(unlist(fishXML[[1]][["processes"]][["processesEachStep"]][["species.Grow"]]))) %>% 
  select(-synchronisationMode ) %>% 
  mutate(linfVonBertForMale = fishXML[[1]][["linfVonBertForMale"]], 
         linfVonBertForFemale = fishXML[[1]][["linfVonBertForFemale"]],
         lengthAtHatching = fishXML[[1]][["lengthAtHatching"]],
         lFirstMaturityForMale = fishXML[[1]][["lFirstMaturityForMale"]],
         lFirstMaturityForFemale = fishXML[[1]][["lFirstMaturityForFemale"]]) %>% 
  mutate_all(~as.numeric(as.character(.)))