From f1756ebd9379e3679050b0bc04a7b267becd9d88 Mon Sep 17 00:00:00 2001 From: hollorol Date: Mon, 21 Jan 2019 23:20:06 +0100 Subject: [PATCH 01/17] Adding new installation method for Debian users --- README.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.org b/README.org index a54397a..dc28245 100644 --- a/README.org +++ b/README.org @@ -30,6 +30,14 @@ Then copy the following line into the R session and execute it: devtools::install_github("hollorol/RBBGCMuso/RBBGCMuso") #+END_SRC +In debian(8+) you can automate the whole process with curl via copying the following line in terminal: +#+BEGIN_SRC bash :eval no +bash <(curl -s https://raw.githubusercontent.com/hollorol/RBBGCMuso/Documentation/debianInstaller.sh) +#+END_SRC + + + + From bf607394c9e961c6fb43af5069f49c792714b8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 10:50:16 +0100 Subject: [PATCH 02/17] Update README.org updates, improvements --- README.org | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/README.org b/README.org index dc28245..17ce7cf 100644 --- a/README.org +++ b/README.org @@ -9,13 +9,7 @@ RBBGCMuso is an R package which supports the easy but powerful application of th ** Installation You can install the RBBGCMuso package in several ways depending on the operating system you use. Up to now RBBGCMuso was tested only in Linux and MS Windows environment, so Mac OS X compatibility cannot be guaranteed yet. In MS Windows you can install the package from binary or from source installer. In Linux you can only install the software from source. -*** Installation in MS Windows -You can always install the latest RBBGCMuso by copying the following line into the R console (using R or RStudio): -#+BEGIN_SRC R :eval no -source("https://raw.githubusercontent.com/hollorol/RBBGCMuso/master/installWin.R") -#+END_SRC - -*** Installation in Linux and Windows from Source (proposed method) +*** Installation in Linux and MS Windows from Source (proposed method) *Note that in MS Windows you have to install the [[https://cran.r-project.org/bin/windows/Rtools/][Rtools]] Windows software firts.* If you would like to install the RBBGCMuso package from Source, you have two options. a) Clone this repository, then build and run the package (further information is available here: [[http://kbroman.org/pkg_primer/pages/build.html][package build and install]]) @@ -30,40 +24,42 @@ Then copy the following line into the R session and execute it: devtools::install_github("hollorol/RBBGCMuso/RBBGCMuso") #+END_SRC -In debian(8+) you can automate the whole process with curl via copying the following line in terminal: +In Debian (version 8+) you can automate the whole installation process with curl via copying the following line into the Linux terminal: #+BEGIN_SRC bash :eval no bash <(curl -s https://raw.githubusercontent.com/hollorol/RBBGCMuso/Documentation/debianInstaller.sh) #+END_SRC - - - - - +*** Installation in MS Windows +You can also install the latest RBBGCMuso by copying the following line into the R console (using R or RStudio): +#+BEGIN_SRC R :eval no +source("https://raw.githubusercontent.com/hollorol/RBBGCMuso/master/installWin.R") +#+END_SRC ** Quick usage *** Preparation -In order to use the RBBGCMuso framework, you have to set up the environment, as you would normally do if you use the model without the RBBGCMuso framework. It means that according to the Biome-BGCMuSo terminology you have to have the proper INI file set, the meteorology input file, and the ecophysiological constants file (EPC) as minimum input. Additional files might be used by the user including nitrogen deposition, management handlers, etc. Please read the corresponding documentation in the [[http://agromo.agrar.mta.hu/bbgc/files/Manual_BBGC_MuSo_v5.pdf][actual Biome-BGCMuSo User's Guide]]. -In order to use RBBGCMuso you have to load the package with the following command: + +To start using RBBGCMuso you have to load the package in R with the following command: #+BEGIN_SRC R :eval no library(RBBGCMuso) #+END_SRC -If you do not yet have a complete, operational model input dataset, you may want to use the so-called copyMusoExampleTo function (part of RBBGCMuso) which downloads a complete sample simulation to your hard drive: +In order to use the RBBGCMuso framework, you have to set up the environment, as you would normally do if you use the model without the RBBGCMuso framework. It means that according to the Biome-BGCMuSo terminology you have to have the proper INI file set, the meteorology input file, and the ecophysiological constants file (EPC) as minimum input. Additional files might be included by the user including nitrogen deposition, management handlers, etc. Please read the corresponding documentation in the [[http://agromo.agrar.mta.hu/bbgc/files/Manual_BBGC_MuSo_v5.pdf][actual Biome-BGCMuSo User's Guide]]. + +If you do not yet have a complete, operational model input dataset, you may want to use the so-called copyMusoExampleTo function (part of RBBGCMuso) which downloads a complete sample simulation set to your hard drive: #+BEGIN_SRC R :eval no copyMusoExampleTo() #+END_SRC -Once this command is executed in R it will invoke a small Graphical User Interface (GUI) where you can select the target site for the sample simulation. At present only "hhs" site is available, which is the abbreviation of the Hegyhátsál eddy covariance station in Hungary. After selecting the site (hhs in this example) the GUI will ask the user to specify a directory (in other word, folder) where the dataset will be stored. In this example we suppose that the user works under MS Windows, and he/she created a directory called C:\model as target directory. It means that after selection of the site the user will select the C:\model directory. -Once the copyMusoExampleTo command is finished, the model input dataset and the model executable (called muso.exe and cygwin1.dll) are available in the C:\model folder. The user might check the content of the files using his/her favourite text editor (we propose Editpad Lite). Note that file extension might be hidden by Windows which might be an issue, so we propose to adjust Windows so that file extensions are visible. Visit [[https://www.thewindowsclub.com/show-file-extensions-in-windows][this website]] to learn how to show file extensions in Windows. +Once this command is executed in R it will invoke a small Graphical User Interface (GUI) where you can select the target site for the sample simulation. At present only "hhs" site is available, which is the abbreviation of the Hegyhátsál eddy covariance station in Hungary. After selecting the site (hhs in this example) the GUI will ask the user to specify a directory (=folder) where the dataset will be stored. In this example we suppose that the user works under MS Windows, and he/she created a directory called C:\model as target directory. It means that after selection of the site the user will select the C:\model directory. +Once the copyMusoExampleTo command is finished, the model input dataset and the model executable (called muso.exe and cygwin1.dll) are available in the C:\model folder. The user might check the content of the files using his/her favourite text editor (we propose Editpad Lite as it can handle both Windows and Linux text files). Note that file extension might be hidden by Windows which could cause problems, so we propose to adjust Windows so that file extensions are visible. Visit [[https://www.thewindowsclub.com/show-file-extensions-in-windows][this website]] to learn how to show file extensions in Windows. In this example the C:\model directory will contain the following files: - muso.exe - this is the Biome-BGCMuSo 5.0 model (version might change in the future) -- cygwin1.dll - a so-called DLL file that supports the model exe +- cygwin1.dll - a so-called DLL file that supports the model execution - c3grass.epc - ecophysiological constants input file for the model (C3 grass in this case) - maize.epc - another ecophysiological constants input file (C4 maize in this case) -- n.ini - initialization file for the model, normal mode +- n.ini - initialization file for the model, normal mode (INI file controls the entire simulation) - normal_gyep.ini - another initialization file for the model, for the C3 grass simulation - s.ini - initialization file for the model spinup (also known as self-initialization or equilibrium run) - parameters.csv - a simple text file to support sensitivity analysis and parameter sweel (see below) @@ -73,7 +69,9 @@ In this example the C:\model directory will contain the following files: *** Running the model -Now as we have a complete set of input data we are ready to run the model. You can run the model in spinup model, in normal mode, or in both phases (including the so-called transient run). Using the calibMuso functcion (that is part of RBBGCMuso) you will be able to execute the the model in both spinup or normal phase. +Now as we have a complete set of input data, we are ready to run the model. You can run the model in spinup model, in normal mode, or in both phases (including the so-called transient run; see the Biome-BGCMuSo User's Guide). Using the runMuso functcion (that is part of RBBGCMuso) you will be able to execute the the model in both spinup or normal phase, and you can also simplify the execution of both phases consecutively. Note that runMuso is the same as the obsolete calibMuso function. + + *** Visualization of the model output *** Perform Quick experiments From abff2f5954d64b226be25cd7f51c46f74aa13590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 11:19:56 +0100 Subject: [PATCH 03/17] Update README.org improvements --- README.org | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 17ce7cf..9352ac1 100644 --- a/README.org +++ b/README.org @@ -10,7 +10,7 @@ RBBGCMuso is an R package which supports the easy but powerful application of th You can install the RBBGCMuso package in several ways depending on the operating system you use. Up to now RBBGCMuso was tested only in Linux and MS Windows environment, so Mac OS X compatibility cannot be guaranteed yet. In MS Windows you can install the package from binary or from source installer. In Linux you can only install the software from source. *** Installation in Linux and MS Windows from Source (proposed method) -*Note that in MS Windows you have to install the [[https://cran.r-project.org/bin/windows/Rtools/][Rtools]] Windows software firts.* +*Note that in MS Windows first you have to install the [[https://cran.r-project.org/bin/windows/Rtools/][Rtools]] Windows software.* If you would like to install the RBBGCMuso package from Source, you have two options. a) Clone this repository, then build and run the package (further information is available here: [[http://kbroman.org/pkg_primer/pages/build.html][package build and install]]) OR @@ -71,7 +71,19 @@ In this example the C:\model directory will contain the following files: Now as we have a complete set of input data, we are ready to run the model. You can run the model in spinup model, in normal mode, or in both phases (including the so-called transient run; see the Biome-BGCMuSo User's Guide). Using the runMuso functcion (that is part of RBBGCMuso) you will be able to execute the the model in both spinup or normal phase, and you can also simplify the execution of both phases consecutively. Note that runMuso is the same as the obsolete calibMuso function. +In order to execute the simulation, first you have to set the working directory in R so that RBBGCMuso will find the model and the input files: +#+BEGIN_SRC R :eval no +setwd("c:/model") +#+END_SRC + +(Note the "/" symbol which is different from the "\" that is typically used in Windows!) + +In order to run the model as it is provided simply use the following command in R or RStudio: + +runMuso(skipSpinup = FALSE) + +Though runMuso has several possibilities, in this case we simply run the model in spinup and normal mode. The results can be found in the C:\model directory. *** Visualization of the model output *** Perform Quick experiments From 071dd6474b0ef39d2e74d59473469523b54c1901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 11:23:13 +0100 Subject: [PATCH 04/17] Update README.org impro --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 9352ac1..087c7a7 100644 --- a/README.org +++ b/README.org @@ -77,7 +77,7 @@ In order to execute the simulation, first you have to set the working directory setwd("c:/model") #+END_SRC -(Note the "/" symbol which is different from the "\" that is typically used in Windows!) +(Note the "/" symbol which is different from the "\\" that is typically used in Windows!) In order to run the model as it is provided simply use the following command in R or RStudio: From 5a9df982d5f6c8dccbe336713f6c0345c12f52e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 11:27:01 +0100 Subject: [PATCH 05/17] Update README.org --- README.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 087c7a7..1c9af64 100644 --- a/README.org +++ b/README.org @@ -83,7 +83,9 @@ In order to run the model as it is provided simply use the following command in runMuso(skipSpinup = FALSE) -Though runMuso has several possibilities, in this case we simply run the model in spinup and normal mode. The results can be found in the C:\model directory. +Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. + +If the simulation is successful, the results can be found in the C:\model directory. *** Visualization of the model output *** Perform Quick experiments From bdb58a9209b05d7bd4f7775e6e808ddf1a2eaaa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 11:28:23 +0100 Subject: [PATCH 06/17] Update README.org --- README.org | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/README.org b/README.org index 1c9af64..b9cf04d 100644 --- a/README.org +++ b/README.org @@ -81,33 +81,26 @@ setwd("c:/model") In order to run the model as it is provided simply use the following command in R or RStudio: +#+BEGIN_SRC R :eval no runMuso(skipSpinup = FALSE) +#+END_SRC Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. If the simulation is successful, the results can be found in the C:\model directory. *** Visualization of the model output + + *** Perform Quick experiments + + *** Study the effect of ecophysiological parameters using parameterSweep + + *** Sensitivity analysis -** Advanced usage - -*** setupMuso -*** musoData -*** musoMapping -*** musoMappingFind -*** spinupMuso -*** normalMuso -*** calibMuso -*** plotMuso -*** plotMusoWithData -*** musoQuckEffect -*** musoMonte -*** musoSensi -** Contact E-mail: hollorol@gmail.com From ef6da2fc11ca2b7ba77ba061fbc39dad19209db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 13:15:47 +0100 Subject: [PATCH 07/17] Update README.org --- README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index b9cf04d..690c40c 100644 --- a/README.org +++ b/README.org @@ -87,7 +87,7 @@ runMuso(skipSpinup = FALSE) Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. -If the simulation is successful, the results can be found in the C:\model directory. +If the simulation is successful, the results can be found in the C:\model directory. Two files were created with .log extension that contain some information about the spinup and the normal phase. The hhs.endpoint file is the result of the spinup (and optional transient) run, and can be considered as initial conditions for the normal run.( Here we have to note that now runMuso can be called without the skipSpinup parameter which means that the simulation will be restricted to the normal phase only.) The results of the simulation (carbon fluxes, state variables, whatever was set by the user in the DAILY_OUTPUT block of the normal INI file) are available in the file hegyhatsal.dayout. Note that annual output was not requested in this case. *** Visualization of the model output @@ -100,7 +100,7 @@ If the simulation is successful, the results can be found in the C:\model direct *** Sensitivity analysis - +*** Contact E-mail: hollorol@gmail.com From bb001022cd75f043b93a2078d0e3a7b572f743c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 14:11:08 +0100 Subject: [PATCH 08/17] Update README.org --- README.org | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 690c40c..32879a8 100644 --- a/README.org +++ b/README.org @@ -67,11 +67,24 @@ In this example the C:\model directory will contain the following files: - hhs_2013-2016.mtc43 - meteorology input file for the normal simulation - CO2_from1961.txt - CO_{2} file for the normal simulation +In the followings we will demonstrate the usability of RBBGCMuso with the hhs example dataset. If you have your own model input data set, you might need to change the commands accordingly. + +---------- +#+begin_note +*Important note on file naming convention* + +We propose to use the following filename convention for the INI files. For practical reasons, name your spinup INI file as something_s.ini, and the normal INI file as something_n.ini where something is arbitrary (note the s and n convention). It is not obligatory, but if you do not follow this convention then you have to generate the settings variable +manually with the setupMuso command. However, if you do follow this convention, then RBBGCMuSo will automatically recognize your spinup and normal INI file name and content, so the work will be much easier. (See help of setupMuso command in R). +In our example s.ini and n.ini follows this convention, so by default RBBGCMuso will use these files for spinup and normal run, repsectively. +#+end_note +---------- + + *** Running the model Now as we have a complete set of input data, we are ready to run the model. You can run the model in spinup model, in normal mode, or in both phases (including the so-called transient run; see the Biome-BGCMuSo User's Guide). Using the runMuso functcion (that is part of RBBGCMuso) you will be able to execute the the model in both spinup or normal phase, and you can also simplify the execution of both phases consecutively. Note that runMuso is the same as the obsolete calibMuso function. -In order to execute the simulation, first you have to set the working directory in R so that RBBGCMuso will find the model and the input files: +In order to execute the simulation, first you have to set the working directory in R so that RBBGCMuso will find the model and the input files. In our example this is as follows: #+BEGIN_SRC R :eval no setwd("c:/model") @@ -85,13 +98,14 @@ In order to run the model as it is provided simply use the following command in runMuso(skipSpinup = FALSE) #+END_SRC -Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. +Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. Note that according to the naming convention described above the model will use s.ini and n.ini for spinup and normal phase, repsectivelt. It means that the 3rd ini file is not used in this case. -If the simulation is successful, the results can be found in the C:\model directory. Two files were created with .log extension that contain some information about the spinup and the normal phase. The hhs.endpoint file is the result of the spinup (and optional transient) run, and can be considered as initial conditions for the normal run.( Here we have to note that now runMuso can be called without the skipSpinup parameter which means that the simulation will be restricted to the normal phase only.) The results of the simulation (carbon fluxes, state variables, whatever was set by the user in the DAILY_OUTPUT block of the normal INI file) are available in the file hegyhatsal.dayout. Note that annual output was not requested in this case. +If the simulation is successful, the results can be found in the C:\model directory. In our example two files were created with .log extension that contain some information about the spinup and the normal phase. The hhs.endpoint file is the result of the spinup (and optional transient) run, and can be considered as initial conditions for the normal run. (Here we have to note that now runMuso can be called without the skipSpinup parameter which means that the simulation will be restricted to the normal phase only.) The results of the simulation (carbon fluxes, state variables, whatever was set by the user in the DAILY_OUTPUT block of the normal INI file) are available in the file hegyhatsal.dayout. Note that annual output was not requested in this case. Also note that in the hhs example file set binary daily output is created and further processed by RBBGCMuso. *** Visualization of the model output + *** Perform Quick experiments From d5d6556268ada6b50a9acaff04cc3b24b427a3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 14:14:52 +0100 Subject: [PATCH 09/17] Update README.org --- README.org | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.org b/README.org index 32879a8..f148b96 100644 --- a/README.org +++ b/README.org @@ -69,14 +69,12 @@ In this example the C:\model directory will contain the following files: In the followings we will demonstrate the usability of RBBGCMuso with the hhs example dataset. If you have your own model input data set, you might need to change the commands accordingly. ----------- -#+begin_note *Important note on file naming convention* +---------- We propose to use the following filename convention for the INI files. For practical reasons, name your spinup INI file as something_s.ini, and the normal INI file as something_n.ini where something is arbitrary (note the s and n convention). It is not obligatory, but if you do not follow this convention then you have to generate the settings variable manually with the setupMuso command. However, if you do follow this convention, then RBBGCMuSo will automatically recognize your spinup and normal INI file name and content, so the work will be much easier. (See help of setupMuso command in R). In our example s.ini and n.ini follows this convention, so by default RBBGCMuso will use these files for spinup and normal run, repsectively. -#+end_note ---------- From 777a4b4002eab6b5182c58a246d94ba4dec796f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 14:18:57 +0100 Subject: [PATCH 10/17] Update README.org --- README.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index f148b96..cee0899 100644 --- a/README.org +++ b/README.org @@ -69,9 +69,11 @@ In this example the C:\model directory will contain the following files: In the followings we will demonstrate the usability of RBBGCMuso with the hhs example dataset. If you have your own model input data set, you might need to change the commands accordingly. -*Important note on file naming convention* + ---------- +*Important note on file naming convention* + We propose to use the following filename convention for the INI files. For practical reasons, name your spinup INI file as something_s.ini, and the normal INI file as something_n.ini where something is arbitrary (note the s and n convention). It is not obligatory, but if you do not follow this convention then you have to generate the settings variable manually with the setupMuso command. However, if you do follow this convention, then RBBGCMuSo will automatically recognize your spinup and normal INI file name and content, so the work will be much easier. (See help of setupMuso command in R). In our example s.ini and n.ini follows this convention, so by default RBBGCMuso will use these files for spinup and normal run, repsectively. From 9c3bbcfc9a46b6fbb86506004604504c50375957 Mon Sep 17 00:00:00 2001 From: hollorol Date: Tue, 22 Jan 2019 14:21:46 +0100 Subject: [PATCH 11/17] Update debianInstaller.sh --- debianInstaller.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debianInstaller.sh b/debianInstaller.sh index 0d35a55..5a384bb 100755 --- a/debianInstaller.sh +++ b/debianInstaller.sh @@ -6,8 +6,8 @@ then echo "Your Debian version is obsolated." exit 1 fi -INREPO=$(cat /etc/apt/sources.list|grep -c jessie-cran35) -if (( $(echo "$DEBIAN_VERSION < 9 && $INREPO != 0" | bc -l ))) +#INREPO=$(cat /etc/apt/sources.list|grep -c jessie-cran35) +if (( $(echo "$DEBIAN_VERSION < 9" | bc -l ))) then apt-get install apt-transport-https apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF' From 0b544a62d77391308f7283d805a3aab7cb767ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 15:09:50 +0100 Subject: [PATCH 12/17] Update README.org major updates --- README.org | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index cee0899..1f21376 100644 --- a/README.org +++ b/README.org @@ -75,7 +75,7 @@ In the followings we will demonstrate the usability of RBBGCMuso with the hhs ex *Important note on file naming convention* We propose to use the following filename convention for the INI files. For practical reasons, name your spinup INI file as something_s.ini, and the normal INI file as something_n.ini where something is arbitrary (note the s and n convention). It is not obligatory, but if you do not follow this convention then you have to generate the settings variable -manually with the setupMuso command. However, if you do follow this convention, then RBBGCMuSo will automatically recognize your spinup and normal INI file name and content, so the work will be much easier. (See help of setupMuso command in R). +manually with the setupMuso command. However, if you do follow this convention, then RBBGCMuSo will automatically recognize your spinup and normal INI file name and content, so the work will be much easier. (See help of setupMuso command in R.) In our example s.ini and n.ini follows this convention, so by default RBBGCMuso will use these files for spinup and normal run, repsectively. ---------- @@ -98,22 +98,53 @@ In order to run the model as it is provided simply use the following command in runMuso(skipSpinup = FALSE) #+END_SRC -Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. Note that according to the naming convention described above the model will use s.ini and n.ini for spinup and normal phase, repsectivelt. It means that the 3rd ini file is not used in this case. +Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. Note that according to the naming convention described above the model will use s.ini and n.ini for spinup and normal phase, repsectivelt. It means that the 3rd ini file is not used in this case. As n.ini represents a maize simulation, the results will provide simulation data on C4 maize monoculture with predefined management defined by the n.ini file. -If the simulation is successful, the results can be found in the C:\model directory. In our example two files were created with .log extension that contain some information about the spinup and the normal phase. The hhs.endpoint file is the result of the spinup (and optional transient) run, and can be considered as initial conditions for the normal run. (Here we have to note that now runMuso can be called without the skipSpinup parameter which means that the simulation will be restricted to the normal phase only.) The results of the simulation (carbon fluxes, state variables, whatever was set by the user in the DAILY_OUTPUT block of the normal INI file) are available in the file hegyhatsal.dayout. Note that annual output was not requested in this case. Also note that in the hhs example file set binary daily output is created and further processed by RBBGCMuso. +If the simulation is successful, the results can be found in the C:\model directory. In our example two files were created with .log extension that contain some information about the spinup and the normal phase. The hhs.endpoint file is the result of the spinup (and optional transient) run, and can be considered as initial conditions for the normal run. (Here we have to note that now runMuso can be called without the skipSpinup parameter which means that the simulation will be restricted to the normal phase only.) The results of the simulation (carbon fluxes, state variables, whatever was set by the user in the DAILY_OUTPUT block of the normal INI file) are available in the file hegyhatsal.dayout. Note that annual output was not requested in this case. Also note that in the hhs example file set binary daily output is created and further processed by RBBGCMuso. One of the most attractive features of RBBGCMuso is that the model output is handled by the package which means that it will be directly available for the user for further processing in R. *** Visualization of the model output +Once the simulation is completed (hopefully without errors), we can visualize the results. Biome-BGCMuSo provides large flexibility on model output selection, which means that the results will depend on the settings of the user in the normal INI file (DAILY_OUTPUT block). In our hhs example 39 variables are calculated in daily resolution. As the model is run for 4 years by the normal INI file, each output variable will be available for 4x365 days (note the handling of leap years in the Biome-BGCMuSo User's Guide). +Assume that we would like to visualize Gross Primary Production (GPP) for one simulation year (this is the 27th variable in the n.ini file). This can be achieved by the following commands. First we re-run the normal phase and redirect the output to the R variable called 'results': + +#+BEGIN_SRC R :eval no +results<-runMuso() +#+END_SRC + +Now we extract the 27th variable from the complete output set and call this R variable as gpp: + +#+BEGIN_SRC R :eval no +gpp<-results[,27] +#+END_SRC + +Now we are ready to visualize the results, first for all 4 years: + +#+BEGIN_SRC R :eval no +plot(gpp*1000) +#+END_SRC + +Note that the 1000 multiplier is needed to get GPP in gC/m^{2}/day units. + +Now get the 4th year from the dataset and plot it: + +#+BEGIN_SRC R :eval no +gpp4<-gpp[(3*365+1):(4*365)] +plot(gpp4*1000,type="l") +#+END_SRC *** Perform Quick experiments +Assume that we would like to dig a bit deeper with the model and understand the effect of changing ecophysiological variables on the model results. This can easily be performed with RBBGCMuso. *** Study the effect of ecophysiological parameters using parameterSweep +This is the so-called parameterSweep function. *** Sensitivity analysis +[[http://agromo.agrar.mta.hu/files/musoSensi_usage_v6_FINAL.pdf][See this link for details]] + *** Contact E-mail: hollorol@gmail.com From de9a02ad2d99b36ee4ff585276bba04219b0df22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 15:23:27 +0100 Subject: [PATCH 13/17] Update README.org almost ready? --- README.org | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 1f21376..7da9d33 100644 --- a/README.org +++ b/README.org @@ -135,15 +135,21 @@ plot(gpp4*1000,type="l") *** Perform Quick experiments -Assume that we would like to dig a bit deeper with the model and understand the effect of changing ecophysiological variables on the model results. This can easily be performed with RBBGCMuso. +Assume that we would like to dig a bit deeper with the model and understand the effect of changing ecophysiological variables on the model results. This can easily be performed with RBBGCMuso. Execute the following command in R/RStudio: + +#+BEGIN_SRC R :eval no +musoQuickEffect(calibrationPar = 25, startVal = 0,endVal = 9,nSteps = 5,outVar = 3009) +#+END_SRC + *** Study the effect of ecophysiological parameters using parameterSweep -This is the so-called parameterSweep function. +The parameterSweep function is the extension of the musoQuickEffect. It can test the effect of the selected parameters on the model results in once. The result of the parameterSweep function is a single HTML file with embedded images. *** Sensitivity analysis -[[http://agromo.agrar.mta.hu/files/musoSensi_usage_v6_FINAL.pdf][See this link for details]] +[[http://agromo.agrar.mta.hu/files/musoSensi_usage_v6_FINAL.pdf][See this link for details about the sensitivity analysis.]] +Note that parameters.csv is provided in the hhs example dataset, so you don't have to create it manually. *** Contact From 714698856414e245187dac9075c191f15fc5581a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 15:57:53 +0100 Subject: [PATCH 14/17] Update README.org almost ready --- README.org | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 7da9d33..0be6728 100644 --- a/README.org +++ b/README.org @@ -141,15 +141,23 @@ Assume that we would like to dig a bit deeper with the model and understand the musoQuickEffect(calibrationPar = 25, startVal = 0,endVal = 9,nSteps = 5,outVar = 3009) #+END_SRC +This command selects the 25th line in the ecophysiological constants (EPC) file (this is base temperature), then it starts to replace the original value from 0 to 9 in 5 consecutive steps. In this example GPP is selected (variable number 3009, which is the 27th variable), so the effect of varying base temperature on GPP is calculated using 9 simulations. The result is a spectacular plot where color coding is used distinguish the parameter values. -*** Study the effect of ecophysiological parameters using parameterSweep +*** Study the effect of ecophysiological parameters using paramSweep -The parameterSweep function is the extension of the musoQuickEffect. It can test the effect of the selected parameters on the model results in once. The result of the parameterSweep function is a single HTML file with embedded images. +The paramSweep function is the extension of the musoQuickEffect. It can test the effect of the selected parameters on the model results in once. The result of the paramSweep function is a single HTML file with embedded images. paramSweep needs a csv file called parameters.csv which defines the parameters of interest and the corresponding parameter intervals. In case of the hhs sample dataset there is an example parameters/csv file (please open it and check). Note that there is a tricky part in the parameters.csv as the parameter selection is not straightforward in case of multiple columns (see the end of the EPC file). The logic is that real numbers are used to select the appropriate parameter from multiple columns. In the provided example "keles,170.61,0,1000" means that in the 170th line of the EPC file there are 7 columns (numbering starts from 0, so it is 6), and we would like to adjust the 2nd column (marked by 1), which ends up with 170.61. 0,1000 means that sweep starts at 0 and ends with 1000. Invoke the paramSweep with simply issuing this command: + +#+BEGIN_SRC R :eval no +paramSweep() +#+END_SRC + +*IMPORTANT NOTE: After the execution of thos command a pop-up window will be opened to select the appropriate parameters.csv file. Due to some R related issues at present the dialog window will appear BEHIND THE MAIN R WINDOW, so it might be hidden from the user. Please check the Windows taskbar and find the dialog window, then select the parameters.csv.* +In advanced mode there is possibility to select the parameters.csv file using the parameters of paramSweep. *** Sensitivity analysis [[http://agromo.agrar.mta.hu/files/musoSensi_usage_v6_FINAL.pdf][See this link for details about the sensitivity analysis.]] -Note that parameters.csv is provided in the hhs example dataset, so you don't have to create it manually. +Note that parameters.csv is provided in the hhs example dataset, so you don't have to create it manually. *** Contact From 39eb74880f558f86242a998dbe3c260fd8935cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Tue, 22 Jan 2019 15:58:37 +0100 Subject: [PATCH 15/17] Update README.org --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 0be6728..bb717e0 100644 --- a/README.org +++ b/README.org @@ -138,7 +138,7 @@ plot(gpp4*1000,type="l") Assume that we would like to dig a bit deeper with the model and understand the effect of changing ecophysiological variables on the model results. This can easily be performed with RBBGCMuso. Execute the following command in R/RStudio: #+BEGIN_SRC R :eval no -musoQuickEffect(calibrationPar = 25, startVal = 0,endVal = 9,nSteps = 5,outVar = 3009) +musoQuickEffect(calibrationPar = 25, startVal = 0, endVal = 9, nSteps = 5, outVar = 3009) #+END_SRC This command selects the 25th line in the ecophysiological constants (EPC) file (this is base temperature), then it starts to replace the original value from 0 to 9 in 5 consecutive steps. In this example GPP is selected (variable number 3009, which is the 27th variable), so the effect of varying base temperature on GPP is calculated using 9 simulations. The result is a spectacular plot where color coding is used distinguish the parameter values. From 5001836193040ac675ecd9621fb4f4b98f2413c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barcza=20Zolt=C3=A1n?= Date: Wed, 23 Jan 2019 10:46:48 +0100 Subject: [PATCH 16/17] minor fix --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index bb717e0..fa0de76 100644 --- a/README.org +++ b/README.org @@ -151,7 +151,7 @@ The paramSweep function is the extension of the musoQuickEffect. It can test the paramSweep() #+END_SRC -*IMPORTANT NOTE: After the execution of thos command a pop-up window will be opened to select the appropriate parameters.csv file. Due to some R related issues at present the dialog window will appear BEHIND THE MAIN R WINDOW, so it might be hidden from the user. Please check the Windows taskbar and find the dialog window, then select the parameters.csv.* +*IMPORTANT NOTE: After the execution of this command a pop-up window will be opened to select the appropriate parameters.csv file. Due to some R related issues at present the dialog window will appear BEHIND THE MAIN R WINDOW, so it might be hidden from the user. Please check the Windows taskbar and find the dialog window, then select the parameters.csv.* In advanced mode there is possibility to select the parameters.csv file using the parameters of paramSweep. *** Sensitivity analysis From a4608c668e9ddde17d6812fb43fdf78c0ad2dd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20BARCZA?= Date: Wed, 23 Jan 2019 10:59:25 +0100 Subject: [PATCH 17/17] Update README.org --- README.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index fa0de76..9e43b2a 100644 --- a/README.org +++ b/README.org @@ -60,7 +60,7 @@ In this example the C:\model directory will contain the following files: - c3grass.epc - ecophysiological constants input file for the model (C3 grass in this case) - maize.epc - another ecophysiological constants input file (C4 maize in this case) - n.ini - initialization file for the model, normal mode (INI file controls the entire simulation) -- normal_gyep.ini - another initialization file for the model, for the C3 grass simulation +- normal_grass.ini - another initialization file for the model, for the C3 grass simulation - s.ini - initialization file for the model spinup (also known as self-initialization or equilibrium run) - parameters.csv - a simple text file to support sensitivity analysis and parameter sweel (see below) - hhs_1961-2014.mtc43 - meteorology input file; this file is used for spinup simulation @@ -106,16 +106,16 @@ If the simulation is successful, the results can be found in the C:\model direct Once the simulation is completed (hopefully without errors), we can visualize the results. Biome-BGCMuSo provides large flexibility on model output selection, which means that the results will depend on the settings of the user in the normal INI file (DAILY_OUTPUT block). In our hhs example 39 variables are calculated in daily resolution. As the model is run for 4 years by the normal INI file, each output variable will be available for 4x365 days (note the handling of leap years in the Biome-BGCMuSo User's Guide). -Assume that we would like to visualize Gross Primary Production (GPP) for one simulation year (this is the 27th variable in the n.ini file). This can be achieved by the following commands. First we re-run the normal phase and redirect the output to the R variable called 'results': +Assume that we would like to visualize Gross Primary Production (GPP) for one simulation year (this is the 26th variable in the n.ini file). This can be achieved by the following commands. First we re-run the normal phase and redirect the output to the R variable called 'results': #+BEGIN_SRC R :eval no results<-runMuso() #+END_SRC -Now we extract the 27th variable from the complete output set and call this R variable as gpp: +Now we extract the 26th variable from the complete output set and call this R variable as gpp: #+BEGIN_SRC R :eval no -gpp<-results[,27] +gpp<-results[,26] #+END_SRC Now we are ready to visualize the results, first for all 4 years: @@ -141,7 +141,7 @@ Assume that we would like to dig a bit deeper with the model and understand the musoQuickEffect(calibrationPar = 25, startVal = 0, endVal = 9, nSteps = 5, outVar = 3009) #+END_SRC -This command selects the 25th line in the ecophysiological constants (EPC) file (this is base temperature), then it starts to replace the original value from 0 to 9 in 5 consecutive steps. In this example GPP is selected (variable number 3009, which is the 27th variable), so the effect of varying base temperature on GPP is calculated using 9 simulations. The result is a spectacular plot where color coding is used distinguish the parameter values. +This command selects the 265h line in the ecophysiological constants (EPC) file (this is base temperature), then it starts to replace the original value from 0 to 9 in 5 consecutive steps. In this example GPP is selected (variable number 3009, which is the 26th variable), so the effect of varying base temperature on GPP is calculated using 9 simulations. The result is a spectacular plot where color coding is used distinguish the parameter values. *** Study the effect of ecophysiological parameters using paramSweep