-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
110 lines (76 loc) · 6.21 KB
/
README.Rmd
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
bibliography: references.bib
csl: environmental-modelling-and-software.csl
output:
github_document:
html_preview: true
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
options(tibble.print_min = 5, tibble.print_max = 5)
```
# [DynACof](https://vezy.github.io/DynACof): The Dynamic Agroforestry Coffee Crop Model <img src="man/figures/logo.png" alt="" width="300" align="right" />
<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![R-CMD-check](https://github.com/VEZY/DynACof/workflows/R-CMD-check/badge.svg)](https://github.com/VEZY/DynACof/actions)
[![Join the chat at https://gitter.im/DynACof/Lobby#](https://badges.gitter.im/DynACof/Lobby.svg?token=1d2e733532f5122f05de&branch=master)](https://gitter.im/DynACof/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1256816.svg)](https://doi.org/10.5281/zenodo.1256816)
<!-- badges: end -->
## Overview
The [DynACof](https://vezy.github.io/DynACof) process-based model computes plot-scale Net Primary Productivity, carbon allocation, growth, yield, energy, and water balance of coffee plantations according to management, while accounting for spatial effects using metamodels from the 3D process-based [MAESPA](https://maespa.github.io/). The model also uses coffee bud and fruit cohorts for reproductive development to better represent fruit carbon demand distribution along the year.
A research article presenting and evaluating the model is published in @vezyDynACofProcessbasedModel2020. The official website is available [here](https://vezy.github.io/DynACof).
DynACof is also available as a [Julia](https://julialang.org/) package. Use this one for better performance (~100x). Its repository is available [here](https://github.com/VEZY/DynACof.jl), and the documentation is available [here](https://vezy.github.io/DynACof.jl/dev/). The Julia version is also available from the R package. See [the vignette](https://vezy.github.io/DynACof/articles/julia-version.html) for more details. Note that the input parameter files are different from the R-version. They are accessible in the [DynACof.jl_inputs](https://github.com/VEZY/DynACof.jl_inputs) repository.
## Installation
The development version from [GitHub](https://github.com/) can be installed with:
``` r
# install.packages("devtools")
devtools::install_github("VEZY/DynACof")
```
Or using the lightweight [remotes](https://github.com/r-lib/remotes#readme) package:
``` r
# install.packages("remotes")
remotes::install_github("VEZY/DynACof")
```
The package is tested routinely to pass all [CRAN](https://CRAN.R-project.org) tests using Travis-CI (linux) and AppVeyor (Windows), but is not released to the CRAN servers because we believe DynACof users are not widespread enough to bother CRAN people and use their free server time.
## Example
This is a basic example using all defaults (parameters and meteorology) over 2 years :
```{r example1, eval=FALSE}
rm(list = ls())
library("DynACof")
Sys.setenv(TZ="UTC")
DynACof(Period= as.POSIXct(c("1979-01-01", "1980-12-31")))
```
To use your own data, you have to tell DynACof where to find it using `Inpath` parameter, and what are the file names with the `FileName` parameter list. A separate [Github repository](https://github.com/VEZY/DynACof_inputs) is available for input files templates, and some help on how to proceed.
Example using custom input parameter files:
```{r example2, eval=FALSE}
rm(list = ls())
library("DynACof")
Sys.setenv(TZ="UTC")
DynACof(WriteIt = T, Period = as.POSIXct(c("1979-01-01", "1980-12-31")),
Inpath = "1-Input/Aquiares/", Simulation_Name = "Test1",
FileName = list(Site = "1-Site.R", Meteo ="2-Meteorology.txt",
Soil = "3-Soil.R",Coffee = "4-Coffee.R", Tree = NULL))
```
Note that the Meteo file can be of any regular format because the
model uses the `data.table::fread` function internally.
## Notes
The model first computes the shade tree, then the coffee and then the soil. So if you need to update the metamodels, please keep in mind that the state of soil of a given day is only accessible on the next day for the tree and the coffee, unless the code is updated too. The model is implemented like this for simplicity, based on the hypothesis that the soil has a rather slow dynamic compared to plants dynamics.
## Code of conduct
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
## Acknowledgments
The DynACof model was mainly developed thanks to the MACCAC project, which was funded by the french ANR (Agence Nationale de la Recherche). The authors were funded by
[CIRAD](https://www.cirad.fr/) and [INRAE](https://www.inrae.fr/). The authors are grateful for the support of the [Aquiares farm](https://aquiares.com/) and the [CATIE](https://www.catie.ac.cr/) for the long-term coffee agroforestry trial, the SOERE F-ORE-T which is supported annually by Ecofor, Allenvi and the French national research infrastructure [ANAEE-F](http://www.anaee-france.fr/fr/); the CIRAD-IRD-SAFSE project (France) and the PCP platform of CATIE. CoffeeFlux observatory was supported and managed by CIRAD researchers. We are grateful to the staff from Costa-Rica, in particular Alvaro Barquero, Alejandra Barquero, Jenny Barquero, Alexis Perez, Guillermo Ramirez, Rafael Acuna, Manuel Jara, Alonso Barquero for their technical and field support.
MACACC project: ANR-13-AGRO-0005, Viabilité et Adaptation des Ecosystèmes Productifs, Territoires et Ressources face aux Changements Globaux, AGROBIOSPHERE 2013 program.
---
<sub>The DynACof logo was made using <a href="http://logomakr.com" title="Logo Makr">LogoMakr.com</a> </sub>
```{r logo, eval=FALSE, echo=FALSE}
# See: https://logomakr.com/2GmRlK
# knit("README.Rmd")
```
## References