Unrecognized or Unexpected Storage Method When Reading a Header Array File

When a GEMPACK Fortran program (for example, GEMSIM, a TABLO-generated program or CMPHAR) tries to read a Header Array file, you may get the error: "E-UNEXPECTED STORAGE METHOD".

Alternatively, when ViewHAR or another Windows programs tries to read a Header Array file, I get the error: "Cannot open file .. Unrecognized Storage Method".

Here we explain why this might happen and tell you what you can do if you get either of these errors.

Why this might happen

Since about October 2005, some GEMPACK programs have been able to write Header Arrays in what are called sparse storage. If a large fraction of the numbers in an array are all zero, this can reduce considerably the size of the array on the disk.

Unfortunately, GEMPACK Windows and Fortran programs written before that date (this includes the official Release 9.0 - April 2005 - programs) cannot read such files.

You can read more about this in Chapter 6 of the GPD9.PDF documentation for GEMPACK 10 which you can download here, or you can read the ViewHAR helpfile topic "Sparse disk storage for mainly-zero arrays". For GEMPACK programs released 2010 or later, the default is to write arrays in sparse form, if that saves space.

How to fix the problem

Fortunately, as we explain in detail below, you can easily convert a Header Array file which contains sparse headers to one which does not contain such headers. The data on the file is not changed at all, and old programs can read the resulting file, which solves your problem.

Recent GEMPACK can read sparse headers.

But, if the program causing your problems is a GEMPACK Fortran program (for example, GTAP.EXE under RunGTAP), converting the file as described below is probably the best way to work around the problem.

Converting the HA File to one with no Sparse Headers

Use (a recent version of) ViewHAR to open the troublesome HAR file. If, in the Contents view, you right-click on an array and choose Properties you can see if that array was stored FULL or SPSE (sparse) on the input file. Now choose File..Options and ensure that the last, use sparse disk storage option is switched OFF. Then save the file -- sparse storage method will not be used. The use sparse disk storage setting in the ViewHAR options will also apply to other GEMPACK-related utilities written in Delphi Pascal (eg, RunDynam, AnalyseGE, DiffHAR or AggHAR).

Alternative command-line method

Download the zip file SPRS2FULL.ZIP (190K) and unzip to get the program SPRS2FULL.EXE.

Then you can run the program SPRS2FULL to convert Header Array files which contain sparse headers to ones which do not contain such headers.

For example, to convert the file FILE1.HAR which contains sparse headers to a new file FILE2.HAR which does not contain sparse headers, go to a DOS box in the appropriate directory and issue the command

sprs2full file1.har file2.har 100

Go back to
GEMPACK FAQ Page