Prev Up Next
Go backward to 3.1 System Requirements
Go up to 3 Practicalities
Go forward to 3.3 Directory Structure

3.2 Getting Started

The GTAPinGAMS package is distributed in two archives, one containing executable utility programs, a second containing the directory structure and GAMS programs. The first is to be extracted either in the GAMS system directory. The second unzips into a new directory.

GAMS source code and two free aggregate datasets are provided with the distribution directory. There is no original GTAP data distributed with the GTAPinGAMS system. In order to generate large scale models with the GTAPinGAMS tools, it is necessary to obtain the GTAP 4 distribution data file GSDDAT.HAR.

The datasets included in the GTAPinGAMS distribution have been provided by the MobiDK Project at the Ministry of Business and Industry in Denmark and by the EPRI-funded analysis of the trade effects of the Kyoto agreement. The MobiDK dataset focuses on Denmark's international trade in goods and energy. It includes an investment composite, five energy goods (crude oil, refined oil, natural gas, coal and electricity), chemicals, other energy intensive goods, services and other non-energy intensive. The regions identified in this dataset include the European countries from GTAP, North America, Asia and Rest of World. This dataset should provide a good initial aggregation for analysts working on energy-environment issues in any of the GTAP EU countries (Denmark, Sweden, Germany or UK).26

The second dataset is intended to focus on competitiveness impacts of measures intended to reduce global carbon dioxide emissions. The regional aggregation for the DOE dataset is motivated by the nature of Kyoto agreement with separate representation of the US, Japan, the EU and China. Aggregate regions in the model include Other OECD, Former Soviet Union, Central European Associates, Other Asia, Mexico plus OPEC and Rest of World. Commodities in the DOE dataset include the investment aggregate, five energy goods, metals-related industry, other energy-intensive, other manufactures and services.27

Here are the steps involved in installing GTAPinGAMS under Windows 95/NT:

  1. Unpack the GTAPinGAMS Utility Programs

    These programs should be placed in the GAMS system directory. If GAMS were located in drive d:, subdirectory gams, you could enter:

     
            d:\>cd  \gams
            d:\gams>x:\utils
     
    

    where x: is the subdirectory location of your GTAPinGAMS distribution files.

  2. Create a GTAPinGAMS Subdirectory

    This subdirectory can have any name. I name the directory GTAP:

     
            d:\>mkdir gtap
            d:\>cd gtap
     
    
  3. Unpack the GTAPinGAMS Directory

    Connect to the directory you have just created and unzip the archive containing directory structure and GAMS source code:

     
            d:\gtap>unzip x:gtapgams
     
    

    NB: This statement requires that the utility program UNZIP.EXE installed in step 1 are accessible along the path.

  4. Install the GTAP4 Data (optional)

    This step is required only if you have a copy of the the GTAP4 datafile GSDSMALL.ZIP.

     
            d:\gtap>cd gtapdata
            d:\gtap\gtapdata>unzip x:gsdsmall
     
     
    
    where x: is the subdirectory location of your GTAP distribution files.
  5. Run the Build Script (optional)

    This step is required only if you have installed the GTAP4 datafile GSDSMALL.ZIP.28

    Connect to the BUILD subdirectory and execute the BUILD.BAT batch command file:

     
            d:\gtap>cd build
            d:\gtap\build>build
     
    
  6. Test the Aggregation Routine

    Connect to the BUILD subdirectory and execute the GTAPAGGR.BAT batch command file to generate a test aggregation of the sample dataset:

     
            d:\gtap>cd build
            d:\gtap\build>gtapaggr doemacro
     
    

    The GTAPAGGR command generates a dataset named DOEMACRO.ZIP from dataset DOE.ZIP. If you examine the ZIP file for this model using UNZIP, you will find that GTAPAGGR has included in the model archive the set definition file (DOEMACRO.SET), the mapping file (DOEMACRO.SET) and the dataset itself (DOEMACRO.GMS); along with set and map files for the parent dataset DOE.29

     
            d:\gtap\data>unzip -l doemacro
     
    Archive:  doemacro.zip
     
     Length    Date    Time    Name
     ------    ----    ----    ----
        576  09-03-98  10:45   doemacro.set
       2124  09-03-98  10:51   doemacro.map
        736  09-03-98  10:46   doe.set
       2780  09-03-98  15:49   doe.map
      87710  09-05-98  13:10   doemacro.gms
     ------                    -------
      93926                    5 files
     
    

    You can remove files from the model archive manually using UNZIP, or you can read these files into a GAMS program using the MRTDATA and UNZIP utilities provided in the INCLIB subdirectory.

  7. Test the Recalibration Routine

    Connect to the BUILD subdirectory and execute the IMPOSE.BAT batch command file to impose a new set of benchmark tax rates on the DOE dataset, creating a new dataset named NOTAX:

     
            d:\gtap>cd build
            d:\gtap\build>impose notax doe
     
    

    The IMPOSE command generates a dataset named NOTAX.ZIP from DOE.ZIP using information from a benchmark revision file NOTAX.DEF in the DEFINES directory. This command also copies the set definition file DOE.SET to NOTAX.SET and the mapping file DOE.MAP to NOTAX.MAP, all in the DEFINES directory.30

  8. Check Benchmark Consistency and Generate an Echoprint
     
            d:\gtap>cd build
     
            d:\gtap\build>chkdata doe
            d:\gtap\models>more <doe.ech
     
    
  9. Run Some Tests with the Core Models
     
            d:\gtap>cd models
            d:\gtap\models>gams mrttest
     
    

    The MRTTEST.GMS program runs the model in four different formulations and compares the results. This GAMS program processes four other programs, MGETEST.GMS, MCPTEST.GMS, CNSTEST.GMS, and NLPTEST.GMS each of which executes a benchmark replication check, a benchmark clean-up and a single counter-factual scenario. Output from these four programs is collected in MRT.SOL and the results are compared by MRTTEST.GMS. If your installation is correct, you should see the message:

    No difference detected in the solutions from alternative solvers.
    

    displayed on the screen.31

    These tests are conducted with the DOE dataset. If you edit file DATASET, you can chose to use a different dataset for the test.

  10. Transfer a Dataset into HAR Format

    Any dataset constructed with the GTAPinGAMS tools can be written in a format which is readable by GTAP in GEMPACK. The commands required to translate a data set are as follows:

     
            d:\gtap>cd build
            d:\gtap\build>zip2har doe
     
    

    This command generates the file DOE.HAR in the DATA subdirectory which you can send to friends in Australia.

  11. Set up the GTAPinGAMS Libinclude Routines (optional)

    This step is required only if you want to build a GTAPinGAMS model in a subdirectory which is not located immediately below your GTAPinGAMS root directory. All of the GAMS programs in BUILD and MODELS use batinclude programs in the subdirectory ../inclib. These statements are invalid if you move the files outside the GTAPinGAMS directory structure.

    In order to produce a portable image of the model, copy files from INCLIB into the INCLIB subdirectory of you GAMS system directory. This might typically be directory C:/GAMS/INCLIB, in which case you would install the libinclude files by:

     
            d:\gtap>cd inclib
            d:\gtap\inclib>copy *.* c:\gams\inclib
     
    

    After having installed the GTAPinGAMS libinclude files in the GAMS INCLIB subdirectory, you may then replace, for example,

     
            $INCLUDE ..\inclib\mrtdata DOE
     
    
    by the statement
     
            $LIBINCLUDE mrtdata DOE
     
    

    Alternatively, you can read only the SET definitions (DOE.SET) for the data using the statement:

     
            $LIBINCLUDE unzip DOE set
     
    

    I have included a sample stand-alone model which you can test once the INCLIB files have been installed. If you have the MPSGE subsystem, execute the following:

     
            d:\gtap>cd models
            d:\gtap\models>cd standalone
            d:\gtap\models\standalone>gams mrtmge
     
    
    If you do not have MPSGE, you can instead run gams mrtnlp.

October 23, 1998

Prev Up Next