
GEMPACK USER DOCUMENTATION Release 7.0 GPD-2 TABLO Reference TABLO Reference GEMPACK Document No. GPD-2 W. J. Harrison K. R. Pearson Centre of Policy Studies and Impact Project Monash University, Melbourne, Australia Third edition October 2000 Copyright 1985-2000. The Impact Project and KPSOFT. Third edition October 2000 ISSN 1030-2514 ISBN 0 7326 1521 6 This is part of the documentation of the GEMPACK Software System for solving large economic models, developed by the IMPACT Project, Monash University, Clayton Vic 3800, Australia. Abstract GEMPACK is a suite of general-purpose economic modelling software especially suitable for general and partial equilibrium models. It can handle a wide range of economic behaviour and also contains powerful capabilities for solving intertemporal models. GEMPACK provides software for calculating accurate solutions of an economic model, starting from an algebraic representation of the equations of the model. These equations can be written as levels equations, linearized equations or a mixture of these two. TABLO is the GEMPACK program which translates the algebraic specification of an economic model into a form which is suitable for carrying out simulations with the model. The output from TABLO can be either computer files used to run the GEMPACK program GEMSIM or alternatively, a Fortran program, referred to as a TABLO-generated program. Either GEMSIM or the TABLO- generated program can be run to carry out simulations. This document is a complete reference to the TABLO Input language and a User’s Guide to the program TABLO. It complements GEMPACK document GPD-3 Simulation Reference: GEMSIM, TABLO-generated Programs and SAGEM which is a guide to carrying out simulations on a model using GEMSIM, TABLO-generated programs or SAGEM. We assume that readers are familiar with the first GEMPACK document GPD-1 An Introduction to GEMPACK. This document GPD-2 contains • fine print about running TABLO and its Condensation stage, • a detailed description of the syntax and semantics of the TABLO language (as used in TABLO Input files specifying models), • advice about verifying that your model is actually carrying out the calculations that you intend, and • information about implementing and solving intertemporal (that is, dynamic) models using GEMPACK. Document Attributes Name : TABLO Reference Audience : CGE Modellers Identifier : GPD-2 History : Date Author(s) Comment April 1993 Jill Harrison and Ken Pearson First Edition (Release 5.0) [Title of first edition was “User’s Guide to TABLO and TABLO-generated Programs”] April 1994 Jill Harrison and Ken Pearson Second Edition (Release 5.1) [Title of second edition was “User’s Guide to TABLO, GEMSIM and TABLO-generated Programs”] October 2000 Jill Harrison and Ken Pearson Third Edition (Release 7.0) [Title of third edition is “TABLO Reference”] Table of Contents 1. INTRODUCTION 1-1 1.1 Running TABLO on an Existing Model 1-2 1.2 Adding Equations to a Model 1-2 1.3 Writing a TABLO Input File for a New Model 1-3 1.4 Modern Ways of Writing TABLO Input Files (on a PC) 1-3 1.4.1 Using TABmate 1-3 1.4.2 Using ViewHAR to Write TABLO Code for Data Manipulation 1-3 1.5 Condensing a Large Model 1-4 2. ADDITIONAL INFORMATION ABOUT RUNNING TABLO 2-5 2.1 TABLO Options 2-5 2.1.1 TABLO Input File Written on the Auxiliary Files 2-6 2.1.2 TABLO File and TABLO STI File Stored on Solution File 2-7 2.1.3 Specialised Check Options 2-7 2.1.4 Doing Condensation or Going to Code Generation 2-8 2.1.5 TABLO Code Options 2-8 2.1.6 Identifying and Correcting Syntax and Semantic Errors 2-8 2.2 TABLO Linearizes Levels Equations Automatically 2-9 2.2.1 Change or Percentage-change Associated Linear Variables 2-10 2.2.2 How Levels Statements are Converted 2-10 2.2.3 Linearizing Levels Equations 2-11 2.2.4 Linearizing a Sum 2-13 2.2.5 Algorithm Used by TABLO 2-13 2.3 More Details About Condensation and Substituting Variables 2-15 2.3.1 Looking Ahead to Substitution when Creating TABLO Input Files 2-17 2.3.2 System-initiated Formulas and Backsolves 2-18 2.3.3 Absorption 2-19 2.4 Memory Management for Fortran 77 TABLO 2-20 3. BASIC SYNTAX DESCRIPTION 3-21 3.1 SET 3-23 3.1.1 Set Unions, Intersections and Complements 3-25 3.1.2 Data-dependent Sets 3-25 3.2 SUBSET 3-26 3.3 COEFFICIENT 3-27 3.4 VARIABLE 3-28 3.5 FILE 3-30 3.6 READ 3-31 i 3.7 WRITE 3-32 3.8 FORMULA 3-34 3.9 EQUATION 3-35 3.9.1 "EQUATION(NONE);" Statement 3-35 3.9.2 FORMULA & EQUATION 3-36 3.10 UPDATE 3-37 3.11 ZERODIVIDE 3-38 3.12 DISPLAY 3-39 3.13 MAPPING 3-40 3.13.1 Formulas for Mappings, and Reading and Writing Mappings 3-40 3.14 ASSERTION 3-41 3.15 TRANSFER 3-42 3.16 Setting Default Values of Qualifiers 3-43 3.17 TABLO Statement Qualifiers - A Summary 3-44 3.17.1 Spaces and Qualifier Syntax 3-45 4. SYNTAX AND SEMANTIC DETAILS 4-47 4.1 General Notes on the TABLO Syntax and Semantics 4-47 4.1.1 TABLO Statements 4-47 4.1.2 Lines of the TABLO Input file 4-48 4.1.3 Upper and Lower Case 4-48 4.1.4 Comments 4-48 4.1.5 Strong Comment Markers 4-48 4.1.6 Reserved (special) Characters 4-48 4.2 User Defined Input 4-49 4.2.1 Names 4-49 4.2.2 Labelling Information (Text between hashes #) 4-50 4.2.3 Arguments – Indices, Set Elements, Index Offsets and Index Expressions 4-51 4.3 Quantifier lists 4-53 4.4 Expressions Used in Equations, Formulas and Updates 4-53 4.4.1 Operations Used in Expressions 4-53 4.4.2 Sums over Sets in Expressions 4-54 4.4.3 Brackets in Expressions 4-54 4.4.4 Functions 4-55 4.4.5 Conditional Quantifiers and SUMs 4-57 4.4.6 Conditional Expressions 4-58 4.4.7 Linear Variables in Expressions 4-59 4.4.8 Constants in Expressions 4-60 4.4.9 Indices in Expressions 4-60 4.4.10 Index-Expression Conditions 4-61 4.5 Coefficients and Levels Variables 4-63 4.5.1 Coefficents – What are they ? 4-63 ii 4.5.2 Model Parameters 4-63 4.5.3 Integer Coefficients in Expressions and Elsewhere 4-64 4.5.4 Where Coefficients and Levels Variables Can Occur 4-65 4.5.5 Reporting Levels Values when Carrying Out Simulations 4-68 4.5.6 How Do You See the Pre-simulation and Post-simulation Levels Values? 4-69 4.5.7 Specifying Acceptable Range of Coefficients Read or Updated 4-70 4.6 Sets 4-71 4.6.1 Set Size and Set Elements 4-71 4.6.2 Not Specifying Maximum Size of SETs 4-72 4.6.3 Set Unions and Intersections 4-72 4.6.4 Set Complements 4-73 4.6.5 Sets Whose Elements Depend on Data 4-74 4.6.6 Writing the Elements of One Set 4-74 4.6.7 Writing the Elements of All (or Many) Sets 4-75 4.6.8 Empty Sets 4-75 4.6.9 Reading Set Elements from a File 4-76 4.7 Subsets 4-78 4.8 Mappings Between Sets 4-79 4.8.1 Defining Set Mapping Values 4-80 4.8.2 Checking Values of a Mapping 4-82 4.8.3 Insisting That a Set Mapping be Onto 4-82 4.8.4 Using Set Mappings 4-83 4.8.5 Set Mappings Can Only Be Used in Index Expressions 4-83 4.8.6 Two or More Set Mappings in an Index Expression 4-83 4.8.7 Set Mappings in Arguments 4-84 4.8.8 Other Semantics for Mappings 4-84 4.8.9 Writing the Values of Set Mappings 4-85 4.8.10 Reading Part of a Set Mapping BY_ELEMENTS 4-85 4.8.11 Mapping Values Can be Given by Values of Other Mapping or Index 4-85 4.8.12 Writing a Set Mapping to a Text File 4-86 4.8.13 Writing a Set Mapping as Character Data 4-87 4.8.14 Long Name when a Set Mapping is Written to a Header Array File 4-87 4.8.15 ViewHAR and Set Mappings 4-87 4.9 Files 4-88 4.9.1 Text Files 4-88 4.10 Reads, Writes and Displays 4-90 4.10.1 How Data is Associated With Coefficients 4-90 4.10.2 Partial Reads, Writes and Displays 4-90 4.10.3 FORMULA(INITIAL)s 4-91 4.10.4 Coefficient Initialisation 4-92 4.10.5 Display Files 4-93 4.10.6 Transferring Long Names when Executing Write Statements 4-93 4.11 Updates 4-95 4.11.1 Purpose of Updates 4-95 4.11.2 Which Type of Update? 4-95 4.11.3 What If An Initial Value Is Zero ? 4-96 4.11.4 UPDATE Semantics 4-96 4.11.5 Deriving Update Statements – Example 1 (Sum of Two Flows) 4-97 4.11.6 Deriving Update Statements – Example 2 (Powers of Taxes) 4-98 4.11.7 Writing Updated Values from FORMULA(INITIAL)s 4-98 4.12 Transfer Statements 4-100 iii 4.12.1 XTRANSFER Statements on Command Files 4-101 4.13 Zerodivides 4-102 4.14 Ordering 4-104 4.14.1 Ordering of the Input Statements 4-104 4.14.2 Ordering of Variables 4-104 4.14.3 Ordering of Components of Variables 4-105 4.14.4 Ordering of the Equation Blocks 4-105 4.14.5 Ordering of the Equations Within One Equation Block 4-105 4.14.6 Ordering of Reads, Formulas, Equations and Updates 4-106 4.15 TABLO Input Files with No Equations 4-108 5.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages153 Page
-
File Size-