UTILITY
SUBROUTINES
D. F. DETAR Department of Chemistry, Florida State University, Tallahassee, FL 32306,U.S.A. SORTING
We have made extensive use of FRS3 (Rochkind, 1972) which is a version of the fast Shell sorting algorithm (Shell, 1959). For sorting jobs there are so many variations (sorting on single array, sorting on subarrays, skip subscripting for sorting on multidimensional arrays, direct sort or pointer sort and so on) that we have coded several specific versions rather than attempting to devise some inefficient general version. The advantage of the Shell algorithm is that it is simple to code and is respectably efficient. PACKING AND UNPACKING
We have made extensive use of PACK, PACKI, UNPACK and UNPCKI (DeTar. 1972). These are FORTRAN-coded subroutines which use a very simple assembly-language shifting routine, MSHIFT. Conversion from one computer to another has proved quite simple. This involves coding a suitable version of MSHIm and changing a few machine-dependent constants. PACK1 and UNPCKI set the format and are usually called just once. In practice we find that FORTRANversions of these routines run fast enough. In just one
case did we get an improvement by coding a special unpacking routine in assembly language. CONVERSIONROUTINES
We call attention to three converting routines IBCDBN (from coded character to binary integer), GBCDBN (from coded character to binary real), and BNJBCD (binary integer to coded character). These are FORTRAN-coded routines which make use of MSHIFT, the assembly-language shifting routine described above DeTar (1972). These various utility operations can often be coded in special variants of FORTRAN, using, for example, the CDC ENCODE and DECODE options. The FORTRAN versions are reasonably portable, while special codings are less so. RJWERENCW
DeTar, D. F. (1972), in Computer Programs for Chemistry, DeTar, D. F. ed., New York, Academic Press, Vol. 4, p. 255. Rochkind, M. M. (1972), FRS3, in Computer Programs for Chemistry, DeTar, D. F., ed., New York, Academic Press, Vol. 4, p. 59. Shell D. C. (1959),Commun. AMC 2,30.
135