Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmseddy committed Nov 14, 2024
2 parents 7b97f6a + d0db961 commit 32e9e2d
Show file tree
Hide file tree
Showing 9 changed files with 4,297 additions and 140 deletions.
2 changes: 2 additions & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html

74 changes: 74 additions & 0 deletions .github/workflows/render-module-rmd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
on:
pull_request:
branches:
- master
- development
push:
branches:
- master
- development
paths:
- .github/workflows/render-module-rmd.yaml
- Biomass_regeneration.Rmd
- Biomass_regeneration.R

name: Render module Rmd

jobs:
render:
if: "!contains(github.event.commits[0].message, '[skip-ci]')"
name: Render module Rmd
runs-on: ubuntu-20.04

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
Ncpus: 2

- name: Install additional system dependencies
run: |
sudo apt-get install -y \
libcurl4-openssl-dev \
libgdal-dev \
libgeos-dev \
libgit2-dev \
libglpk-dev \
libmagick++-dev \
libproj-dev \
libudunits2-dev \
libxml2-dev \
python3-gdal
- uses: PredictiveEcology/actions/install-Require@v0
with:
GitTag: '5c44205bf407f613f53546be652a438ef1248147'

- uses: PredictiveEcology/actions/install-SpaDES@v0

- uses: PredictiveEcology/actions/install-Rmd-pkgs@v0

- name: Install additional packages
run: |
options(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/focal/latest", CRAN = "https://cran.rstudio.com"))
Require::Require(c("PredictiveEcology/LandR@development"), require = FALSE)
shell: Rscript {0}

- name: Render module Rmd
run: |
rmarkdown::render("Biomass_regeneration.Rmd", encoding = "UTF-8")
shell: Rscript {0}

- name: Commit results
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git commit Biomass_regeneration.html -m 'Re-build Biomass_regeneration.Rmd' || echo "No changes to commit"
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{github.ref}} || echo "No changes to commit"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.Rhistory
.RData
.Ruserdata

Biomass_regeneration2.Rmd
217 changes: 134 additions & 83 deletions Biomass_regeneration.R

Large diffs are not rendered by default.

117 changes: 69 additions & 48 deletions Biomass_regeneration.Rmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
---
title: "Biomass_regeneration"
author: ""
date: "20 October 2019"
output: pdf_document
title: "LandR _Biomass_regeneration_ Manual"
subtitle: "v.`r SpaDES.core::moduleMetadata(module = 'Biomass_regeneration', path = '..')$version`"
date: "Last updated: `r Sys.Date()`"
output:
bookdown::html_document2:
toc: true
toc_float: true
theme: sandstone
number_sections: false
df_print: paged
keep_md: yes
editor_options:
chunk_output_type: console
bibliography: citations/references_Biomass_regeneration.bib
link-citations: true
always_allow_html: true
---

# Overview
<!-- the following are text references used in captions for LaTeX compatibility -->
(ref:Biomass-regeneration) *Biomass_regeneration*

```{r setup-Biomass-regeneration, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, eval = FALSE, results = "hold") ## change to eval = TRUE if all chunks are to be evaluated
if (!require(dplyr)) {
install.packages("dplyr")
library(dplyr)
}
dir.create("figures", showWarnings = FALSE)
download.file(url = "https://img.shields.io/badge/Made%20with-Markdown-1f425f.png",
destfile = "figures/markdownBadge.png",
mode = 'wb')
```

#### Authors:

`r paste(as.character(SpaDES.core::moduleMetadata(module = "Biomass_regeneration", path = '..')$authors), sep = ', ')`
<!-- ideally separate authors with new lines, '\n' not working -->

## Module Overview

### Module summary

Biomass_regeneration is a SpaDES module that simulates post-disturbance regeneration mechanisms for Biomass_core.
As such, this module is mostly based on the post-disturbance regeneration mechanisms present in LANDIS-II Biomass Succession v3.2.1 extension (see [LANDIS-II Biomass Succession v3.2 User Guide](https://github.com/LANDIS-II-Foundation/Extension-Biomass-Succession/blob/master/docs/LANDIS-II%20Biomass%20Succession%20v3.2%20User%20Guide.docx) and [Scheller and Mladenoff (2004)](https://pdfs.semanticscholar.org/4d38/d0be6b292eccd444af399775d37a757d1967.pdf).
Expand All @@ -14,7 +51,8 @@ Post-fire mortality behaves in a stand-replacing fashion, i.e. should a pixel be

As for post-fire regeneration, the module first evaluates whether any species present prior to fire are serotinous.
If so, these species will germinate depending on light conditions and their shade tolerance, and depending on their (seed) establishment probability (i.e. germination success) in that pixel.
The module then evaluates if any species present before fire are capable of resprouting. If so the model growth these species depending, again, on light conditions and their shade tolerance, and on their resprouting probability (i.e. resprouting success).
The module then evaluates if any species present before fire are capable of resprouting.
If so the model growth these species depending, again, on light conditions and their shade tolerance, and on their resprouting probability (i.e. resprouting success).
For any given species in any given pixel, only serotiny or resprouting can occur.
Hence, species that are capable of both will only resprout if serotiny was not activated.

Expand All @@ -30,63 +68,46 @@ According to the manual:
This is no longer the case in Biomass_regeneration, where both serotinity and resprouting can occur in the same pixel, although not for the same species.
We feel that this is more realistic ecologically, as resprouters will typically regenerate faster after a fire, often shading serotinous species and creating interesting successional feedbacks (e.g. light-loving serotinous species having to "wait" for canopy gaps to germinate).

## General flow of Biomass_regeneration processes - fire disturbances only
### General flow of Biomass_regeneration processes - fire disturbances only

1. Removal of biomass in disturbed, i.e. burnt, pixels
2. Activation of serotiny for serotinous species present before the fire
3. Activation of resprouting for resprouter species present before the fire and for which serotiny was not activated
4. Establishment/growth of species for which serotiny or resprouting were activated

# Usage

```{r module_usage}
library(SpaDES)
### Module inputs and parameters

setPaths()
getPaths() # shows where the 4 relevant paths are
Table \@ref(tab:moduleInputs-Biomass-regeneration) shows the full list of module inputs.

times <- list(start = 0, end = 10)
parameters <- list(
#.progress = list(type = "text", interval = 1), # for a progress bar
## If there are further modules, each can have its own set of parameters:
#module1 = list(param1 = value1, param2 = value2),
#module2 = list(param1 = value1, param2 = value2)
)
modules <- list("Biomass_regeneration")
objects <- list()
inputs <- list()
outputs <- list()
mySim <- simInit(times = times, params = parameters, modules = modules,
objects = objects)
mySimOut <- spades(mySim)
```{r moduleInputs-Biomass-regeneration, echo = FALSE, eval = TRUE, message = FALSE, warning = FALSE}
df_inputs <- SpaDES.core::moduleInputs("Biomass_regeneration", "..")
knitr::kable(df_inputs,
caption = "List of (ref:Biomass-regeneration) input objects and their description.") %>%
kableExtra::kable_styling(latex_options = "scale_down", full_width = TRUE)
```

# Events

Describe what happens for each event type.

## Plotting
Summary of user-visible parameters (Table \@ref(tab:moduleParams-Biomass-regeneration)):

Write what is plotted.

## Saving

Write what is saved.
```{r moduleParams-Biomass-regeneration, echo = FALSE, eval = TRUE, message = FALSE, warning = FALSE}
df_params <- SpaDES.core::moduleParams("Biomass_regeneration", "..")
knitr::kable(df_params, caption = "List of (ref:Biomass-regeneration) parameters and their description.") %>%
kableExtra::kable_styling(latex_options = "scale_down", full_width = TRUE)
```

# Data dependencies
### Module outputs

## Input data
Description of the module outputs (Table \@ref(tab:moduleOutputs-Biomass-regeneration)).

How to obtain input data, and a description of the data required by the module.
If `sourceURL` is specified, `downloadData("Biomass_regeneration", "path/to/modules/dir")` may be sufficient.
```{r moduleOutputs-Biomass-regeneration, echo = FALSE, eval = TRUE, message = FALSE, warning = FALSE}
df_outputs <- SpaDES.core::moduleOutputs("Biomass_regeneration", "..")
knitr::kable(df_outputs, caption = "List of (ref:Biomass-regeneration) outputs and their description.") %>%
kableExtra::kable_styling(latex_options = "scale_down", full_width = TRUE)
```

## Output data
### Links to other modules

Description of the module outputs.
Primarily used with the LandR Biomass suite of modules, namely [Biomass_core](https://github.com/PredictiveEcology/Biomass_core).

# Links to other modules
## Getting help

Describe any anticipated linkages to other modules.
- <https://gitter.im/PredictiveEcology/LandR_Biomass>
3,646 changes: 3,646 additions & 0 deletions Biomass_regeneration.html

Large diffs are not rendered by default.

Loading

0 comments on commit 32e9e2d

Please sign in to comment.