"Shock" Statement Bug: Shocks Incorrect in some Cases

The Problem

In some circumstances, Release 7.0 TABLO-generated programs or GEMSIM could produce incorrect results because the program uses the wrong shocks.

Indeed this problem is a long-standing one and could also have affected results produced with Release 6.0 of GEMPACK.

The GEMPACK developers apologise for the inconvenience and uncertainty this bug causes.

This problem could only occur if a shock is given to a subset of the components of a variable, and if the order of the elements in that subset was not the same as the order of the elements in the big set.

Example.
Suppose that REG is the set (AUS, CAN, USA, EU, ROW) and that NAMREG is the subset (USA, CAN). Note that the elements in NAMREG are not in the same order as they are in REG since CAN comes before USA in REG but not in NAMREG.

Consider the shock statement

     shock qo(ENDW_COMM, NAMREG) = select from file qo.shk ;

In this case it is highly likely that the shocks to qo will be incorrect.

When the Problem Can Occur

As indicated above, the problem can only occur if a shock is given to a subset of the components of a variable, and if the order of the elements in that subset is not the same as the order of the elements in the big set.

Then errors may be generated in two cases:

If either of these applies, it is highly likely that the shocks will have been incorrectly allocated and hence that the results will have been incorrect.

Checking Old Results

There is nothing to check unless you have a shock statement involving a subset whose elements are not in the same order as in the big set.

In such cases, you can check old results by checking (for example, in ViewSOL) that the results for the shocked variables are the same as the shocks you have given. If they are the same, there is no problem. But if they are different you know that the results are incorrect.

Simplest Remedy

The simplest remedy is to change the order of the elements in subsets so that the order agrees with that in the bigger sets, and then solve the model again. This remedy is available whatever version of GEMPACK you use (Source-code or Executable-image).

Alternative Remedy for Source-Code Release 7.0 or Release 6.0

Alternatively, if you have a Source-code version of Release 7.0 or of Release 6.0, you can incorporate the fix below to routine CMCHSH. [This remedy is not available if you have an Executable-image version of GEMPACK. This remedy may not be available to you if you are solving using a pre-prepared EXE file, such as the one under RunGTAP.]

CMCHSH Bug Fix for Release 7.0 of Source-code GEMPACK

The following fix is recommended for those

(i) working on a Windows PC, and

(ii) any version of Release 7.0 of Source-Code GEMPACK. [That is, Release 7.0 (October 2000) or Release 7.0-002 (August 2001).]

If you have a unix version of GEMPACK, please contact the GEMPACK developers to obtain a fix.

This fix should not be applied to Release 6.0 (October 1998) of GEMPACK.

To install this fix on a Windows PC, proceed as follows.

1. Download the file CMCHSH.ZIP (20K) and put it into the SUBS subdirectory of the directory in which your GEMPACK is installed (usually, C:\GP\SUBS).

2. Go to a DOS box and change into this SUBS subdirectory.

3. Issue the following commands.
unzip32 -o cmchsh.zip
zip cm cmchsh.for
replib cm
cd ..
mkgemsim

This will replace the existing CMCHSH in your GEMPACK library with the bug fix and make a new version of GEMSIM.EXE.

The fix will only work on .EXE files you make after you install the fix. In particular, you should rerun LTG on the relevant TABLO-generated programs after you install this fix.

CMCHSH Bug Fix for Release 6.0 of Source-code GEMPACK

The following fix is recommended for those

(i) working on a Windows PC, and

(ii) any version of Release 6.0 of Source-Code GEMPACK.

This fix also fixes the "ashock" statement bug in early versions of Release 6.0.

This fix should not be applied to Release 7.0 (October 2000) of GEMPACK.

To install this fix on a Windows PC, proceed as follows.

1. Download the file CMCHSH.ZIP (19K) and put it into the SUBS subdirectory of the directory in which your GEMPACK is installed (usually, C:\GP\SUBS).

2. Go to a DOS box and change into this SUBS subdirectory.

3. Issue the following commands.
unzip32 -o cmchsh.zip
zip cm cmchsh.for
replib cm
cd ..
mkgemsim

This will replace the existing CMCHSH in your GEMPACK library with the bug fix and make a new version of GEMSIM.EXE.

The fix will only work on .EXE files you make after you install the fix. In particular, you should rerun LTG on the relevant TABLO-generated programs after you install this fix.