User Tools

Site Tools


You are in Geoinformatics - Creative Commons :: Introduction to Earth System Modelling :: Software for the Course

Introduction to Earth System Modelling: Software

Software Description

The models described in this course will be developed using TerraME. TerraME is an extension of the Lua language. Please read the following introduction about TerraME, to get a sense of the language and what we are going to teach:

  • A primer on TerraME, 2016.

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:


The TerraME software is available at the TerraME github release site.

TerraME installation in Windows

  1. Download the EXE application to your desktop.
  2. Double click the EXE application. When prompted for an installation directory, please choose “C:\TerraME”.

TerraME installation in MAC OS X

  1. Download the DMG application to your Destktop.
  2. Double click the DMG application and move the TerraME icon to the Applications folder.
  3. 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/

Zero Brane Studio: IDE for TerraME

We suggest that you use 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.

After you download ZeroBraneStudio (ZBS), please do the following steps:

Copy configuration files

Copy three configuration files below to a directory within Zero Brane Studio installation directory.

File What it does Copy to
lua.lua Tells ZBS to highlight both Lua and TerraME keywords. ZeroBraneStudio/spec (there is already one with this name here, overwrite it)
terrame.lua Tells ZBS how to use TerraME. ZeroBraneStudio/interpreters
user.lua Tells ZBS where to find the TerraME interpreter. ZeroBraneStudio/cfg

The default installation directories for Zero Brane are:

  1. Windows: C:\ZeroBraneStudio\
  2. Mac: /Applications/
  3. Linux: /opt/zbstudio/

Checking if it was correctly configured

  1. If Zero Brain is running, close it and open again. In Linux, to execute TerraME properly, you must run 'zbstudio' from the command line, instead of clicking in the ZeroBrane icon. This will allow ZeroBrane to get your 'TME_PATH'.
  2. Go to File menu, and click New
  3. In the main window (which is blank), write print(“hello”)
  4. Save the file with .lua extension in your computer
  5. You will see that the names print and “hello” will become colored
  6. Go to Project menu, in Lua Interpreter, select TerraME
  7. Click in the green icon with two triangles pointing to the right (Execute the current project/file)
  8. If everything went fine, you will get the following text in the Output box in the bottom of Zero Brane:
  9. Program 'terrame' started in [...]
    Program completed in [...] seconds [...]

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