Skip to content

Commit

Permalink
Update news and documentation files
Browse files Browse the repository at this point in the history
  • Loading branch information
MayaGueguen committed Jun 18, 2024
1 parent 3bc3caf commit 83a941e
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 75 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Description: Wrapper of the C++ model FATE. FATE is a vegetation model based on
1) gather, prepare and format data to be used with FATE ;
2) run FATE simulation(s)
3) process and analyze data produced by FATE.
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Encoding: UTF-8
NeedsCompilation: yes
License:
Expand Down
13 changes: 5 additions & 8 deletions R/PRE_FATE.params_PFGlight.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@
##' \code{H} (herbaceous), \code{C} (chamaephyte) or \code{P} (phanerophyte)
##' for now \cr \cr}
##'
##' \item{(\emph{shade_factor})}{an \code{integer} between \code{1} and
##' \code{Inf} corresponding to an index of shade quantity to weight PFG
##' abundance and transform it into light resources (\emph{e.g. if two PFG
##' have shade factors of \code{1} and \code{5} respectively, for the same
##' abundances, the second PFG will produce 5 times more shade than the first
##' one}) \cr \cr}
##' \item{(\emph{shade_factor})}{a value corresponding to an index of shade
##' quantity to weight PFG abundance and transform it into light resources
##' (\emph{e.g. if two PFG have shade factors of \code{1} and \code{5}
##' respectively, for the same abundances, the second PFG will produce 5
##' times more shade than the first one}) \cr \cr}
##'
##' \item{(\emph{active_germ_low})}{an \code{integer} between \code{0} and
##' \code{100} corresponding to the proportion of seeds that will germinate for
Expand Down Expand Up @@ -381,8 +380,6 @@ PRE_FATE.params_PFGlight = function(
if (sum(colnames(mat.PFG.light) == "shade_factor") == 1)
{
.testParam_NAvalues.m("mat.PFG.light$shade_factor", mat.PFG.light$shade_factor)
.testParam_notInteger.m("mat.PFG.light$shade_factor", mat.PFG.light$shade_factor)
.testParam_notBetween.m("mat.PFG.light$shade_factor", mat.PFG.light$shade_factor, 0, Inf)
}
if (sum(colnames(mat.PFG.light) == "light_need") == 1)
{
Expand Down
69 changes: 32 additions & 37 deletions R/PRE_FATE.params_PFGsuccession.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@
##' Two methods to define these abundances are available :
##' \itemize{
##' \item from \strong{predefined rules} (using \code{type},
##' \code{MAX_STRATUM}) : \cr \cr
##' \code{HEIGHT}) : \cr \cr
##' \tabular{rcccc}{
##' \strong{MAX_STRATUM} \tab \strong{1} \tab \strong{2} \tab
##' \strong{3} \tab \strong{+}\cr
##' \strong{\code{H} (herbaceous)} \tab \code{3} \tab \code{3} \tab
##' \code{2} \tab \code{2} \cr
##' \strong{\code{C} (chamaephyte)} \tab \code{3} \tab \code{2} \tab
##' \code{2} \tab \code{1} \cr
##' \strong{\code{P} (phanerophyte)} \tab \code{3} \tab \code{2} \tab
##' \code{1} \tab \code{1}
##' \strong{HEIGHT} \tab \strong{<20cm} \tab \strong{<50cm} \tab
##' \strong{<150cm} \tab \strong{>150cm}\cr
##' \strong{\code{H} (herbaceous)} \tab \code{100} \tab \code{100} \tab
##' \code{50} \tab \code{50} \cr
##' \strong{\code{C} (chamaephyte)} \tab \code{100} \tab \code{50} \tab
##' \code{50} \tab \code{10} \cr
##' \strong{\code{P} (phanerophyte)} \tab \code{100} \tab \code{50} \tab
##' \code{10} \tab \code{10}
##' }
##' \item from \strong{user data} : \cr
##' \emph{with the values contained within the \code{max_abundance}
Expand All @@ -113,12 +113,12 @@
##' contribute to shade half less}) than mature individuals \cr \cr
##' Two methods to define these sizes are available :
##' \itemize{
##' \item from \strong{predefined rules} (using \code{type}, \code{MAX_STRATUM})
##' \item from \strong{predefined rules} (using \code{type}, \code{HEIGHT})
##' : \cr \cr
##'
##' \tabular{rcccc}{
##' \strong{MAX_STRATUM} \tab \strong{1} \tab \strong{2} \tab
##' \strong{3} \tab \strong{+}\cr
##' \strong{HEIGHT} \tab \strong{<20cm} \tab \strong{<50cm} \tab
##' \strong{<10m} \tab \strong{>10m}\cr
##' \strong{\code{H} (herbaceous)} \tab \code{100\%} \tab \code{80\%}
##' \tab \code{50\%} \tab \code{50\%} \cr
##' \strong{\code{C} (chamaephyte)} \tab \code{100\%} \tab \code{50\%}
Expand Down Expand Up @@ -170,9 +170,7 @@
##' \item{MATURITY}{PFG maturity age \emph{(in years)}}
##' \item{LONGEVITY}{PFG life span \emph{(in years)}}
##' \item{MAX_STRATUM}{maximum height stratum that the PFG can reach}
##' \item{MAX_ABUNDANCE}{maximum abundance / space (quantitative) that the
##' PFG is able to produce / occupy \cr \emph{(\code{1}: Low \code{2}:
##' Medium \code{3}: High)}}
##' \item{MAX_ABUND}{maximum abundance of mature individuals that the PFG can reach}
##' \item{IMM_SIZE}{PFG immature relative size \emph{(integer between \code{0}
##' and \code{100}\%)}}
##' \item{CHANG_STR_AGES}{ages at which the PFG goes in the upper stratum
Expand Down Expand Up @@ -384,7 +382,6 @@ PRE_FATE.params_PFGsuccession = function(
if (sum(colnames(mat.PFG.succ) == "max_abundance") == 1)
{
.testParam_NAvalues.m("mat.PFG.succ$max_abundance", mat.PFG.succ$max_abundance)
.testParam_notInValues.m("mat.PFG.succ$max_abundance", mat.PFG.succ$max_abundance, 1:3)
}
if (sum(colnames(mat.PFG.succ) == "potential_fecundity") == 1)
{
Expand Down Expand Up @@ -511,7 +508,6 @@ PRE_FATE.params_PFGsuccession = function(
## = maximum abundance of mature PFG
## = carrying capacity proxy in terms of number of individuals
## Defined according to the number of strata potentially occupied by a PFG
## 3 levels : 1 = Low, 2 = Medium or 3 = High
if (sum(colnames(mat.PFG.succ) == "max_abundance") == 1)
{
MAX_ABUNDANCE = mat.PFG.succ$max_abundance
Expand All @@ -520,18 +516,17 @@ PRE_FATE.params_PFGsuccession = function(
## herbaceous are small and can be numerous (high number of individuals)
## chamaephytes can produce medium number of individuals
## phanerophytes can produce small number of individuals
## all plants in first stratum can produce high number of individuals
## plants other than herbaceous in stratum 2 can produce medium number of individuals
## herbaceous in stratum > 2 can produce medium number of individuals
## chamaephytes in stratum > 3 can produce small number of individuals
## all plants < 20cm can produce high number of individuals
## herbaceous > 20cm & other plants < 20cm can produce medium number of individuals
## plants > 150cm can produce small number of individuals
MAX_ABUNDANCE = rep(NA, no.PFG)
MAX_ABUNDANCE[which(mat.PFG.succ$type == "H")] = 3
MAX_ABUNDANCE[which(mat.PFG.succ$type == "C")] = 2
MAX_ABUNDANCE[which(mat.PFG.succ$type == "P")] = 1
MAX_ABUNDANCE[which(MAX_STRATUM == 1)] = 3
MAX_ABUNDANCE[which(MAX_STRATUM == 2 & mat.PFG.succ$type != "H")] = 2
MAX_ABUNDANCE[which(MAX_STRATUM > 2 & mat.PFG.succ$type == "H")] = 2
MAX_ABUNDANCE[which(MAX_STRATUM > 3 & mat.PFG.succ$type == "C")] = 1
MAX_ABUNDANCE[which(mat.PFG.succ$type == "H")] = 100
MAX_ABUNDANCE[which(mat.PFG.succ$type == "C")] = 50
MAX_ABUNDANCE[which(mat.PFG.succ$type == "P")] = 10
MAX_ABUNDANCE[which(mat.PFG.succ$type == "H" & mat.PFG.succ$height > 50)] = 50
MAX_ABUNDANCE[which(mat.PFG.succ$type != "H" & mat.PFG.succ$height < 50)] = 50
MAX_ABUNDANCE[which(mat.PFG.succ$height > 150)] = 10
MAX_ABUNDANCE[which(mat.PFG.succ$height < 20)] = 100
}

#############################################################################
Expand All @@ -543,20 +538,20 @@ PRE_FATE.params_PFGsuccession = function(
IMM_SIZE = mat.PFG.succ$immature_size
} else
{
## immature herbaceous contribute to shade in the same way than mature herbaceous
## immature chamaephytes contribute to shade half less than mature herbaceous
## immature herbaceous contribute to shade in the same way than mature
## immature chamaephytes contribute to shade half less than mature
## immature phanerophytes contribute to shade only by 10 % of their full capacity
## intermediate percentage for herbaceous in stratum 2
## intermediate percentage for herbaceous in stratum > 2
## immature chamaephytes in 1st stratum contribute to shade in the same way than mature chamaephytes
## immature phanerophytes with height < 10m contribute to shade half less than mature phanerophytes
## intermediate percentage for herbaceous in stratum > 20cm & < 50cm
## immature herbaceous with height > 50cm contribute to shade half less than mature
## immature chamaephytes < 20cm contribute to shade in the same way than mature
## immature phanerophytes with height < 10m contribute to shade half less than mature
IMM_SIZE = rep(100, no.PFG)
IMM_SIZE[which(mat.PFG.succ$type == "H")] = 100
IMM_SIZE[which(mat.PFG.succ$type == "C")] = 50
IMM_SIZE[which(mat.PFG.succ$type == "P")] = 10
IMM_SIZE[which(mat.PFG.succ$type == "H" & MAX_STRATUM == 2)] = 80
IMM_SIZE[which(mat.PFG.succ$type == "H" & MAX_STRATUM > 2)] = 50
IMM_SIZE[which(mat.PFG.succ$type == "C" & MAX_STRATUM == 1)] = 100
IMM_SIZE[which(mat.PFG.succ$type == "H" & mat.PFG.succ$height > 20)] = 80
IMM_SIZE[which(mat.PFG.succ$type == "H" & mat.PFG.succ$height > 50)] = 50
IMM_SIZE[which(mat.PFG.succ$type == "C" & mat.PFG.succ$height < 20)] = 100
IMM_SIZE[which(mat.PFG.succ$type == "P" & mat.PFG.succ$height < 1000)] = 50
}

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ library(devtools)
devtools::install_github(repo="leca-dev/RFate")
</pre>

**Note :** `RFate` is currently having problems compiling on Windows with RTools4.3 <i class="fa-solid fa-triangle-exclamation"></i>
**Note :** v1.3.5 changes `MAX_ABUND` parameters <i class="fa-solid fa-triangle-exclamation"></i>

**Note :** v1.3.4 is compiling on Windows with R 4.4.0 RTools44 <i class="fa-solid fa-triangle-exclamation"></i>

**Note :** v1.3.1 changes scale from `0:10` to `0:100` <br/> for `IMM_SIZE`, `ACTIVE_GERM`, `LIGHT_TOL`, `SOIL_TOL`, `PROP_KILLED`, `ACTIVATED_SEED`, `FATES` parameters <i class="fa-solid fa-triangle-exclamation"></i>

Expand Down
11 changes: 5 additions & 6 deletions man/PRE_FATE.params_PFGlight.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 13 additions & 15 deletions man/PRE_FATE.params_PFGsuccession.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions vignettes/fate_tutorial_3_MODULES.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ SEEDING_DURATION 300
SEEDING_TIMESTEP 1
SEEDING_INPUT 100
POTENTIAL_FECUNDITY 10
MAX_ABUND_LOW 100
MAX_ABUND_MEDIUM 500
MAX_ABUND_HIGH 8000
</pre>

The number of computer resources can also be given :
Expand Down Expand Up @@ -104,8 +101,7 @@ TYPE P
HEIGHT 1200
MATURITY 45
LONGEVITY 451
MAX_STRATUM 5
MAX_ABUNDANCE 3
MAX_ABUNDANCE 100
IMM_SIZE 10
CHANG_STR_AGES 0 14 38 110 344
SEED_POOL_LIFE 0 0
Expand All @@ -114,6 +110,7 @@ SEED_DORMANCY 0

The maximum number of seeds produced each year can also be specified per PFG :
<pre class = "grey">
MAX_STRATUM 5
POTENTIAL_FECUNDITY 50
</pre>

Expand Down Expand Up @@ -404,8 +401,8 @@ RESPR_AGE 0 0 3 26 0 0 3 26
FATES 60 0 20 0 50 0 60 0 20 0 50 0 10 0 20 0
PROP_KILLED 0 0
ACTIVATED_SEED 0 0
THRESHOLD_MOD -11.50406848
THRESHOLD_SEV -12.3335733
DROUGHT_THRESH_MOD -11.50406848
DROUGHT_THRESH_SEV -12.3335733
COUNTER_RECOVERY 1
COUNTER_SENS 3
COUNTER_CUM 3
Expand Down
14 changes: 14 additions & 0 deletions vignettes/news.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ Refinements to the model, and integration of the `C++` code within an `R` packag

<br/> <br/>

#### Version 1.3.5 (june 2024)

- 1.3.5 :
+ do not need dispersal to have seeding
+ transform `SHADE_FACTOR` from int to double
+ remove `MAX_ABUND_LOW`, `MAX_ABUND_MEDIUM`, `MAX_ABUND_HIGH` in global parameters
+ addition of `MAX_ABUND` parameter within PFG succession files (see [FATE tutorial - Modules](fate_tutorial_3_MODULES.html))
+ update `DROUGHT` module code
- 1.3.4 :
+ switch between int / unsigned to remove warnings (*compilation*)
+ change variable names (from `m_Dispersed` to `m_IsSeeded`, `MaxRecruit` to `Light/SoilActiveGerm`, `m_DormBreaks` to `m_ActiveSeeds`)
+ change PFG parameter names related to drought (see [FATE tutorial - Modules](fate_tutorial_3_MODULES.html))
+ update `Makevars.win` and `winlibs` to compile on Windows with R 4.4.0 and RTools44

#### Version 1.3.3 (november 2023)

- 1.3.3 : addition of `DIST_PROB` and `DIST_PAIR` parameters within `DIST` module (see [FATE tutorial - Modules](fate_tutorial_3_MODULES.html))
Expand Down

0 comments on commit 83a941e

Please sign in to comment.