From 580f54f3b3919f03dec6965611f36baf1f00e805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 13:48:58 +0100 Subject: [PATCH 01/10] Update outputMapping.R Updated doc --- RBBGCMuso/R/outputMapping.R | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/RBBGCMuso/R/outputMapping.R b/RBBGCMuso/R/outputMapping.R index 46fd27c..bb148b7 100644 --- a/RBBGCMuso/R/outputMapping.R +++ b/RBBGCMuso/R/outputMapping.R @@ -1,9 +1,9 @@ #' updateMusoMapping #' -#' This function update the the muso outputcode-variable matrix -#' @author Roland Hollos -#' @param output_map_init The outputcode-variable bindings is described in output_map_init.c file, via this parameter, you can give it the the function -#' @return The outputcode-variable matrix, and also change the global variable +#' This function updates the muso output code-variable matrix. Within Biome-BGCMuSo the state variables and fluxes are marked by integer numbers. In order to provide meaningful variable names (e.g. 3009 means Gross Primary Production) a conversion table is needed which is handled by this function. +#' @author Roland HOLLOS +#' @param output_map_init The output code-variable bindings are described in output_map_init.c file that is part of the current Biome-BGCMuSo source code. Using this function the user can read the output_map_init.c file and pass it to RBBGCMuso for further work. +#' @return The output code-variable matrix, and also the function changes the global variable #' @export #' @usage updateMusoMapping(output_map_init="output_map_init.c") @@ -20,11 +20,11 @@ updateMusoMapping<-function(output_map_init="output_map_init.c"){ #' musoMapping #' -#' musoMapping can give us the name of a muso outputcode -#' @author Roland Hollos +#' musoMapping can provide the user the name of a Biome-BGCMuSo output code. Within Biome-BGCMuSo the state variables and fluxes are marked by integer numbers. In order to provide meaningful variable names (e.g. 3009 means Gross Primary Production) a conversion table is needed which is utilized by this function. This function converts variable codes into names musoMappingFind does the opposite. +#' @author Roland HOLLOS #' @param code the MuSo outputcode #' @param mapData updateMusomapping generated matrix -#' @return The name of the MuSo outputcode +#' @return The name of the Biome-BGCMuSo output code (e.g. if code is 3009 this function should return GPP to the user) #' @export #' @usage musoMapping(code, mapData=NULL) @@ -40,10 +40,10 @@ musoMapping <- function(code, mapData=NULL){ #' musoMappingFind #' -#' musoMapping can give us the name of a muso outputcode -#' @author Roland Hollos -#' @param variable If null return the whole mapping, else search a variable code -#' @return The code of th specific name +#' musoMappingFind can provide us the code of the Biome-BGCMuSo output variable name. Within Biome-BGCMuSo the state variables and fluxes are marked by integer numbers. In order to provide meaningful variable names (e.g. 3009 means Gross Primary Production) a conversion table is needed which is utilized by this function. This function converts variable names into codes. musoMapping does the opposite. +#' @author Roland HOLLOS +#' @param variable If this is null, return the whole mapping table. In other cases search for the variable code +#' @return The code of the specific output variable name #' @export #' @usage musoMapping(code, mapData=NULL) From eb8baf3c814b714a80865c8d002bcbe5bb703b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 14:04:10 +0100 Subject: [PATCH 02/10] Update spinupMuso.R --- RBBGCMuso/R/spinupMuso.R | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/RBBGCMuso/R/spinupMuso.R b/RBBGCMuso/R/spinupMuso.R index 682a42a..288005a 100644 --- a/RBBGCMuso/R/spinupMuso.R +++ b/RBBGCMuso/R/spinupMuso.R @@ -1,15 +1,15 @@ -#' Run the BBGCMuso modell only in spinup phase, and debugging. +#' Runs the Biome-BGCMuSo model in spinup phase (execution of normal phase is possible with normalMuso) with debugging features. #' -#' This function runs the BBGC-MuSo model's in the spinup phase. +#' This function runs the Biome-BGCMuSo model in spinup phase. #' -#' @author Roland Hollos -#' @param settings You have to run the setupMuso function before spinupMuso. It is its output which contains all of the necessary system variables. It sets the whole running environment. -#' @param 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 -#' @param 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. -#' @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 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) -#' @param logfilename If you want to set a specific name for your logfiles you can set this via logfile parameter +#' @author Roland HOLLOS +#' @param settings In order to use spinupMuso, first you have to run the setupMuso function to set up the model environment. The result of setupMuso contains all necessary system variables for the model execution. It sets the whole modelling environment for the user. +#' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. +#' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE or FALSE, it copies the wrong EPC files to the wrong epc directory. +#' @param silent If you set the silent parameter to TRUE, all of the model's output normally written to the screen will be suppressed. This option can be useful to increase the speed of the model execution. +#' @param aggressive It deletes all previous model-outputs from previous model runs. +#' @param parameters In the parameters variable you have set the row indices of the variables that you wish to change. In this parameter you can give an exact value for them in a vector form like c(1,2,3,4) +#' @param logfilename If you would like to set a specific name for the logfiles you can set this via the logfilename parameter #' @return No return, outputs are written to file #' @usage spinupMuso(settings, parameters=NULL, debugging=FALSE, #' logfilename=NULL, keepEpc=FALSE, silent=FALSE, aggressive=FALSE) From 0a27c69c4d0986963d672fc27181540041b5dfc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 14:08:54 +0100 Subject: [PATCH 03/10] Update spinupMuso.R --- RBBGCMuso/R/spinupMuso.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RBBGCMuso/R/spinupMuso.R b/RBBGCMuso/R/spinupMuso.R index 288005a..e84edae 100644 --- a/RBBGCMuso/R/spinupMuso.R +++ b/RBBGCMuso/R/spinupMuso.R @@ -5,10 +5,10 @@ #' @author Roland HOLLOS #' @param settings In order to use spinupMuso, first you have to run the setupMuso function to set up the model environment. The result of setupMuso contains all necessary system variables for the model execution. It sets the whole modelling environment for the user. #' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. -#' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE or FALSE, it copies the wrong EPC files to the wrong epc directory. +#' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory. #' @param silent If you set the silent parameter to TRUE, all of the model's output normally written to the screen will be suppressed. This option can be useful to increase the speed of the model execution. #' @param aggressive It deletes all previous model-outputs from previous model runs. -#' @param parameters In the parameters variable you have set the row indices of the variables that you wish to change. In this parameter you can give an exact value for them in a vector form like c(1,2,3,4) +#' @param parameters |||| In the parameters variable you have set the row indices of the variables that you wish to change. In this parameter you can provide an exact value for them in a vector form like c(1,2,3,4) #' @param logfilename If you would like to set a specific name for the logfiles you can set this via the logfilename parameter #' @return No return, outputs are written to file #' @usage spinupMuso(settings, parameters=NULL, debugging=FALSE, From 28b5752c3dc2aa0bfb9cced08eb9d3914f0346e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 14:40:39 +0100 Subject: [PATCH 04/10] Update normalMuso.R improvements --- RBBGCMuso/R/normalMuso.R | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/RBBGCMuso/R/normalMuso.R b/RBBGCMuso/R/normalMuso.R index 78c2f47..ad1c517 100644 --- a/RBBGCMuso/R/normalMuso.R +++ b/RBBGCMuso/R/normalMuso.R @@ -1,22 +1,22 @@ #' normalMuso #' -#' This function changes the epc file and after that runs the BBGC-MuSo model in normal phase and reads in its outputfile in a well-structured way. +#' This function optionally changes the EPC file and runs the Biome-BGCMuSo model in normal phase and reads its output file in a well-structured way with debugging features. (Execution of spinup phase is possible with spinupMuso.) #' -#' @author Roland Hollos -#' @param settings You have to run the setupMuso function before calibMuso. It is its output which contains all of the necessary system variables. It sets the whole running environment -#' @param 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. I recommend to use daily data, the yearly and monthly data is not well-tested yet. -#' @param 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 -#' @param 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. -#' @param export if it is yes or you give a filename here, it converts the ouxtput 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. -#' @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 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) -#' @param logfilename If you want to set a specific name for your logfiles you can set this via logfile parameter -#' @param leapYear Should the function do a leapyear correction on the outputdata? If TRUE, then the 31.12 day will be doubled. -#' @param keepBinary In default RBBGCMuso to keep working area as clean as possible, deletes all the regular output files. The results are directly printed to the standard output, but you can redirect it, and save it to a variable, or you can export your results to the desired destination in a desired format. Whith this variable you can enable to keep the binary output files. If you want to set the location of the binary output, please take a look at the binaryPlace argument. -#' @param binaryPlace The place of the binary output files. -#' @param fileToChange You can change any line of the epc or the ini file, you just have to specify with this variable which file you van a change. Two options possible: "epc", "ini" -#' @return The simunation output matrix, where the columns are the choosen variables and each row is a day/month/year data. +#' @author Roland HOLLOS +#' @param settings You have to run the setupMuso function and then the spinupMuso function first as spinup phase created the so-called endpoint file for the normal simulation (endpoint=initial conditions). settings parameter contains the environment variables of the simulation as created by setupMuso. +#' @param timee The required timesteps in the model output. It can be "d", if it is daily, "m", if it is monthly, "y" if it is yearly. It is recommended to use daily data, as the yearly and monthly data is not well-tested yet. +#' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. +#' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory. +#' @param export If it is set to yes or you define a filename here, the function converts the output to the specific file format. For example, if you set export to "example.csv", it converts the output to "csv". If you set it to "example.xls" it converts the output to example.xls with the xlsx package. If the Excel converter package is not installed it gives back a warning message and converts the results to csv. +#' @param silent If you set the silent parameter to TRUE, all of the model's output normally written to the screen will be suppressed. This option can be useful to increase the speed of the model execution. +#' @param aggressive It deletes all previous model-outputs from previous model runs. +#' @param parameters Using normalMuso it is possible to change some of the EPC parameters prior to model execution. This can be achieved with this option. In the parameters variable you have set the row indices of the variables that you wish to change. In this parameters you can give an exact value for them in a vector form like c(1,2,3,4) +#' @param logfilename If you would like to set a specific name for your logfiles you can set this via the logfile parameter. +#' @param leapYear Should the function do a leapyear correction on the outputdata? If TRUE, then the 31.12 day will be doubled. +#' @param keepBinary By default RBBGCMuso keeps the working environment as clean as possible, thus deletes all the regular output files. The results are directly written to the standard output (e.g. to the screen), but you can redirect it and save them to a variable. Alternatively, you can export your results to the desired destination in a desired format. Through the keepBinary parameter you can set RBBGCMuso to keep the binary output files. If you would like to set the location of the binary output, please take a look at the binaryPlace argument. +#' @param binaryPlace The place of the binary output files (see the keepBinary parameter). +#' @param fileToChange You can change any line of the EPC or the INI file prior to model execution. All you need to do is to specify with this variable which file you want to change. Two options possible: "EPC" or "INI" +#' @return The simulation output matrix, where the columns are the chosen variables and each row is a daily/monthly/annual data. #' @usage normalMuso(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL, #' keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE) #' @import utils From 9302a102cfe167df5c714235d1a9d40f52ad18bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 14:52:16 +0100 Subject: [PATCH 05/10] Update normalMuso.R --- RBBGCMuso/R/normalMuso.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RBBGCMuso/R/normalMuso.R b/RBBGCMuso/R/normalMuso.R index ad1c517..df406a0 100644 --- a/RBBGCMuso/R/normalMuso.R +++ b/RBBGCMuso/R/normalMuso.R @@ -3,7 +3,7 @@ #' This function optionally changes the EPC file and runs the Biome-BGCMuSo model in normal phase and reads its output file in a well-structured way with debugging features. (Execution of spinup phase is possible with spinupMuso.) #' #' @author Roland HOLLOS -#' @param settings You have to run the setupMuso function and then the spinupMuso function first as spinup phase created the so-called endpoint file for the normal simulation (endpoint=initial conditions). settings parameter contains the environment variables of the simulation as created by setupMuso. +#' @param settings You have to run the setupMuso function and then the spinupMuso function first as spinup phase creates the so-called endpoint file for the normal simulation (endpoint=initial conditions). The settings parameter contains the environment variables of the simulation as created by setupMuso. #' @param timee The required timesteps in the model output. It can be "d", if it is daily, "m", if it is monthly, "y" if it is yearly. It is recommended to use daily data, as the yearly and monthly data is not well-tested yet. #' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. #' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory. From dd81211d7890b23bed4711eed470a88e53d0cf55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 15:04:03 +0100 Subject: [PATCH 06/10] Update normalMuso.R --- RBBGCMuso/R/normalMuso.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RBBGCMuso/R/normalMuso.R b/RBBGCMuso/R/normalMuso.R index df406a0..c7bfd29 100644 --- a/RBBGCMuso/R/normalMuso.R +++ b/RBBGCMuso/R/normalMuso.R @@ -3,7 +3,7 @@ #' This function optionally changes the EPC file and runs the Biome-BGCMuSo model in normal phase and reads its output file in a well-structured way with debugging features. (Execution of spinup phase is possible with spinupMuso.) #' #' @author Roland HOLLOS -#' @param settings You have to run the setupMuso function and then the spinupMuso function first as spinup phase creates the so-called endpoint file for the normal simulation (endpoint=initial conditions). The settings parameter contains the environment variables of the simulation as created by setupMuso. +#' @param settings RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option. #' @param timee The required timesteps in the model output. It can be "d", if it is daily, "m", if it is monthly, "y" if it is yearly. It is recommended to use daily data, as the yearly and monthly data is not well-tested yet. #' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. #' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory. From 6aed2bc863554c35b5a5bf8393a0e5eef88b9068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 15:04:13 +0100 Subject: [PATCH 07/10] Update runMuso.R --- RBBGCMuso/R/runMuso.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RBBGCMuso/R/runMuso.R b/RBBGCMuso/R/runMuso.R index 38f58f1..3d017d2 100644 --- a/RBBGCMuso/R/runMuso.R +++ b/RBBGCMuso/R/runMuso.R @@ -1,9 +1,9 @@ #' runMuso #' -#' This function changes the epc file and after that runs the BBGC-MuSo model and reads in its outputfile in a well-structured way. +#' This function runs the Biome-BGCMuSo model (with option to change the EPC file), then it reads its output file in a well-structured way. As the result is passed to R, the results can be easily post-processed in R environment. #' -#' @author Roland Holl\'{o}s -#' @param settings You have to run the setupMuso function before calibMuso. It is its output which contains all of the necessary system variables. It sets the whole running environment +#' @author Roland HOLL\'{O}S +#' @param settings RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option. #' @param 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. I recommend to use daily data, the yearly and monthly data is not well-tested yet. #' @param 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 #' @param 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. From da9ae4492120e382aa612eab9cd2452f9a5a604c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 15:05:00 +0100 Subject: [PATCH 08/10] Update spinupMuso.R --- RBBGCMuso/R/spinupMuso.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RBBGCMuso/R/spinupMuso.R b/RBBGCMuso/R/spinupMuso.R index e84edae..ec48ee4 100644 --- a/RBBGCMuso/R/spinupMuso.R +++ b/RBBGCMuso/R/spinupMuso.R @@ -3,7 +3,7 @@ #' This function runs the Biome-BGCMuSo model in spinup phase. #' #' @author Roland HOLLOS -#' @param settings In order to use spinupMuso, first you have to run the setupMuso function to set up the model environment. The result of setupMuso contains all necessary system variables for the model execution. It sets the whole modelling environment for the user. +#' @param settings IRBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option. #' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. #' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory. #' @param silent If you set the silent parameter to TRUE, all of the model's output normally written to the screen will be suppressed. This option can be useful to increase the speed of the model execution. From 382775229ca7b66fdcef37fbfc31f388e608c68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 15:20:00 +0100 Subject: [PATCH 09/10] Update runMuso.R --- RBBGCMuso/R/runMuso.R | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/RBBGCMuso/R/runMuso.R b/RBBGCMuso/R/runMuso.R index 3d017d2..c16fbdb 100644 --- a/RBBGCMuso/R/runMuso.R +++ b/RBBGCMuso/R/runMuso.R @@ -4,20 +4,20 @@ #' #' @author Roland HOLL\'{O}S #' @param settings RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option. -#' @param 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. I recommend to use daily data, the yearly and monthly data is not well-tested yet. -#' @param 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 -#' @param 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. -#' @param export if it is yes or you give a filename here, it converts the ouxtput 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. -#' @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 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) -#' @param logfilename If you want to set a specific name for your logfiles you can set this via logfile parameter -#' @param leapYear Should the function do a leapyear correction on the outputdata? If TRUE, then the 31.12 day will be doubled. -#' @param keepBinary In default RBBGCMuso to keep working area as clean as possible, deletes all the regular output files. The results are directly printed to the standard output, but you can redirect it, and save it to a variable, or you can export your results to the desired destination in a desired format. Whith this variable you can enable to keep the binary output files. If you want to set the location of the binary output, please take a look at the binaryPlace argument. -#' @param binaryPlace The place of the binary output files. -#' @param fileToChange You can change any line of the epc or the ini file, you just have to specify with this variable which file you van a change. Two options possible: "epc", "ini" -#' @param skipSpinup If TRUE, calibMuso wont do spinup simulation -#' @param prettyOut date ad Date type, separate year, month, day vectors +#' @param timee The required timesteps in the model output. It can be "d", if it is daily, "m", if it is monthly, "y" if it is yearly. It is recommended to use daily data, as the yearly and monthly data is not well-tested yet. +#' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. +#' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory. +#' @param export If it is set to YES or you define a filename here, the function converts the output to the specific file format. For example, if you set export to "example.csv", it converts the output to "csv". If you set it to "example.xls" it converts the output to example.xls with the xlsx package. If the Excel converter package is not installed it gives back a warning message and converts the results to csv. +#' @param silent IIf you set the silent parameter to TRUE, all of the model's output normally written to the screen will be suppressed. This option can be useful to increase the speed of the model execution. +#' @param aggressive It deletes all previous model-outputs from previous model runs. +#' @param parameters Using normalMuso it is possible to change some of the EPC parameters prior to model execution. This can be achieved with this option. In the parameters variable you have set the row indices of the variables that you wish to change. In this parameters you can give an exact value for them in a vector form like c(1,2,3,4). +#' @param logfilename If you would like to set a specific name for your logfiles you can set this via the logfile parameter. +#' @param leapYear Should the function do a leapyear correction on the output data? If TRUE, then the result for 31 December will be doubled in leap years which means that the results for the leap year will cover all 366 days. See the model's User's Guide for notes on leap years. +#' @param keepBinary By default RBBGCMuso keeps the working environment as clean as possible, thus deletes all the regular output files. The results are directly written to the standard output (e.g. to the screen), but you can redirect it and save them to a variable. Alternatively, you can export your results to the desired destination in a desired format. Through the keepBinary parameter you can set RBBGCMuso to keep the binary output files. If you would like to set the location of the binary output, please take a look at the binaryPlace argument. +#' @param binaryPlace The directory for the binary output files (see the keepBinary parameter). +#' @param fileToChange You can change any line of the EPC or the INI file prior to model execution. All you need to do is to specify with this variable which file you want to change. Two options possible: "EPC" or "INI" +#' @param skipSpinup If this is set to TRUE, runMuso will not perform the spinup simulation. This is of course means that the endpoint file (initial conditions) must be available for the normal INI file. This option might be extremely useful to speed up multiple model execution. In cropland related simulations due to site history the EPC file used in the normal phase might differ from the one used in the spinup phase, which means that the spinup is the same even if we change the parameterization for the normal phase. In this situation skipSpinup is really useful. +#' @param prettyOut If this parameter is to TRUE then date will provided as the R-style Date type, and separate year, month and day vectors. In typical cases the user should use this option. #' @return No return, outputs are written to file #' @usage calibMuso(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL, #' keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE) From f9ab707ec35c7a77c7a4e60bc6cc0b5ffdcb2e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Thu, 24 Jan 2019 15:20:26 +0100 Subject: [PATCH 10/10] Update normalMuso.R --- RBBGCMuso/R/normalMuso.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RBBGCMuso/R/normalMuso.R b/RBBGCMuso/R/normalMuso.R index c7bfd29..33e5dfa 100644 --- a/RBBGCMuso/R/normalMuso.R +++ b/RBBGCMuso/R/normalMuso.R @@ -1,20 +1,20 @@ #' normalMuso #' -#' This function optionally changes the EPC file and runs the Biome-BGCMuSo model in normal phase and reads its output file in a well-structured way with debugging features. (Execution of spinup phase is possible with spinupMuso.) +#' This function optionally changes the EPC file and runs the Biome-BGCMuSo model in normal phase and reads its output file in a well-structured way with debugging features. (Execution of spinup phase is possible with spinupMuso.) Prerequisite of normalMuso is the existence of the endpoint file (which is the result of the spinup phase and contains initial conditions for the simulation). #' #' @author Roland HOLLOS #' @param settings RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option. #' @param timee The required timesteps in the model output. It can be "d", if it is daily, "m", if it is monthly, "y" if it is yearly. It is recommended to use daily data, as the yearly and monthly data is not well-tested yet. #' @param debugging If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved. #' @param keepEpc If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory. -#' @param export If it is set to yes or you define a filename here, the function converts the output to the specific file format. For example, if you set export to "example.csv", it converts the output to "csv". If you set it to "example.xls" it converts the output to example.xls with the xlsx package. If the Excel converter package is not installed it gives back a warning message and converts the results to csv. +#' @param export If it is set to YES or you define a filename here, the function converts the output to the specific file format. For example, if you set export to "example.csv", it converts the output to "csv". If you set it to "example.xls" it converts the output to example.xls with the xlsx package. If the Excel converter package is not installed it gives back a warning message and converts the results to csv. #' @param silent If you set the silent parameter to TRUE, all of the model's output normally written to the screen will be suppressed. This option can be useful to increase the speed of the model execution. #' @param aggressive It deletes all previous model-outputs from previous model runs. -#' @param parameters Using normalMuso it is possible to change some of the EPC parameters prior to model execution. This can be achieved with this option. In the parameters variable you have set the row indices of the variables that you wish to change. In this parameters you can give an exact value for them in a vector form like c(1,2,3,4) +#' @param parameters Using normalMuso it is possible to change some of the EPC parameters prior to model execution. This can be achieved with this option. In the parameters variable you have set the row indices of the variables that you wish to change. In this parameters you can give an exact value for them in a vector form like c(1,2,3,4). #' @param logfilename If you would like to set a specific name for your logfiles you can set this via the logfile parameter. -#' @param leapYear Should the function do a leapyear correction on the outputdata? If TRUE, then the 31.12 day will be doubled. +#' @param leapYear Should the function do a leapyear correction on the output data? If TRUE, then the result for 31 December will be doubled in leap years which means that the results for the leap year will cover all 366 days. See the model's User's Guide for notes on leap years. #' @param keepBinary By default RBBGCMuso keeps the working environment as clean as possible, thus deletes all the regular output files. The results are directly written to the standard output (e.g. to the screen), but you can redirect it and save them to a variable. Alternatively, you can export your results to the desired destination in a desired format. Through the keepBinary parameter you can set RBBGCMuso to keep the binary output files. If you would like to set the location of the binary output, please take a look at the binaryPlace argument. -#' @param binaryPlace The place of the binary output files (see the keepBinary parameter). +#' @param binaryPlace The directory for the binary output files (see the keepBinary parameter). #' @param fileToChange You can change any line of the EPC or the INI file prior to model execution. All you need to do is to specify with this variable which file you want to change. Two options possible: "EPC" or "INI" #' @return The simulation output matrix, where the columns are the chosen variables and each row is a daily/monthly/annual data. #' @usage normalMuso(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL,