60 Basic crystallography
most computer platforms so that the reader should have no major problems imple-
menting the routines. While there are many other, more advanced programming
languages, Fortran was selected because it is easy to use, and because it is very well
suited for the type of computations presented in this textbook.
The
website provides the source code for all Fortran routines used in this book. In
addition to individual programs, the
website also provides a number of libraries con-
taining routines that are frequently used. The following library files are available:
local.f90 This module defines parameters that are specific to the location where
the programs are executed; the parameters in this file may be customized
by the user.
io.f90 This
module contains most of the
input and output routines
used by
other routines. All user interactions occur via routines defined in this
module, so that ideally this is the only module that should have to be
modified if
the programs are implemented on a different platform.
error.f90 This module contains some simple error reporting routines.
constants
.f90
This module contains the definitions of various physical constants and
parameters used by many different programs.
math.f90 This module groups a number of basic mathematical routines, such as
matrix multiplication and inversion.
crystalvars.f90 This module defines the variable types for lattice parameter informa-
tion, direct and reciprocal metric tensors and structure matrices.
symmetryvars.f90 This module defines all variables needed to use the 3D space groups
and related group theoretical objects.
crystal.f90 This module contains all routines that are related to geometrical crystal-
lographic computations, such as dot and cross products and coordinate
transformations, and also basic routines for creating crystal data files.
symmetry.f90 This module implements the 3D space groups and related group theo-
retical objects.
files.f90 This module contains all file operations, such as opening and closing
of files, including crystal data files.
postscript.f90 Crystallographic computations generally produce graphical output,
and, unfortunately, there is no standard graphics language or library
that will work on every computer platform. For this reason graphics
output from the programs in this book is provided in PostScript format,
so that it can be printed on paper or displayed on the screen using a
PostScript viewer. PostScript is platform independent, so it should work
on UNIX, Windows, and Macintosh platforms. The file
postscript.f90
groups all routines that produce PostScript output. Additional routines
can easily be created as needed, based on the templates in this file.
tiff.f90 This module provides a simple routine to create a TIFF image file
containing a grayscale image.