Last data update: 2014.03.03

R: make setupNUCOM
setupNUCOMR Documentation

make setupNUCOM

Description

Code to make the setup structure needed run the model.

Usage

setupNUCOM(mainDir, climate, environment, inival, start, end, type,
  numFolders = 1, parallel = F, separate = F, startval = 1)

Arguments

mainDir

Working directory

climate

climate input (monthly) format: year, month, air temperature, precipitation, potential evapotranspiration (tab seperated). The potential evapotranspiration needs to be calcluated by using the Penman open water evapotranspiration.

environment

environment input (yearly) format: year, atmospheric co2 values, nitrogen deposition

inival

initial values of biomass

start

year in which the simulation starts

end

year in which the simulation ends

type

Which output is needed? For more information see the help of the getData function.

numFolders

The amount of folders that needs to be created (in case of parallel computing)

parallel

Run the model on parallel cores? TRUE/FALSE, default is FALSE.

separate

Does the model needs to be run for all parameters seperate? Default is FALSE

startval

From which row does the output need to be loaded. Default is 1.

Value

A list with paths and filenames and parameter values which can be implemented in the runnucom and the runnucomParallel function.

Author(s)

JWM Pullens

Source

The model can be sent upon request at jeroenpullens[at]gmail[dot]com

Examples

## Not run: 
#Define complete file path in setup
for LINUX: ~/home/...../data/ ! pay attention to the last "/"
for Windows_ C://..//data// ! pay attention to the last "//"

##Single core setup:
test_setup_singlecore <- setupNUCOM(mainDir="/home/jeroen/NUCOMBog_data/",
                                     climate="ClimLVMhis.txt",
                                     environment="EnvLVMhis.txt",
                                     inival="inivalLVMhis.txt",
                                     start=1766,
                                     end=1999,
                                     type=c("NEE","WTD"),
                                     parallel=F)

## Multi core setup:
names<-c("CO2ref","gram_Beta","eric_MaxGr")

nparvector<-50
initialParameters <- matrix(runif(n=length(names)*nparvector,
                   min=c(300,0.1,40),
                   max=c(500,1,80)),
                   nrow=length(names))
initialParameters<-data.frame(names,initialParameters)
names(initialParameters)<-c("names",rep("values",nparvector))
initialParameters$names<-as.character(initialParameters$names)

test_setup <- setupNUCOM(mainDir="/home/jeroen/NUCOMBog_data/",
                          climate="ClimLVMhis.txt",
                          environment="EnvLVMhis.txt",
                          inival="inivalLVMhis.txt",
                          start=1766,
                          end=1999,
                          type=c("NEE","WTD"),
                          parallel=T,
                          numFolders=nparvector,
                          separate=F,
                          startval=1)


## End(Not run)

Results