This page gives access to various Object Pascal routines for reading, writing, and manipulating the HAR (header array) files used by GEMPACK. You
would need access to, and familiarity with, the Borland Delphi compiler to use these. They might be useful for processing data or result files
used in the GEMPACK system.
The routines can be compiled using any of Delphi versions 3 to 6 to produce either Windows or command-line programs. They could also be used [with
tiny modifications] with the Borland Kylix compiler (for Intel-based Linux systems). They could be adapted to other flavours of Pascal. A skilled
programmer could use them to produce DLLs or OCXs which could be called by Fortran or C++ or even Excel programs.
The routines are provided as a free service, but are not "supported". You will have to figure out on your own how to use them.
The routines are used by ViewHAR and ViewSOL to process HAR files. They have been drawn from code libraries in use in December 2006. The
"official" GEMPACK routines for processing HAR files (described here) are written in Fortran and may or may not be
compatible with these routines.
After you have read the Conditions of Use below, you can download a zip archive containing more than 8000 lines of codes in the
following program libraries:
harfile.pas: Reads Header Array Files produced by GemPack Lahey Fortran Programs
mhutil.pas: utility, mainly WinAPI, routines
mystrucs.pas: core types & alloc/free routines for vectors and matrices
newdim.pas: routines for manipulating 7-dimensional 1-based arrays of singles
qsort.pas: quicksorts for integer and real vectors; binary search
txtfile.pas: family of routines for text files
In addition 4 example command line programs are included (as both DPR source and EXE):
TestSol: simpler - reads results from a SOL-style HAR file and writes them to a text file.
TestHar: more complex - reads data from a HAR, creates new arrays and creates a new HAR.
SplitHar: opposite of GEMPACK program CMBHAR.
MergeHAR: combines 2 HAR files into one.
Apart from a short file, HINTS.TXT, the 4 example programs are your ONLY guidance in how to use the library routines.
CONDITIONS OF USE
Below, "the supplier" includes Mark Horridge, the GEMPACK developers and COPS [Centre of Policy Studies];
"the code" refers to the programs and routines listed above.
The supplier accepts no responsibility for problems that may result from using the code.
The supplier does not undertake to update or fix any errors in the code.
You are totally on your own with the code. Do not ask the supplier questions about it.
You have the source: look there for the answer.
You recognize that the format of HAR files produced by GEMPACK might change
-- and that this code might not be compatible with any new format.
You will not pester the GEMPACK developers if standard GEMPACK programs refuse to read non-conformant or corrupt HAR-like files that you
produced by using or mis-using the code.
You may not use the code in commercial programs [programs that are sold] without permission from the supplier.
Download
If you agree to the conditions of use listed above, you may download the zip archive HARLIB.ZIP and unzip it
into an empty folder.
Python tools for accessing HAR files
The HARPY GitHub project provides Python routines for reading and writing HAR files.