build_GOTM: Function to compile GOTM-FABM

View source: R/utility_tools.R

build_GOTMR Documentation

Function to compile GOTM-FABM

Description

This function compiles GOTM-FABM with FABM source code generated by gen_fabm_code(). It assumes that you allready have run cmake within the build directory

Usage

build_GOTM(build_dir, src_dir, fabm_file, funs_file = NULL)

Arguments

build_dir

build directory

src_dir

GOTM source directory. The directory the GOTM source code was cloned into from github

fabm_file

forthran source file for FABM created by gen_fabm_code()

funs_file

Path to additional text files containing functions that should be compiled alon with the generateds fortran files

Author(s)

Johannes Feldbauer

Examples

## 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)
# build GOTM
build_GOTM(build_dir = "../build",fabm_file = "simple_model.f90",
           src_dir = "../gotm")

## End(Not run)


JFeldbauer/rodeoFABM documentation built on Jan. 27, 2024, 11:41 a.m.