View source: R/generate_FABM.R
gen_fabm_code | R Documentation |
This function creates fortran90 FABM code from data.frames. Additionally a fabm.yaml control file for FABM is generated
gen_fabm_code(
vars,
pars,
funs,
pros,
stoi,
file_name = "model.f90",
diags = TRUE
)
vars |
data.frame containing the state variables |
pars |
data.frame containing the parameters |
funs |
data.frame containing the functions |
pros |
data.frame containing the processes |
stoi |
data.frame containing the stoichiometry |
file_name |
Name of the text file in wich the source code is written |
diags |
Boolean: should the process rates be stored in diagnostic variables? Defaults to TRUE |
Johannes Feldbauer
## Not run:
library(readODS)
library(rodeoFABM)
# copy example ods file
example_model <- system.file("extdata/simple_model.ods", package= 'rodeoFABM')
dir.create('example') # Create example folder
file.copy(from = example_model, to = 'example',recursive = TRUE)
setwd('example') # Change working directory to example folder
# read in example ods file
odf_file <- "simple_model.ods"
vars <- read_ods(odf_file,1)
pars <- read_ods(odf_file,2)
funs <- read_ods(odf_file,3)
pros <- read_ods(odf_file,4)
stoi <- read_ods(odf_file,5)
# generate fabm code
gen_fabm_code(vars,pars,funs,pros,stoi,"simple_model.f90",diags = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.