The relative advantages of the two mathematical approaches suitable for the computation of the intensity sum have been discussed by Butler [184]. To calculate the intensity a Fourier Transform of the real space coordinates is required, and this may be achieved using either a Fast Fourier Transform (FFT) technique or by direct application of the Fourier sum to each reciprocal coordinate. As the atoms do not lie on a regular grid, and the intensity data is only required in specific regions of reciprocal space, an FFT is inappropriate, and so the latter approach will be taken.
Ultimately, the optimisation of the computing time is dependent
upon the number of atoms in the model crystal, given by
(
) where
is the number of
unit cells along a particular axis and
is the number of
atoms in each unit cell, and this will be determined by the size
of the model crystal which is found to be necessary to produce
physically realistic results. The optimum size of the model crystal
is not known in advance, and the variation of (
) must
be allowed for within the simulation. This is an important point,
because it will ultimately be the factor which will decide between
the two possible programming algorithms: (i) The atomic coordinates
of the simulated crystal are generated in advance and stored in
datafiles ready for the intensity calculation, or (ii) each atomic
coordinate is regenerated, each time it is required within
the intensity
calculation. The distinguishing merits of the two approaches are
that method (i) is intensive in its use of memory, whilst method
(ii) makes greater demands upon processor time. If the number of
atomic coordinates is too large for storage in the available
memory then method (i) becomes impractical.
The decision was made to first start by applying the second method described above, which is the more straightforward of the two. This would then allow judgements as to the size of the model required, without any limits being placed upon it, and at the same time the efficiency of this algorithm could be gauged. If necessary, the alternative algorithm could be adopted at a later stage. The program was first coded in FORTRAN on a serial machine for testing, before being parallelised using CM FORTRAN. The program was run on the Connection Machine 200 at the Edinburgh Parallel Processing Centre. A listing of the program code is included for reference in Appendix A.