# New Features in Release 9.0 (April 2005) of GEMPACK

Below is a brief description of some of the new features in Release 9.0 (April 2005) which were not available in Release 8.0 (October 2002) of GEMPACK.

## Post-Simulation Processing in TAB Files

The idea is that you can add statements to the TAB file to carry out calculations, create tables and write the results to text or Header Array files. The calculations you perform and tables you create can be based on

• the pre-simulation values of Coefficients,
• the post-simulation values of Coefficients, and
• the simulation results (values of the Variables - percentage changes or changes).

These three kinds of values are available and can be processed using Formulas and Write statements in the post-simulation part of the TAB file. These post-simulation Formulas and Write statements are carried out after the simulation had been completed and the results and updated data written in the usual way. In particular, you can access simulation results in this part of the TAB file as if the Variables were Coefficients. We give some examples below.

### Example 1. Table of important regional results from GTAP.

Consider the GTAP model. You may wish to build up a table showing the results for some important variables in each region. Prior to Release 9, the program SLTOHT could be used to do this - see the first example (for variables u, y and EV) in section 9.4 of the Release 8 version of GPD-4. With the Release 9 software, this table can be set up in the TAB file as follows.

```    PostSim (Begin) ;  ! The beginning of a section of post-sim code !
SET RegVar1 (u, y, EV) ;
Coefficient (All,r,REG)(All,v,RegVar1) RegResults1(r,v) ;
Formula (All,r,REG) RegResults1(r,"u") = u(r) ;
Formula (All,r,REG) RegResults1(r,"y") = y(r) ;
Formula (All,r,REG) RegResults1(r,"EV") = EV(r) ;
File (new, text, spreadsheet) PostSim1 ;
Write RegResults1 to File PostSim1 ;
PostSim (End) ;  ! Marks end of a section of post-sim processing !
```

Note the Formulas with Variables u, y and EV on the right-hand side.

### Example 2. Summaries of Updated Data.

Many models write summaries of the salient features of a database as part of the TAB file used to solve the model, or in a related TAB file. For example, in ORANIG03.TAB, such information is written to the logical file SUMMARY. ORANIG03.TAB contains statements such as:

```    Coefficient
(all,i,IND)  V1CST(i)    # Total cost of industry i #;
(all,i,IND)  V1TOT(i)    # Total industry cost plus tax #;
(all,i,IND) PTXRATE(i)   # Rate of production tax #;
Formula
(all,i,IND)  V1CST(i)    = V1PRIM(i) + V1OCT(i) + V1MAT(i);
(all,i,IND)  V1TOT(i)    = V1CST(i) + V1PTX(i);
(all,i,IND)  PTXRATE(i)  = V1PTX(i)/V1CST(i);
Write PTXRATE to file SUMMARY header "PTXR";
```

These statements calculate the production tax rates (from the pre-simulation data) and write the values to the SUMMARY file.

When you run a simulation with these models, GEMPACK produces the updated data. If you want to know the same summary facts about the updated data as you calculated about the pre-simulation data, in the past you have had to run the appropriate TAB file (for example, ORANIG03.TAB) on the updated data. Now you can easily arrange for that to happen as part of the simulation. All you have to do is to duplicate the write statements, as shown below.

```    File (New) SUMMARY_UPD
# Summary info for updated data # ;
Write (PostSim) PTXRATE to file SUMMARY_UPD header "PTXR";
```

The values of PTXRATE written will be the updated values (since those are the values in Coefficients during the processing of the post-simulation part of the TAB file).

## When Memory is Short (GEMSIM and TG-Programs)

This applies to very large models when you may not have enough physical memory on your computer to solve the model.

• Release 9 software uses less memory than Release 8 software in most cases.
• The memory sharing option available in Release 9 version of GEMSIM and TABLO-generated programs can significantly reduce the amount of memory required. The CPU time for solving the model increases by only a very small fraction when this option is used.

### Examples

• 38x39 GTAP. Release 8 requires about 460 Mb, Release 9 requires about 310 Mb and only about 220 Mb with the memory-sharing option.
• USAGE model of USA (about 500 sectors). Release 8 requires about 950 Mb, Release 9 requires about 690 Mb and only about 490 Mb with the memory-sharing option.

## Some of the Other New Features

There are many other minor enhancements and new features, including the following.

• If MMNZ values are too small, reallocation is now done "on the fly" within the MA48 routines. [With Release 8, these routines had to start the LU decomposition again from scratch.]
• You can load a subtotal result into AnalyseGE in order to analyse it.
• You can ask AnalyseGE to decompose the selected expression (rather than the whole RHS) in a Formula or Equation.
• Calculation of subtotals results in models containing Complementarity statements is more reliable and intuitive.
• There are Command file statements for controlling the iterations if you use Newton's method.

All the new features in Release 9.0 are documented in GEMPACK document GPD-5 (April 2005) which you can download. A more complete list of the new features in Release 9 is given in section 1.4 of GPD-5.