User Tools

Site Tools


software-cst-317-2015

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
software-cst-317-2015 [2015/07/16 17:44]
gilberto
software-cst-317-2015 [2016/06/30 12:01]
pedro
Line 1: Line 1:
 You are in [[http://​www.geoinformatics.cc | Geoinformatics - Creative Commons]] :: [[http://​www.geoinformatics.cc/​doku.php?​id=cst-317|Introduction to Earth System Modelling]] :: Software for the Course You are in [[http://​www.geoinformatics.cc | Geoinformatics - Creative Commons]] :: [[http://​www.geoinformatics.cc/​doku.php?​id=cst-317|Introduction to Earth System Modelling]] :: Software for the Course
  
-===== Introduction to Earth System Modelling: Software =====+====== Introduction to Earth System Modelling: Software ​======
  
-==== Software Description ​ ====+===== Software Description  ​=====
  
-The models described in this course will be developed using [[http://​www.terrame.org | TerraME]]. TerraME is an extension of the [[http://​www.lua.org|Lua]] language. ​Some useful documents ​about TerraME:+The models described in this course will be developed using [[http://​www.terrame.org | TerraME]]. TerraME is an extension of the [[http://​www.lua.org|Lua]] language. ​Please read the following introduction ​about TerraME, to get a sense of the language and what we are going to teach:
  
-  * {{http://​www.dpi.inpe.br/​gilberto/​papers/​mrel_paper.pdf|Experiences with a Socio-Environmental Modeling Course//Modelling in Science Education and Learning//, 2014}} +  * A primer on TerraME2016.
-  * {{http://​www.dpi.inpe.br/​gilberto/​papers/​terrame_ems_post_print.pdf|TerraME:​An extensible toolbox for modelling nature-society interactions,​ //​Environmental Modelling and Software//, 2013}}+
  
-Students should read the TerraME EMS and the MREL papers first, to get a sense of the language and what we are going to teach. ​The next step is to learn the basics of Lua, which is a simple and elegant programming language. ​Good references on Lua are:+The next step is to learn the basics of Lua, which is a simple and elegant programming language. ​We provide an introduction about Lua for TerraME users:
  
-  * {{http://www.lua.org/spe.html| Lua - an extensible extension language, by R. Ierusalimschy,​ L. H. de Figueiredo, W. Celes, //Software: Practice & Experience//,  26 #6 (1996) 635–652}} +  * [[http://www.terrame.org/lib/exe/fetch.php?media=docs:​luaforterrame-ashortintroduction2.pdf|Lua for TerraME: A Short Introduction.]]
-  * {{http://docs.coronalabs.com/​guide/​start/​introLua/​index.html| A one-pager introduction to Lua (very good!)}} +
-  * {{http://​www.lua.org/​pil/​contents.html | The Lua book by Roberto Ierusalimschy (excellent!)}} +
-  * {{http://​www.dpi.inpe.br/​gilberto/​cursos/​cst-317-2014/​luaforterrame-version2.pdf|Lua for TerraME: A Short Introduction}}+
  
-==== TerraME ====+===== TerraME ​=====
  
-Please first install the TerraME softwareavailable at the  [[https://​github.com/​TerraME/​terrame/​releases |  TerraME github release site]]. ​+The TerraME software ​is available at the  [[https://​github.com/​TerraME/​terrame/​releases |  TerraME github release site]]. ​
  
-=== TerraME installation in Windows ===+==== TerraME installation in Windows ​====
  
-Please install TerraME in "​C:​\TerraME" ​in Windows+  - Download the EXE application to your desktop. 
 +  - Double click the EXE application. When prompted for an installation directory, please choose ​"​C:​\TerraME"​. ​
  
-=== TerraME installation in MAC OS X  ===+==== TerraME installation in MAC OS X  ​====
  
-To install ​TerraME ​on a MAC, please ​follow ​the instructions below:+  - Download the DMG application to your Destktop. 
 +  - Double click the DMG application and move the TerraME ​icon to the Applications folder. 
 +  - In MAC OS X, TerraME should be run from a Terminal. To allow for terminal execution, please ​add the following line to your "​.bash_profile":​ ''​export PATH=$PATH:/​Applications/​terrame.app/​Contents/​bin''​
  
-  - Install homebrew, a package manager for MAC. 
-  - install qt5 using homebrew (%brew install qt5) 
-  - Download terrame-1.4-mac.tgz from TerraME website 
-  - Copy terrame-14.mac.tgz to /usr/local directory (as "​sudo"​) 
-  - In /usr/local directory, run the command "sudo tar xzvf terrame-1.4-mac.tgz"​ 
-  - Include the following lines in your "​.profile"​ 
-<​code> ​   export TERRAME=/​usr/​local/​terrame 
-    export TME_PATH=$TERRAME/​bin ​ 
-    export PATH=$PATH:​$TME_PATH 
-    export LUA_PATH="​./?​.lua;​$TME_PATH/?​.lua"​ 
-    export LUA_CPATH="​$TME_PATH/?​.so"​ 
-</​code>​ 
  
-==== Zero Brane Studio: IDE for TerraME ====+===== Zero Brane Studio: IDE for TerraME ​=====
  
 We suggest that you use [[http://​studio.zerobrane.com | ZeroBraneStudio]] as your programming environment for developing TerraME programs. In Windows, please install the program to ''​C:​\ZeroBraneStudio''​. In MAC and Linux, please use the default installation path. We suggest that you use [[http://​studio.zerobrane.com | ZeroBraneStudio]] as your programming environment for developing TerraME programs. In Windows, please install the program to ''​C:​\ZeroBraneStudio''​. In MAC and Linux, please use the default installation path.
Line 48: Line 35:
 After you download ZeroBraneStudio (ZBS), please do the following steps: After you download ZeroBraneStudio (ZBS), please do the following steps:
  
-  - Configuration file: tells ZBS where to find the TerraME interpreter. Copy the [[http://​www.dpi.inpe.br/​gilberto/​terrame/​zerobrane/​user.lua | user.lua]] configuration file to the "​cfg"​ folder where you have installed ZBS. In Windows, it is usually "''​C:​\ZeroBraneStudio\cfg''"​. In the MAC, the folder is "''/​Applications/​ZeroBraneStudio.app/​Contents/​ZeroBraneStudio/​cfg''"​. In Ubuntu, it is "''/​opt/​zbstudio/​cfg''"​. 
-  - Interpreter description file: tells ZBS how to use TerraME. Copy the [[http://​www.dpi.inpe.br/​gilberto/​terrame/​zerobrane/​terrame.lua | terrame.lua]] interpreter description file to the "​interpreters"​ folder where you have installed ZBS. In Windows, this folder is "​C:​\ZeroBraneStudio\interpreters"​. In the MAC, it is "''/​Applications/​ZeroBraneStudio.app/​Contents/​ZeroBraneStudio/​interpreters''"​. In Ubuntu, it is ''/​opt/​zbstudio/​interpreters''​. 
-  - Keyword description:​ tells ZBS to highlight both Lua and TerraME keywords. Copy the [[http://​www.dpi.inpe.br/​gilberto/​terrame/​zerobrane/​lua.lua | lua.lua]] keyword description file to the "​spec"​ folder where you have installed ZeroBraneStudio. In Windows, this folder is "​C:​\ZeroBraneStudio\spec"​.In the MAC, it is "''/​Applications/​ZeroBraneStudio.app/​Contents/​ZeroBraneStudio/​spec''"​. In Ubuntu, it is ''/​opt/​zbstudio/​spec''​. 
-  - Optional: delete the other interpreters of ZeroBrane (Corona, Guideros, etc.) and leave only Lua, Lua5.2 and TerraME. 
  
 +=== Copy configuration files ===
 +
 +Copy three configuration files below to a directory within Zero Brane Studio installation directory. ​
 +
 +^**File** ​ ^**What it does** ​ ^ **Copy to**  |
 +^[[https://​raw.githubusercontent.com/​TerraME/​terrame/​master/​ide/​zerobrane/​lua.lua | lua.lua]] ​ |Tells ZBS to highlight both Lua and TerraME keywords. ​ |''​ZeroBraneStudio/​spec''​ (there is already one with this name here, overwrite it) | 
 +^[[https://​raw.githubusercontent.com/​TerraME/​terrame/​master/​ide/​zerobrane/​terrame.lua | terrame.lua]] ​ |Tells ZBS how to use TerraME. ​ |''​ZeroBraneStudio/​interpreters'' ​ |
 +^[[https://​raw.githubusercontent.com/​TerraME/​terrame/​master/​ide/​zerobrane/​user.lua | user.lua]] ​ |Tells ZBS where to find the TerraME interpreter. ​ |''​ZeroBraneStudio/​cfg''​ |
 +
 +The default installation directories for Zero Brane are:
 +
 +  - Windows: ''​C:​\ZeroBraneStudio\''​
 +  - Mac: ''/​Applications/​ZeroBraneStudio.app/​Contents/​ZeroBraneStudio/''​
 +  - Linux: ''/​opt/​zbstudio/''​
 +
 +=== Checking if it was correctly configured ===
 +
 +  - If Zero Brain is running, close it and open again.
 +  - Go to ''​File''​ menu, and click ''​New''​
 +  - In the main window (which is blank), write ''​print("​hello"​)''​
 +  - Save the file with ''​.lua''​ extension in your computer
 +  - You will see that the names ''​print''​ and ''"​hello"''​ will become colored
 +  - Go to ''​Project''​ menu, in ''​Lua Interpreter'',​ select ''​TerraME''​
 +  - Click in the green icon with two triangles pointing to the right (''​Execute the current project/​file''​)
 +  - If everything went fine, you will get the following text in the ''​Output''​ box in the bottom of Zero Brane:
 +  - <​code>​Program '​terrame'​ started in [...]
 +hello
 +Program completed in [...] seconds [...]</​code>​
 +
 +
 +===== Additional Packages for TerraME =====
 +
 +For this course, we are going to use additional packages:
 +
 +  * sysdyn - modelling system dynamic problems.
 +  * sci - scientific and statistical functions in TerraME.
 +  * ca  - cellular automata models.
 +  * logo - simple agent-based models.
 +
 +To install these packages, run TerraME, click on the button "​Install Package"​ and select the files one by one. 
software-cst-317-2015.txt · Last modified: 2016/07/05 11:25 by pedro