This main program should be recognisable to the user as FORTRAN, most of which he can interpret. The nine names which refer to routines of CCSL are:
PREFIN,
SYMOP,
SYMUNI,
RECIP and
SETGEN (all for input),
OPSYM for symmetry output and
GETGEN, MULBOX and INDFIX inside a loop generating values.
The routines
GETGEN and
MULBOX are of special interest.
GETGEN fills the
array H with the ``next" set of reflection indices , eventually
generating all reciprocal lattice vectors in
the whole of an asymmetric unit of reciprocal space. MULBOX returns the
value of the multiplicity of the reflection with indices
.
GETGEN is a FORTRAN SUBROUTINE (invoked by the word CALL), whereas MULBOX is a FORTRAN FUNCTION, in which a variable called MULBOX is set to the multiplicity. Every member of the CCSL except for a few BLOCK DATA SUBPROGRAMS is either a SUBROUTINE or a FUNCTION ; for ease of discussion we use the word ``routine" to mean ``either SUBROUTINE or FUNCTION".
GETGEN and MULBOX, then, are examples of crystallographic routines of
CCSL. There are a variety of others, such as LOGICAL FUNCTION ISPABS(H)
which determines whether in array H is or is not a space group absence,
COMPLEX FUNCTION FCALC(H) which calculates a complex Structure Factor,
and SUBROUTINE FOUR1Z which calculates one layer of a Fourier map.
INDFIX is a small utility routine of CCSL which takes the 3 numbers in the array H and ``fixes" them (converts them from REAL numbers to INTEGERS) into the integer array K. Utility routines exist for any operation which the authors have become tired of writing several times, such as matrix multiplication, finding a number in a given list, vector products, packing small integers into bigger ones, etc.
Except for OPSYM, the remaining CCSL routines in the example (PREFIN, SYMOP, RECIP, SYMUNI and SETGEN) are all involved in the input of data necessary to perform the later calculations and are examples of setting-up routines .
This leaves PREFIN. All CCSL programs which read a Crystal Data File should CALL PREFIN with the name of the program as argument at an early stage. It initialises various aspects of the system, and puts the crystal data into a form from which it can subsequently be read and interpreted as often as required.
The remainder of the main program is ordinary FORTRAN. Note that
although the Library does the work of producing values and
multiplicities, it is the main program which controls what is done with
them and how they are printed. The labelled COMMON /IOUNIT/ has to be
declared in the main program to direct the output of indices
to the logical unit LPT which has been set up in PREFIN to be a printable file.
* * * S I M P L E * * * Cambridge Crystallography Subroutine Library Mark 4.0 Job run at 15:59 on 19-AUG-92 Crystal data file SAMPLE.CRY opened Data read by PREFIN from file SAMPLE.CRY 1 card labelled C 2 cards labelled S Non-centrosymmetric space group with 12 operator(s) The group is generated by the 2 element(s) numbered: 2 7 Friedel's law NOT assumed - hkl distinct from -h-k-l General equivalent positions are: 0 0 0 + 1 x y z 2 y -x+y 1/6+z 3 -x+y -x 1/3+z 4 -x -y 1/2+z 5 -y x-y 2/3+z 6 x-y x 5/6+z 7 -y -x 1/6-z 8 -x -x+y 1/3-z 9 x-y -y -z 10 -x+y y 1/2-z 11 x x-y 5/6-z 12 y x 2/3-z Indices 13 11 10 to be used for typical reflection inside asymmetric unit Asymmetric unit has 2 plane(s): k>=0 h>=k Symmetry constraints on lattice parameters b = a alpha = 90 beta = 90 gamma = 120 Real cell 7.0711 7.0711 8.6602 90.00 90.00 120.00 Volume = 375.0001 Reciprocal cell 0.1633 0.1633 0.1155 90.00 90.00 60.00 Volume = 0.2667E-02 Real cell quadratic products: A (=a sqrd) B C D (=b c cos alpha) E F 50.00003 50.00003 74.99992 0.00000 0.00000 -25.00002 Reciprocal cell quadratic products: A*(=a* sqrd) B* C* D*(=b*c*cos alpha*) E* F* 0.02667 0.02667 0.01333 0.00000 0.00000 0.01333 Matrices for transformation of vectors to orthogonal axes Real space: 6.1237 0.0000 0.0000 -3.5355 7.0711 0.0000 0.0000 0.0000 8.6602 Reciprocal space: 0.1633 0.0816 0.0000 0.0000 0.1414 0.0000 0.0000 0.0000 0.1155 h k l Multiplicity 1 1 2 12 1 1 1 12 1 1 0 6 1 0 0 6 2 0 0 6 0 0 -1 2 1 0 -1 12 2 0 -1 12 0 0 -2 2 1 0 -2 12 2 0 -2 12 0 0 -3 2 1 0 -3 12 Number of reflections inside sphere = 108