diff --git a/RBBGCMuso/R/calibMuso.R b/RBBGCMuso/R/calibMuso.R index b45e238..ca2b226 100644 --- a/RBBGCMuso/R/calibMuso.R +++ b/RBBGCMuso/R/calibMuso.R @@ -1,4 +1,6 @@ -#' This function runs the BBGC-MuSo model and reads in its outputfile in a very structured way. +#' calibMuso +#' +#' This function changes the epc file and after that runs the BBGC-MuSo model and reads in its outputfile in a very structured way. #' #' @author Roland Hollós #' @param settings You have to run the setupMuso function before rungetMuso. It is its output which contains all of the necessary system variables. It sets the whole environment @@ -9,8 +11,9 @@ #' @param silent If you set it TRUE all off the modells output to the screen will be suppressed. It can be usefull, because it increases the model-speed. #' @param aggressive It deletes every possible modell-outputs from the previous modell runs. #' @param leapyear future feature. +#' @param parameters In the settings variable you have set the row indexes of the variables, you wish to change. In this parameter you can give an exact value for them in a vector like: c(1,2,3,4) #' @return No return, outputs are written to file -#' @usage The function works only, if ... +#' @usage calibMuso(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL, keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE) #' @export diff --git a/RBBGCMuso/R/rungetMuso.R b/RBBGCMuso/R/rungetMuso.R index 5de3b45..f86903c 100644 --- a/RBBGCMuso/R/rungetMuso.R +++ b/RBBGCMuso/R/rungetMuso.R @@ -1,3 +1,5 @@ +#'rungetMuso +#' #' This function runs the BBGC-MuSo model and reads in its outputfile in a very structured way. #' #' @author Roland Hollós @@ -9,15 +11,15 @@ #' @param silent If you set it TRUE all off the modells output to the screen will be suppressed. It can be usefull, because it increases the model-speed. #' @param aggressive It deletes every possible modell-outputs from the previous modell runs. #' @param leapyear future feature. -#' @return No return, outputs are written to file -#' @usage The function works only, if ... +#' @return It depends on the export parameter. The function returns with a matrix with the modell output, or writes this in a file, which is given previously +#' @usage rungetMuso(settings, timee="d", debugging=FALSE, logfilename=NULL, +#' keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE) #' @export rungetMuso <- function(settings, timee="d", debugging=FALSE, logfilename=NULL, keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE){ - Linuxp <-(Sys.info()[1]=="Linux") diff --git a/RBBGCMuso/R/setupMuso.R b/RBBGCMuso/R/setupMuso.R index daa59fd..bb7f796 100644 --- a/RBBGCMuso/R/setupMuso.R +++ b/RBBGCMuso/R/setupMuso.R @@ -1,7 +1,32 @@ -#' This runs the BBGC-MuSo model +#' setupMuso +#' +#' This funcion is fundamental for the BiomBGC-MuSo modell related functions like spinupMuso, normalMuso, rungetMuso, because it sets the modells environment. +#' #' @author Roland Hollós -#' @param calibrationpar vector with line numbers -#' @return No return, outputs are written to file +#' @param parallel Do you want to run multiple modell paralelly, if yes, set this variable to TRUE +#' @param executable This parameter stores the place of the modell-executable file. In normal usage, you don't have to be set this, because a RBBgcmuso package contains allways the latest modell executable. In spite of this, if you would like to use this package for modell development or just want to use different models (for example for comparison), you will find it useful +#' @param calibrationpar You may want to change some parameters in your epc file, before you run the modell. You have to select the appropirate modell parameters. You can refence to these with the number of the line in the epc file where the variables are. It indexes from one. You should use a vector for this, like: c(1,5,8) +#' @param outputloc Where should the modell puts its outputs. You should give a location for it via this variable, for example: outputloc="/place/of/the/outputs/" +#' @param inputloc Usually it is the root directory, where you put the inifiles for the modell +#' @param metinput Via metinput parameter, you can tell the modell where are the meteorological files. As default it reads this from the inifiles. +#' @param CO2input Via CO2 parameter, you can tell the modell where are the CO2 data files. As default it reads this from the inifiles. +#' @param plantinput Via planting parameter, you can tell the modell where are the data files, which contains the planting informations. As default it reads this from the inifiles. +#' @param thininput Via thining parameter, you can tell the modell where are the data files, which contains the thining informations. As default it reads this from the inifiles. +#' @param mowinput Via mowing parameter, you can tell the modell where are the data files, which contains the mowing informations. As default it reads this from the inifiles. +#' @param grazinput Via grazing parameter, you can tell the modell where are the data files, which contains the grazing informations. As default it reads this from the inifiles. +#' @param harvinput Via harvesting parameter, you can tell the modell where are the data files, which contains the harvesting informations. As default it reads this from the inifiles. +#' @param plouginput Via ploughing parameter, you can tell the modell where are the data files, which contains the ploughing informations. As default it reads this from the inifiles. +#' @param fertinput Via fertilizing parameter, you can tell the modell where are the fertilizing data files, which contains the fertilizing informations. As default it reads this from the inifiles. +#' @param irrinput Via irrigation parameter, you can tell the modell where are the data files, which contains the irrigation informations. As default it reads this from the inifiles. +#' @param nitinput Via this parameter, you can tell the modell where are the NO2 data files. As default it reads this from the inifiles. +#' @param ininput Via this parameter, you can tell the modell where are the ini files. As default it reads this from the inifiles. +#' @param epcinput Via this parameter, you can tell the modell where are the epc data files. As default it reads this from the inifiles. +#' @usage setupMuso(executable=NULL, parallel = F, calibrationpar =c(1), outputloc=NULL, inputloc=NULL, +#' metinput=NULL, CO2input=NULL, plantinput=NULL, thininput=NULL, +#' mowinput=NULL, grazinput=NULL, harvinput=NULL, plouginput=NULL, fertinput=NULL, +#' irrinput=NULL, nitinput=NULL, ininput=NULL, epcinput=NULL) +#' @return The output is a the modell setting list wich contains the following elements: +#' executable, calibrationpar, outputloc, outputname, inputloc, ininput, metinput, epcinput,thininput,CO2input, mowinput, grazinput, harvinput, plouginput, fertinput, irrinput, nitinput, inputfiles, numdata, startyear, numyears, outputvars setupMuso <- function(executable=NULL, parallel = F, calibrationpar =c(1), diff --git a/RBBGCMuso/man/calibMuso.Rd b/RBBGCMuso/man/calibMuso.Rd new file mode 100644 index 0000000..4f1eca0 --- /dev/null +++ b/RBBGCMuso/man/calibMuso.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calibMuso.R +\name{calibMuso} +\alias{calibMuso} +\title{calibMuso} +\usage{ +calibMuso(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL, keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE) +} +\arguments{ +\item{settings}{You have to run the setupMuso function before rungetMuso. It is its output which contains all of the necessary system variables. It sets the whole environment} + +\item{parameters}{In the settings variable you have set the row indexes of the variables, you wish to change. In this parameter you can give an exact value for them in a vector like: c(1,2,3,4)} + +\item{timee}{The required timesteps in the modell output. It can be "d", if it is daily, "m", if it's monthly, "y", it it is yearly} + +\item{debugging}{If it is TRUE, it copies the log file to a Log directory to store it, if it is stamplog it contatenate a number before the logfile, which is one more than the maximum of the represented ones in the LOG directory. If it is true or stamplog it collects the "wrong" logfiles} + +\item{keepEpc}{If TRUE, it keeps the epc file and stamp it, after these copies it to the EPCS directory. If debugging True or false, it copies the wrong epc files to the wrong epc directory.} + +\item{export}{if it is yes or you give a filename here, it converts the output to the specific extension. For example, if you set export to "example.csv", it converts the output to "csv", if you set it to "example.xls" it converts to example.xls with the xlsx package. If it is not installed it gives back a warning message and converts it to csv.} + +\item{silent}{If you set it TRUE all off the modells output to the screen will be suppressed. It can be usefull, because it increases the model-speed.} + +\item{aggressive}{It deletes every possible modell-outputs from the previous modell runs.} + +\item{leapyear}{future feature.} +} +\value{ +No return, outputs are written to file +} +\description{ +This function changes the epc file and after that runs the BBGC-MuSo model and reads in its outputfile in a very structured way. +} +\author{ +Roland Hollós +} diff --git a/RBBGCMuso/man/rungetMuso.Rd b/RBBGCMuso/man/rungetMuso.Rd index b2353ea..14fc0cf 100644 --- a/RBBGCMuso/man/rungetMuso.Rd +++ b/RBBGCMuso/man/rungetMuso.Rd @@ -2,9 +2,10 @@ % Please edit documentation in R/rungetMuso.R \name{rungetMuso} \alias{rungetMuso} -\title{This function runs the BBGC-MuSo model and reads in its outputfile in a very structured way.} +\title{rungetMuso} \usage{ -The function works only, if ... +rungetMuso(settings, timee="d", debugging=FALSE, logfilename=NULL, +keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE) } \arguments{ \item{settings}{You have to run the setupMuso function before rungetMuso. It is its output which contains all of the necessary system variables. It sets the whole environment} @@ -24,7 +25,7 @@ The function works only, if ... \item{leapyear}{future feature.} } \value{ -No return, outputs are written to file +It depends on the export parameter. The function returns with a matrix with the modell output, or writes this in a file, which is given previously } \description{ This function runs the BBGC-MuSo model and reads in its outputfile in a very structured way. diff --git a/RBBGCMuso/man/setupMuso.Rd b/RBBGCMuso/man/setupMuso.Rd index fab74af..2fcc5a8 100644 --- a/RBBGCMuso/man/setupMuso.Rd +++ b/RBBGCMuso/man/setupMuso.Rd @@ -2,23 +2,56 @@ % Please edit documentation in R/setupMuso.R \name{setupMuso} \alias{setupMuso} -\title{This runs the BBGC-MuSo model} +\title{setupMuso} \usage{ -setupMuso(executable = NULL, parallel = F, calibrationpar = c(1), - outputloc = NULL, inputloc = NULL, metinput = NULL, CO2input = NULL, - plantinput = NULL, thininput = NULL, mowinput = NULL, - grazinput = NULL, harvinput = NULL, plouginput = NULL, - fertinput = NULL, irrinput = NULL, nitinput = NULL, ininput = NULL, - epcinput = NULL) +setupMuso(executable=NULL, parallel = F, calibrationpar =c(1), outputloc=NULL, inputloc=NULL, +metinput=NULL, CO2input=NULL, plantinput=NULL, thininput=NULL, +mowinput=NULL, grazinput=NULL, harvinput=NULL, plouginput=NULL, fertinput=NULL, +irrinput=NULL, nitinput=NULL, ininput=NULL, epcinput=NULL) } \arguments{ -\item{calibrationpar}{vector with line numbers} +\item{executable}{This parameter stores the place of the modell-executable file. In normal usage, you don't have to be set this, because a RBBgcmuso package contains allways the latest modell executable. In spite of this, if you would like to use this package for modell development or just want to use different models (for example for comparison), you will find it useful} + +\item{parallel}{Do you want to run multiple modell paralelly, if yes, set this variable to TRUE} + +\item{calibrationpar}{You may want to change some parameters in your epc file, before you run the modell. You have to select the appropirate modell parameters. You can refence to these with the number of the line in the epc file where the variables are. It indexes from one. You should use a vector for this, like: c(1,5,8)} + +\item{outputloc}{Where should the modell puts its outputs. You should give a location for it via this variable, for example: outputloc="/place/of/the/outputs/"} + +\item{inputloc}{Usually it is the root directory, where you put the inifiles for the modell} + +\item{metinput}{Via metinput parameter, you can tell the modell where are the meteorological files. As default it reads this from the inifiles.} + +\item{CO2input}{Via CO2 parameter, you can tell the modell where are the CO2 data files. As default it reads this from the inifiles.} + +\item{plantinput}{Via planting parameter, you can tell the modell where are the data files, which contains the planting informations. As default it reads this from the inifiles.} + +\item{thininput}{Via thining parameter, you can tell the modell where are the data files, which contains the thining informations. As default it reads this from the inifiles.} + +\item{mowinput}{Via mowing parameter, you can tell the modell where are the data files, which contains the mowing informations. As default it reads this from the inifiles.} + +\item{grazinput}{Via grazing parameter, you can tell the modell where are the data files, which contains the grazing informations. As default it reads this from the inifiles.} + +\item{harvinput}{Via harvesting parameter, you can tell the modell where are the data files, which contains the harvesting informations. As default it reads this from the inifiles.} + +\item{plouginput}{Via ploughing parameter, you can tell the modell where are the data files, which contains the ploughing informations. As default it reads this from the inifiles.} + +\item{fertinput}{Via fertilizing parameter, you can tell the modell where are the fertilizing data files, which contains the fertilizing informations. As default it reads this from the inifiles.} + +\item{irrinput}{Via irrigation parameter, you can tell the modell where are the data files, which contains the irrigation informations. As default it reads this from the inifiles.} + +\item{nitinput}{Via this parameter, you can tell the modell where are the NO2 data files. As default it reads this from the inifiles.} + +\item{ininput}{Via this parameter, you can tell the modell where are the ini files. As default it reads this from the inifiles.} + +\item{epcinput}{Via this parameter, you can tell the modell where are the epc data files. As default it reads this from the inifiles.} } \value{ -No return, outputs are written to file +The output is a the modell setting list wich contains the following elements: +executable, calibrationpar, outputloc, outputname, inputloc, ininput, metinput, epcinput,thininput,CO2input, mowinput, grazinput, harvinput, plouginput, fertinput, irrinput, nitinput, inputfiles, numdata, startyear, numyears, outputvars } \description{ -This runs the BBGC-MuSo model +This funcion is fundamental for the BiomBGC-MuSo modell related functions like spinupMuso, normalMuso, rungetMuso, because it sets the modells environment. } \author{ Roland Hollós