\documentstyle[a4,12pt]{article}
\pagestyle{plain}
\textwidth 15cm
\topmargin -2.0cm
\oddsidemargin 0.5cm
\textheight 24cm
\pagenumbering{arabic}
\raggedbottom

\begin{document}
\parindent 0cm
\parskip 6pt

\vspace*{6.0cm}

\begin{center}
{\Large \bf PROFIL Version 5.17}

\vspace{0.5cm}
27$^{th}$ November 1994

\vspace{0.5cm}

{\large Jeremy Karl Cockcroft}
\vspace{0.5cm}

{\large \em Department of Crystallography, Birkbeck College,\\
Malet Street, London WC1E 7HX, United Kingdom.}
\vspace{1.0cm}

{\small Manual printed on \today}
\end{center}

\newpage

{\bf Historical Note}

{\tt PROFIL} is an entirely new Rietveld program. Many other versions of
the Rietveld program are simply modifications to earlier versions of the
original code. This version, written in a simple subset of the Fortran-77
language, is not based on any of the earlier codes.
The original version (1.0) was scratch written in order to
refine parameters not available in the then current Rietveld programs. The
early algorithms closely followed the traditional Rietveld approach of
a data preparation ({\tt PREPRO}) followed by a
data refinement ({\tt PROFIL}) stage.

Subsequent developments reduced the data preparation stage to zero calculation
leaving the calculation of the peak positions and widths to the main refinement
program. With the introduction of multiphase refinement in version 4.0,
important modifications to the basic algorithms were made. In particular, the
principle of dynamic peak-width allocation was introduced which allows intense
or broad peaks with d-spacings at higher 2$\theta$ angles to be calculated ahead
of those weaker peaks at lower 2$\theta$.

With the introduction of this version, several important changes have been
made. The most important change has been the revision of the code to
produce a machine independent version. Currently, the program works on
computers running either the VMS or Unix operating systems.
As a result, the keyworded input, first introduced in version 3.0,
has been extended.
In addition, the introduction of refinable parameters has been easier with
the automatic generation of refinement codewords. Further, the program now
allows for the simultaneous refinement of both X-ray and neutron radiation data
sets. The suite of programs based around {\tt PROFIL} 5.0 now use a new
standard format for the powder data files.

Another changes include further
checks concerning symmetry and the option of LeBail style pattern
decomposition. The earlier version already deduced the space group
and its number from the symmetry operators (irrespective of setting). This
version also checks that the codewords for the atomic coordinates and
anistropic temperature factors are compatible with the site symmetry
of the atoms. (Also, it does not rely on the atom being placed on the first
special positions listed in the International Tables since the method used is
deductive.) This should result in fewer singular matrices due to incorrect
codewords.

{\bf Introduction}

This manual is divided into four parts: The first part contains
general information on the suite of programs available.
The second part
contains a description of the parameter file used by {\tt PROFIL}.
The third part outlines how to set up the files and carry out a Rietveld
refinement. The fourth part contains technical information concerning
{\tt PROFIL}. The final part contains information on how to use {\tt PROFIL}
for pattern decomposition.

The {\tt PROFIL} suite of programs comprises the following programs
and are available for computers operating under VMS or Unix.

\hangindent 1.5cm
Data conversion programs:\\
{\tt SUMSPF} Converts ILL D1A/D2B data to {\tt .SPF} files.\\
{\tt PDSSPF} Converts Daresbury PDS data to {\tt .SPF} files.\\
{\tt RAWSPF} Converts Siemens D500 data to {\tt .SPF} files.\\
{\tt F1BSPF} Converts ILL D1B data to {\tt .SPF} files.\\
{\tt OUTFIT} Converts {\tt PROFIL.OUT} files to {\tt .FIT} files.\\
{\tt SPFSUM} Converts {\tt .SPF} files to ILL D1A/D2B data files.\\
{\tt FITOUT} Converts {\tt .FIT} files to {\tt PROFIL.OUT} files.

\hangindent 1.5cm
Data manipulation programs:\\
{\tt DIRSPF} Lists the header block of multidata set {\tt .SPF} files.\\
{\tt EDISPF} Cuts large multidata set into smaller multidata set.\\
{\tt SPFADD} Adds multiple data set together to give single data set.

\hangindent 1.5cm
Data plotting programs:\\
{\tt PLOT86} Interactive $XY$ plotting program (N.B. by Andy Murray).\\
{\tt XYPLOT} Produces PostScript plots of {\tt .SPF}, {\tt .PRE},
             and {\tt .FIT} files.\\
{\tt XYZPLT} Produces 3-D pictures from multidata set files.

\hangindent 1.5cm
Data preparation and fitting programs:\\
{\tt PREPAR} Prepares {\tt .PRE} files from {\tt .SPF} files.\\
{\tt PREPRO} Generates binary data file.\\
{\tt PROFIL} Main Rietveld program.

\hangindent 1.5cm
Other useful programs:\\
{\tt REFCEL} Refines wavelength or unit cell parameters.\\
{\tt DRAGON} Generates {\em h~k~l} from space group and cell parameters.\\
{\tt BONDLA} Standalone program to calculate bond lengths and angles.\\
{\tt JACKAL} Ball \$ stick / Space filling structure plotting program.

The general use of the programs is outlined below. The four latter programs have
their own manuals and their use is only mentioned briefly in this one.
Many of the programs are simple interactive programs with little need for
documentation other than that described below.

{\bf Data conversion programs}

\hangindent 1.5cm
{\tt SUMSPF}, {\tt PDSSPF}, {\tt RAWSPF}, and {\tt F1BSPF}\\
These programs convert diffractometer data from various sources to the
standard powder format ({\tt .SPF}) adopted by the {\tt PROFIL}
suite of programs. {\tt OUTFIT} converts the old style observed and calculated
data files {\tt .OUT} to the new format files.
An example of the format of the {\tt .SPF}
files is as follows:

{\footnotesize \tt \begin{verbatim}
CFCl3 ground in liquid N2 and run in 16mm vanadium sample can
       1       1       1
    3020       1    5.0000  155.9500    0.0500  2.990000  0.000000
     500.0      10.0     20:59:58 20-JUN-89  23266  23302 NEUTRON      D1A
     1.500     1.520     1.570     0.000     0.000     0.000     0.000     0.000
   5.000     24     26     27     28     32     35     40     48     53     61
           1.26   1.32   1.34   1.37   1.46   1.53   1.63   1.79   1.88   2.02
   5.500     70     77     88     97    103    115    124    134    144    147
           2.16   2.27   2.42   2.54   2.62   2.77   2.88   2.99   3.10   3.13
   6.000    156    158    170    180    181    188    195    198    207    209
           3.22   3.25   3.37   3.46   3.47   3.54   3.61   3.63   3.71   3.73
   6.500    213    215    219    223    228    234    230    232    232    226
           3.77   3.79   3.82   3.86   3.90   3.95   3.92   3.93   3.93   3.88
   .......
\end{verbatim}}

The first line contains the title (A80). The second line contains the total
number of data sets in the file, the format version (currently 1),
and the individual data set number (3I8).

The third line contains
contains the number of data points in the powder pattern, the data file type,
the $2\theta$ angles of the first and last points and the step size in degrees,
followed by the nominal wavelength(s), $\lambda_{(1)}$ (and $\lambda_2$)
(2I8, 3F10.4, 2F10.6). The data file
type has the value 1, 2, or 3 to indicate that the file is observed data only
({\tt .SPF} file),
observed and calculated data from {\tt PROFIL} ({\tt .FIT} file),
or Rietveld input data ({\tt .PRE file}), respectively.

The fourth line of the data file contains a monitor count value, a time count
value, the time and date of the data set (or when the file was created), run
identification numbers, data type, and instrument
(2F10.1, 5X, A8, 1X, A9, 2I7, 1X, A12, 1X, A6).
The data type {\em must} be one of {\tt NEUTRON}, {\tt SYNCHROTRON}, or {\tt
XRAY}. This information is used by the program {\tt PROFIL}.
The fifth line has 10 values and typically contains
additional information on the sample such as temperature and position
(e.g. $\chi$, $\omega$) values (8F10.3).

The input data files for Rietveld ({\tt .PRE} files)
contain extra lines before the powder diffraction data.
Firstly, they contain the background as an array of ({\em x,y}) points,
(2$\theta$, intensity) in order of ascending $2\theta$ value. The data is input
one point per line (F8.3, I8) and the list is terminated with a
negative 2$\theta$ value, e.g. -1.0 0.

There may be certain regions of the data that the user wishes to exclude from
the refinement process. These follow the background information
in the form of lower and upper 2$\theta$ values to indicate
the range to be excluded. The list must terminate with a negative angle.
Finally, the {\tt .PRE} files may contain an {\em h~k~l} input list (usually
generated from the program {\tt DRAGON}), the first line of which is the number
of reflections in the list (I8). Normally reflections are generated internally
by {\tt PROFIL} and this value will be zero.

The next lines contain the data. Each line starts
with the 2$\theta$ angle of the first data point on the line, followed by the
values of the next 10 data points in intervals determined by the step size of
the data set (F8.3,10I7).
Each data file contains a second line containing either the error
on each data point ({\tt .SPF} and {\tt .PRE} files) (8X, 10F7.2)
or the calculated value of
the data point ({\tt .FIT} files) (8X, 10I7), again with 10 values per line.

Following the powder diffraction data, the data files may also contain output
reflection and excluded region information, in a similar format to that used
by the {\tt .PRE} files as input values.

Multidata set files are simply single data sets appended together,
each starting with a title
and with the data set number systematically incremented throughout the
whole data file.

\parindent 0cm

{\bf Data plotting programs}

\hangindent 1.5cm
{\tt PLOT86}, {\tt XYPLOT}, {\tt XYZPLT}\\
These programs are for plotting the observed (and calculated) data. {\tt PLOT86}
is an older program that is used for interactive plotting on Tektronix
compatible terminals. It has the option of a cursor allowing values to be picked
directly off the screen and stored in a file. This program is mainly used to
obtain the background of the data by graphical methods and to monitor the fit by
the Rietveld method. {\tt XYPLOT}, by contrast, is non-interactive and
is written to produce high-quality $XY$ plots for publication purposes.
It outputs
standard PostScript files that can be sent to most laser printers.

\parindent 1.5cm
\hangindent 1.5cm
{\tt XYPLOT} has been rewritten to work with the new standard format
files used by the {\tt PROFIL} suite of programs. {\tt PLOT86} currently
reads the old files format only. Until it is revised, two data conversion
programs, {\tt SPFSUM} and {\tt FITOUT},  are available that
convert the {\tt .SPF} and {\tt .FIT} files to {\tt .SUM} and {\tt .OUT} files,
respectively.

\parindent 0cm

{\bf Data preparation and fitting programs}

\hangindent 1.5cm
{\tt PREPAR}\\
This program is used to create the Rietveld input data file from the
{\tt .SPF} files and background data point files. The default file extension
of the latter is {\tt .BGR}. the program requests the number of data sets
to be fitted simultaneously (usually only 1), the data file name(s), and the
background file name(s). The range of data to be fitted is specified
interactively, as are any regions that are to be excluded from the fitting
process.

\hangindent 1.5cm
{\tt PREPRO}\\
This program reads in the data file (with default extension {\tt .PRE}) and
generates the binary data file {\tt PROFIL.BIN} used by the
Rietveld program {\tt PROFIL}. The data file is normally
created with the program {\tt PREPAR} since most of
the powder diffraction data is fixed format. PostScript plot files
may be generated of the {\tt *.PRE} files using the program {\tt XYPLOT}.
The program basically performs syntax checks only the crystallographic data.

\hangindent 1.5cm
{\tt PROFIL}\\
This is the main Rietveld program. It uses two files for input, namely, the
binary data file {\tt PROFIL.BIN} and the crystal refinement file.
The default file name for the latter is {\tt PROFIL.PAR}, but the default
file extension is {\tt .PRO}, e.g. the file name {\tt SF6} will be
interpreted as {\tt SF6.PRO}. Output file generation is requested via the
parameters specified in the crystal refinement file. The format of the file
is described later.

{\bf Other useful programs}

{\tt REFCEL}, {\tt DRAGON}, {\tt BONDLA}, and {\tt JACKAL}\\
These programs supplement the {\tt PROFIL} suite of programs and are
standalone programs with their own manuals. Before fitting a powder diffraction
pattern, it is often useful to be able to refine the lattice parameters from the
peak positions alone. This can be performed with the program {\tt REFCEL}. It is
also useful to check the positions of the peaks against those calculated
from known unit cell values (and space group). The program DRAGON generated
lists of {\em h~k~l} values for this purpose. The main Rietveld program can
calculate bond lengths and angles at the end of each refinment, but is often
useful to be able to calculate these values from coordinate values directly.
This is done using the program {\tt BONDLA}. Finally, having fitted the
structure to the data, one needs a picture showing the arrangement of atoms or
molecules within the unit cell. {\tt JACKAL} is a non-interactive program that
generates PostScript files of the crystal structure that are suitable for
publication. The plot files are usually displayed
first on workstations using PostScript
previewers in order to obtain the best orientation, shading, light angles etc.

{\bf Contents of the {\tt PROFIL.PAR} files}

The files are free format within each line and case independent. Each line
starts with a keyword and lines must be in the order given below. Variables
are usually delimited by spaces, though commas and tabs may be used.
Lines starting with the keyword {\tt TEXT} are treated as comments lines.
Variables are treated as either strings (A) or as integer/real
numbers (I/F). The format type is indicated after each keyword. Reals with
integer values may have the decimal point omitted, but integers are only
accepted without it.

\parindent 0cm

\hangindent 1.5cm
{\large \tt TITLE} (A)\\
This keyword is followed by a text string of up to 74 characters and is used to
identify the parameter file.

\hangindent 1.5cm
{\large \tt VERS} (F I)\\
This keyword indicates the version of the refinement program and the number
of refinements used. The values are {\em output} by {\tt PROFIL}. Initial values
can be set to zero or left blank.

\hangindent 1.5cm
{\large \tt NPHASE} (I)\\
This keyword specifies the number of phases (originally called patterns)
that are to be fitted to the data.

\hangindent 1.5cm
{\large \tt WGHT} (nF)\\
This keyword allows the weights of different data sets to be varied. It has
the value 1.0 for fits to single data set. For fits to multidata sets,
the values of all the weights of the $y_i$ points
within the $n^{th}$ data set
are multiplied by the $n^{th}$ specified value.
If the value is zero, then the data set is ignored.

\parskip 0pt

\hangindent 1.5cm
{\large \tt OUTP} (n(A I))\\
This keyword and its sub keywords and values indicate which output files
are to be generated: The line may be left blank in which case
{\tt LIS 1 PAR 1}
is assumed for a normal Rietveld refinement.
Since a maximum of 10 sub keywords per line is allowed,
the keyword {\tt OUTP} may be repeated and
further sub keywords given on a second line.

\parindent 2.5cm

\hangindent 4.1cm
{\tt LIS} $n$ : If $n = 1$ then the lineprinter listing {\tt PROFIL.LIS}
is generated
(and in more detail if $n = -1$). By default, $n$ is set to 1.

\hangindent 4.1cm
{\tt PAR} $n$ : If $n = 1$ then a new parameter file
{\tt PROFIL.PAR } is generated at the end of the
refinement (even if {\tt NCYC 0} {\em v.i.}). If the input parameter file
is {\tt PROFIL.PAR}, then it will be renamed {\tt PROFIL.V}$nn$
where $nn$ is a double digit
integer number chosen sequentially.

\hangindent 4.1cm
{\tt FIT} $n$ : If $n = 1$ then the program generates the data file
{\tt PROFIL.FIT}
that can be used to plot the observed,
calculated, and difference powder diffraction patterns. The data file also
contains information on the peak positions of each phase and excluded regions of
the data. For the case of multidata set refinements, the file will contain
all the information for each data set. The file has a standard format
and may be converted to the old format using the program {\tt FITOUT}
({\em v.s.}).

\hangindent 4.1cm
{\tt HKL} $n$ : If $n > 0$ then the data file
{\tt PROFIL.HKL} of {\em h~k~l} and F$_{hkl}$ that can
be used for Fourier studies is generated.
The integer $n$ specifies that values for the
$n^{th}$ phase are to be output. Note that the structure factors refer to those
used to fit the first data set only. If this is a neutron-radiation data set,
then neutron-diffraction structure factors will be output.
The file is keyworded starting with the title ({\tt TITLE}),
followed by cell parameter information ({\tt CELL}),
symmetry information ({\tt LATT} and {\tt SYMM} {\em v.i.}),
and then the structure factors ({\tt HKLF}). The latter lines consist of
{\em h~k~l}, F$_{hkl}$(calc), $\phi_{hkl}$ (in rad.), and F$_{hkl}$(obs).
Reflections incompletely calculated or totally excluded are indicated by
a $\star$.

\hangindent 4.1cm
{\tt INT} $n$ : If $n > 0$ then the program generates the data file
{\tt PROFIL.INT} for the
$n^{th}$ data set containing {\em h~k~l} and I$_{hkl}$ for all phases.
Reflections incompletely calculated or totally excluded are indicated by
a $\star$ and comment.

\hangindent 4.1cm
{\tt COR} $n$ : If $n = 1$ then the data file {\tt PROFIL.COR} is
generated containing the full normalized variance-covariance matrix. All values
are multiplied by 100\%.

\hangindent 4.1cm
{\tt TAB} $n$ : If $n = 1$ then the program generates a table of refined
parameters with esd values in () in a form suitable for publication. The table
will contain information on each phase for multiphase refinements.
For LeBail pattern decomposition, $n = 0$.

\hangindent 4.1cm
{\tt XYZ} $n$ : If $n > 0$ then the data file
{\tt PROFIL.XYZ} is generated
containing the coordinates and symmetry information of the
$n^{th}$ phase in a format suitable for the plotting program {\tt JACKAL}.
For LeBail pattern decomposition, $n = 0$.

\hangindent 4.1cm
{\tt ATM} $n$ : If $n > 0$ then the program generates the data file
{\tt PROFIL.ATM}
containing the coordinates of {\em all} of the atoms in the unit cell
of the $n^{th}$ phase.
For LeBail pattern decomposition, $n = 0$.

\hangindent 4.1cm
{\tt BON} $n$ : If $n > 0$ then the keyworded data file
{\tt PROFIL.BON} is generated which may
be used as input to the bond length and angle calculation program {\tt BONDLA}.
For LeBail pattern decomposition, $n = 0$.

\hangindent 4.1cm
{\tt REF} $n$ : For normal Rietveld refinement, $n = 0$. For Lebail pattern
decomposition set $n = 1$ to obtain a file containing {\em h~k~l} and
I$_{hkl}$ that may be used for further cycles of refinement.

\hangindent 4.1cm
{\tt INS} $n$ : If $n = 1$ then the keyworded data file {\tt PROFIL.INS}
in {\tt SHELX} format is produced. This is useful for direct method solutions
using the {\tt SHELX} program {\tt XS}.

\hangindent 4.1cm
{\tt RES} $n$ : If $n > 0$ then the keyworded data file {\tt PROFIL.RES}
in {\tt SHELX} format is produced. This is useful for plotting with
the {\tt SHELX} program {\tt XP}, e.g. for ellipsoid plots. It may also be
used as an input file to the Cerius program by Molecular Simulations.
For LeBail pattern decomposition, $n = 0$.

\parindent 0cm
\parskip 6pt

\hangindent 1.5cm
{\large \tt SHFT} (4F)\\
This keyword is followed by 4 real numbers that can be used to damp the
refinement process. The 4 reals (which must be in the range $0 \le x \le 1$)
are set normally to 1.0. They refer to atomic coordinate parameters,
atomic thermal parameters, linear parameters (e.g. scale factor,
site occupation numbers), and non-linear parameters (e.g. cell parameters,
wavelength).

\hangindent 1.5cm
{\large \tt NCYC} (I)\\
This keyword and value specifies the number of cycles of refinement
which must be in the range $0 \le n \le 99$. It is recommended to set
{\tt NCYC}$ = 0$ each time a new parameter file is created by hand using an
editor as this allows syntax checks to be performed. In addition, the user can
check that the contents of the lineprinter file are correct.

The next few lines starting with {\tt WAVE} and ending with {\tt SCAT} or
{\tt ANOM} must be
repeated as a group for each data set that is being fitted.

\hangindent 1.5cm
{\large \tt WAVE} (F A [F])\\
This keyword is followed by a value specifying the wavelength of the radiation
that was used to collect the data. It is followed by the sub keyword {\tt FIX}
or {\tt VARY} to indicate whether the wavelength is a fixed or refinable
parameter. If {\tt VARY} is specified, then it may be followed by an optional
codeword indicating parameter number and multiplier ({\em v.i.\ }
{\bf Codewords}).

\hangindent 1.5cm
{\large \tt ZERO} (F A [F])\\
This keyword and value specifies the zero-point error in the 2$\theta$ scale of
the diffractometer.
Its value is followed by the
sub keyword {\tt FIX}
or {\tt VARY} to indicate whether the 2$\theta$ zero-point error is a
fixed or refinable
parameter. If {\tt VARY} is specified, then it may be followed by an optional
codeword.

\hangindent 1.5cm
{\large \tt ABSC} (3F)\\
This keyword has 3 arguments. The first specifies the absorption coefficient
$\mu r$ used to correct the absorption of a {\em cylindrical} sample. The
second specifies the diameter (2$r$) of the sample and is used only to calculate
a theoretical value of the absorption coefficient (N.B.\ The second
values is currently unused). The third value specifies the absorption
coefficient, $\mu d$, when a thin film is used to cover a flate plate sample.
(Only one of the corrections may be used with any one data set.)

\hangindent 1.5cm
{\large \tt SCAT} (A F)\\
The line containing this keyword should be repeated for each chemical element
in the sample. The first sub keyword is the chemical element symbol
e.g.\ Pb for
lead. If the value that follows is left unspecified, then the program
substitutes {\em either} the value of the neutron scattering length {\em b} for
neutron radiation data {\em or} the value of {\em Z} for X-ray radiation data.
In addition, and for the latter case only, the program automatically supplies
an X-ray form factor and anomalous dispersion terms $f'$ and $f''$ set to zero.
If {\em Z} is non-zero, then the additional lines starting with the keywords
{\tt FORM} and {\tt ANOM} must be given.

\hangindent 1.5cm
{\large \tt FORM} (2F)\\
This keyword applies only to X-ray data and when the value of {\em Z} in
{\tt SCAT} is non-zero. For each value of {\tt SCAT}, 5 lines beginning
{\tt FORM} must be specified where the values a(i), b(i) on each line
are used to specify the form factor according to the equation
$f(0) = \sum a_i \exp\{b_i (\sin\theta/\lambda)^2\}$.

\hangindent 1.5cm
{\large \tt ANOM} (2F A [2F])\\
This keyword applies only to X-ray data and when the value of {\em Z} in
{\tt SCAT} is non-zero. After the X-ray form factor specified by {\tt FORM},
a single line is required to specify the anomalous dispersion terms
$f'$ and $f''$.
Their values are followed by the
sub keyword {\tt FIX}
or {\tt VARY} to indicate whether the dispersion terms are
fixed or refinable
parameters. If {\tt VARY} is specified, then 2 optional
codewords may follow. (N.B. Currently only the {\tt FIX} option is available).

The next lines starting with {\tt LATT} and ending with {\tt PEAK}
(if single phase) or
{\tt BOND} should be given as a group for each diffracting phase in the sample.

Space group symmetry information should be given either using
{\tt SPGP} or {\tt LATT} combined with {\tt SYMM}.
(Non-standard settings are encouraged where appropriate but should be
specified using {\tt LATT} and {\tt SYMM} information.)

\hangindent 1.5cm
{\large \tt SPGP} (A [A])\\
This keyword specifies the space group as given in the International
Tables for Crystallography. An optional keyword value
is the symmetry of the origin. (N.B. This keyword is currently unavailable until
complete tests have been performed.) Internally, the program converts the
information into {\tt LATT} and {\tt SYMM} type values.

\hangindent 1.5cm
{\large \tt LATT} (2A)\\
This keyword has 2 string values giving (a) the centrosymmetricity of
the {\em origin}
(not the space group) as either {\tt C} (centric) or {\tt A} (acentric)
and (b) the Bravais lattice centring as one of {\tt P} (primitive),
{\tt A} (A-face centred),
{\tt B} (B-face centred),
{\tt C} (C-face centred),
{\tt F} (all-face centred),
{\tt I} (body centred), or
{\tt R} (rhombohedral obverse centring with hexagonal axes).

\hangindent 1.5cm
{\large \tt SYMM} (A , A , A)\\
This keyword is given for each line of symmetry operators. The symmetry
operator should be given in the form printed in the International Tables
for Crystallography with the translational part of the operator in fractional
form (e.g. 0.5 is written as {\tt 1/2}). All the translational parts must be an
integer multiple of $\frac{1}{24}$.
Note that it is {\em not} necessary to give {\em all} the symmetry operators
of the space group.
The program only requires sufficient operators that when multiplied together
generate the complete space group.
{\em x},~{\em y},~{\em z} may be omitted. Ones containing lattice
centrings are converted into {\tt LATT} information.

\hangindent 1.5cm
{\large \tt CELL} (6F)\\
This keyword specifies the values of the lattice parameters {\em a},
{\em b}, and {\em c} in {\AA}ngstroms and $\alpha$, $\beta$, and $\gamma$ in
degrees.

Following the cell information, the contents of the asymmetric unit of the
crystallographic cell are specified.
This consists of lines starting with the keywords
{\tt ATOM}, then optionally {\tt TLS} and {\tt SHELL}. Anisotropic atoms
may have the one of the optional keywords {\tt BETA}, {\tt BIJ}, or {\tt UIJ}
following the keyword {\tt ATOM}.

{\large \tt ATOM} (A 5F A)

\parskip 0pt

\parindent 1.5cm

\hangindent 3.0cm
Atom label:\\
The first sub keyword specifies an atom label.
The atom label {\em must} follow
certain conventions. It must start with the chemical symbol of the
scattering element followed optionally by one or two digits. If a single digit
is used, then a letter may be used in addition e.g. Na(2A). The use of brackets
around the digit(s) (and letter) are optional and are added automatically by the
program if omitted. The program must be able to match the chemical element
to one of those specified in the list of scatterers.
When the list of scatterers
differs between two data sets (commonly H and D), the program will
attempt to match the symbol to that used for the first data set only.

\hangindent 3.0cm
{\em x y z}:\\
The next 3 values specify the fractional {\em x},~{\em y},~{\em z}
coordinates of the atom. The program will adjust the values, if necessary, so
that they lie within the range $-0.5 \le x \le 1.5$,
$-0.5 \le y \le 1.5$, and $-0.5 \le z \le 1.5$.

\hangindent 3.0cm
{\em B}(iso):\\
The next value gives the isotropic temperature factor, {\em B},
which is used in the form $\exp\{-B (\sin\theta/\lambda)^2\}$.
When specified the
final sub keyword of the line should be left blank or set to one of {\tt ISO}
or {\tt I->A} ({\em v.i.}).

\hangindent 3.0cm
{\em N}:\\
This next value specifies
the number of atoms of that type within the unit cell. In order to obtain
site occupation factors it is necessary to divide each value by $N_{xyz}$, the
number of positions in the unit cell corresponding to the general position
{\em x,~y,~z}. {\em N}, rather than {\em s.o.f},
should be used so that the correct sample density is calculated.

\hangindent 3.0cm
B(type):\\
The final sub keyword of the line is used to
specify whether an atom is
to be treated as isotropic ({\tt ISO}) or anisotropic ({\tt ANISO}).
If {\tt ANISO} is given, then {\em B}(iso) is forced to be zero and a further
line must follow starting with one of the keywords
{\tt BETA}, {\tt BIJ}, or {\tt UIJ} ({\em v.i.}).
It may also be used to indicate whether an isotropic value
is to be converted to anisotropic ({\tt I->A}) or vice-versa ({\tt A->I}).

\parskip 6pt
\parindent 0cm

\hangindent 1.5cm
{\large \tt BETA} (6F)\\
This line specifies the anisotropic temperature factor in the form given by
\[\exp\{-(\beta_{11}h^2+\beta_{22}k^2+\beta_{33}l^2+2\beta_{23}kl+
2\beta_{31}lh+2\beta_{12}hk)\}.\]
The order of the terms $\beta_{ij}$ follows the order in the above equation.
This is the form used internally by the Rietveld program but for publication
purposes either $B_{ij}$ or $U_{ij}$ are recommended. All forms are listed in
the lineprinter file but $B_{ij}$ only is used for the output files
{\tt PROFIL.PAR} and {\tt PROFIL.TAB}.

\hangindent 1.5cm
{\large \tt BIJ} (6F)\\
This line specifies the anisotropic temperature factor in the form given by
\[\exp\{-(B_{11}h^2a^{\star^2}+B_{22}k^2b^{\star^2}+B_{33}l^2c^{\star^2}+\]
\[2B_{23}klb^{\star}c^{\star}+2B_{31}lhc^{\star}a^{\star}+
2B_{12}hka^{\star}b^{\star})/4\}.\]
The order of the terms $B_{ij}$ follows the order in the above equation.

\hangindent 1.5cm
{\large \tt UIJ} (6F)\\
This line specifies the anisotropic temperature factor in the form given by
\[\exp\{-2\pi^2(U_{11}h^2a^{\star^2}+U_{22}k^2b^{\star^2}+
U_{33}l^2c^{\star^2}+\]
\[2U_{23}klb^{\star}c^{\star}+2U_{31}lhc^{\star}a^{\star}
+2U_{12}hka^{\star}b^{\star})\}.\]
The order of the terms $U_{ij}$ follows the order in the above equation.

\hangindent 1.5cm
{\large \tt TLS} ()\\
{\em Optional} keyword.
For further information, please consult the author.

\hangindent 1.5cm
{\large \tt SHELL} (A 6F or A 2I F)\\
{\em Optional} keyword.
This keyword allows atoms that are dynamically disordered on the surface of a
sphere to be described in terms of symmetry-adapted spherical harmonic
functions. For further information, please consult the author.

The next pair of lines ({\tt INST} and {\tt PEAK}) should be repeated
as a group for each data set that is being fitted simultaneously.

\hangindent 1.5cm
{\large \tt INST} (4F)\\
This keyword has 4 real values starting with the scale factor and then the
3 resolution (or peak width) parameters {\em U}, {\em V}, and {\em W}.
The full-width at half height (FWHH) of the peaks is given by the formula
\[Fw^2=U\tan^2\theta+V\tan\theta+W.\]

\hangindent 1.5cm
{\large \tt PEAK} (A 2F)\\
This keyword is followed by a sub keyword that describes the peak-shape
function to be used in the refinement. Peak shape functions currently available
are {\tt GAUSS} (Gaussian) and {\tt PVOIGT} (pseudo-Voigt).
Following the sub keyword, the first real number is the value of the asymmetry
parameter that is used when fitting neutron diffraction data to
account for the low-angle peak asymmetry. For the pseudo-Voigt peak-shape
function, the correction term applies only to the Gaussian part of the peak
shape. The second real number applies only to the pseudo-Voigt peak-shape
function and is the value of $\eta$ as given by
\[pV(x,w) = (1- \eta )G(x,w) + \eta L(x,w)\]

When a data file is initially created for a single phase refinement, {\tt PEAK}
can be the last line of the file. The program will then generate the
remainder of the file automatically in the output file {\tt PROFIL.PAR}. It is
easier for the user to edit the new output file than to create the rest of the
file by hand.

{\bf Codewords}

The first group of lines that follow start with one of the keywords {\tt FIX}
or {\tt VARY} followed by a sub keyword indicating the parameter type.
The keyword {\tt FIX} indicate that all the parameters are fixed and all the
codewords corresponding to those parameters are set to zero.
If the keyword {\tt VARY} is specified, then some or all of the parameters
within the group specified by the sub keyword may be refined. If no codewords,
are given then they are generated automatically starting with parameter
number 1000.

A codeword, Cw, consists of two parts: A parameter number, Np,
and a shift multiplier, Sm. The latter normally takes the value of 1.0,
but may take other values when certain parameters are tied together.
For example, refinement of the coordinates
of an atom on the special position {\em x},~{\em 2x},~{\em z} requires
that the $y$ coordinate shifts twice as much as the $x$ coordinate
during the refinement. The parameters are always renumbered starting at 1.
The codeword is a composite number given by
\[{\rm Cw} = {\rm Np} * 10 + {\rm Sm}.\]
If the shift multiplier is negative, then the absolute value of it is added to
10$\times$ the parameter number and the whole codeword is then made negative.

\hangindent 1.5cm
{\large \tt VARY CELL} (6F)\\
These keywords are followed by 6 optional reals for the cell codewords.

\hangindent 1.5cm
{\large \tt VARY Atom-Label XYZBN} (5F)\\
For each line starting with the keyword {\tt ATOM}, there must be an equivalent
line starting with {\tt FIX} or {\tt VARY} followed by the atom name.
This may be followed by one of the keywords {\tt XYZ}, {\tt XYZB}, {\tt XYZBN},
{\tt B}, {\tt N}, {\tt BN}, or {\tt XYZN} to vary xyz, xyz \& B(iso), etc..\
The first option
allows refinement of the atom coordinates only and leaves the site
occupation number and isotropic temperature factor (if used) fixed.
The third option allows all the
parameters on the {\tt ATOM} line to be refined, and so on.
Codewords are generated automnatically for each parameter type unless given
explicitly.
The program will apply symmetry constraints to atoms on special
positions automatically.

\hangindent 1.5cm
{\large \tt VARY BIJ} (6F)\\
This optional line should follow each of the lines above for any atom with an
anisotropic temperature factor. There are 6 optional codewords for each of the
$B_{ij}$ values. The program will apply symmetry constraints to the values
automatically. This line must be present for all atoms where either
$\beta_{ij}$, $B_{ij}$, or $U_{ij}$ are input, even if there is an instruction
to convert from an anisotropic to isotropic temperature factor
({\tt A->I} {\em v.s.}). Conversely, it should be absent if there is an
instruction to convert from an isotropic to an anisotropic temperature factor
({\tt I->A} {\em v.s.}). In the latter case, 6 codewords will be generated
automatically if the codeword for {\em B}(iso) is non-zero.

\hangindent 1.5cm
{\large \tt VARY TLS} ()\\
{\em Optional} keyword.
For further information, please consult the author.

\hangindent 1.5cm
{\large \tt VARY Atom-Label XYZR} (6F)\\
These optional lines are for shell refinement. See note above on {\tt SHELL}.

The next lines with sub keywords {\tt SCALE} to {\tt PEAK} should be
specified as a group for each data set that is being
fitted simultaneously.

\hangindent 1.5cm
{\large \tt VARY SCALE} (F)\\
This keyword is followed by an optional codeword for refinement of the scale
factor.

\hangindent 1.5cm
{\large \tt VARY UVW} (3F)\\
This keyword is followed by optional codewords for refinement of the
peak width parameters U V W. It is frequently desired to vary only 1 or 2
of the UVW parameters. Under these circumstances, include only those
required in the keyword, e.g. {\tt VARY VW} to refine V and W only.

\hangindent 1.5cm
{\large \tt VARY PEAK} (2F)\\
This keyword is followed by optional codewords for refinement of the
peak asymmetry parameter and the Gaussian-Lorentzian ratio $\eta$ when
a pseudo-Voigt peak-shape function is used. Note that the codeword for
peak asymmetry is only generated automatically for neutron data sets.

Following the codeword lines, additional optional information may be supplied.
For example, restraints (or ``slack constraints'') are given using the
keyword {\tt CHEM}.

\hangindent 1.5cm
{\large \tt CHEM} (A 2F or A [I 3F])\\
For each chemical restraint, a group of lines starting
with the keyword {\tt CHEM} is required. The first line has a sub keyword
giving the restraint type which must be one of {\tt DIST}, {\tt ANGLE}, or
{\tt SAME} for distance, angle, or same distance restraints respectively.
These are followed by two values giving the magnitude of the restraint
(which is zero for the difference between two distances) and the error.
Since the error is used to weight the restraint, its value must be non-zero.
The smaller its value, the bigger the weight of the observation.

\parindent 1.5cm

\hangindent 1.5cm
The number of lines that follow depend on the restraint type and is 2, 3, and 4
for distance, angle, and same distance, respectively. Each of the subsequent
lines specifies an atom label. Since the atom in the list given by {\tt ATOM}
may have different coordinates to that required for the restraint, then optional
symmetry information may be specified on the line. This comprises an integer
which is the number of the symmetry operator (as given in the lineprinter
listing) and a fractional translational $x$, $y$, $z$. If the structure is
centrsymmetric and an inversion of the coordinates is needed, then the symmetry
operator number is set negative. Note that the effect of inversion on the
symmetry operator $\frac{1}{2}-x, \frac{1}{4}+y, \bar{z}$ results in
$\frac{1}{2}+x, \frac{3}{4}-y, z$.

\hangindent 1.5cm
For three atoms given in an angle restraint, the angle refers to that subtended
by the second atom with respect to the first and third in the list. In order to
restrain two distances to be the same, then the observation is the the
difference between them is zero. This allows the magnitude of the distance to
refine whilst keeping both distances similar. One distance is between the first
and second and the other is the third and fourth atoms in the list.

\parindent 0cm

\hangindent 1.5cm
{\large \tt BFAC} (A 2F or A [I 3F])\\
(Restraints on the temperature factors for rigid bonds has not yet
been reincorporated in version 1.0)

\hangindent 1.5cm
{\large \tt OCCN} (A 2F or A [I 3F])\\
(Restraints for site occupation numbers have not yet been introduced.)

\hangindent 1.5cm
{\large \tt BOND} (3F)\\
This keyword is followed by 3 values to specify the limits for bond length
and angle calculations. The first 2 values specify a minimum and
maximum distance in which bond lengths and angles will be calculated.
The last value is used to specify a maximum contact distance below which
only distance values are calculated.

An example of a typical parameter file created with a text editor is shown
below.

{\footnotesize \tt \begin{verbatim}
TITLE D2S phase III run on D1A
VERS
NPAT 1
WGHT
OUTP
SHFT 1 1 1 1
NCYC 0
WAVE  1.9106
ZERO -0.2
ABSC 0
SCAT S
SCAT D
LATT C P
SYMM  -x,-y,1/2+z
SYMM  x,1/2-y,-z
SYMM  -x,1/2+y,1/2-z
CELL 4.076 13.380 6.721
ATOM S1 -0.042  0.144   0.25  0.3  4
ATOM S2  0.460  0.401   0.25  0.3  4
ATOM D1  0.172  0.216   0.25  1.0  4
ATOM D2  0.193  0.073   0.25  1.0  4
ATOM D3  0.672  0.379   0.105 1.0  8
INST   1.0 0.2 -0.5 0.5
PEAK
\end{verbatim}}

After running through {\tt PROFIL} with zero cycles, the new parameter file
has the appearance as shown below.

{\footnotesize \tt \begin{verbatim}
TITLE D2S phase III run on D1A
VERS     5.00       0
NPAT     1
WGHT    1.000
OUTP   LIS 1 PAR 1 FIT 0 HKL 0 INT 0 COR 0 TAB 0 XYZ 0 ATM 0 BON 0 REF 0
SHFT    1.000   1.000   1.000   1.000
NCYC     0
TEXT Parameters for data set number 1 (Wav., 2th. zero, abs., & b/f values)
WAVE  1.9106001   FIX
ZERO   -0.20000   FIX
ABSC      0.000       0.0       0.000
SCAT S         2.847000     Neutron b value
SCAT D         6.674000     Neutron b value
TEXT Diffracting material (or phase) 1
TEXT Space group  57 : Pbcm
LATT      C     P
SYMM         x,                  y,                  z
SYMM        -x,                 -y,                1/2+z
SYMM         x,                1/2-y,               -z
SYMM        -x,                1/2+y,              1/2-z
CELL    4.076000  13.380001   6.721000    90.0000    90.0000    90.0000
ATOM S(1)    -0.042000  0.144000  0.250000    0.3000    4.00000  ISO
ATOM S(2)     0.460000  0.401000  0.250000    0.3000    4.00000  ISO
ATOM D(1)     0.172000  0.216000  0.250000    1.0000    4.00000  ISO
ATOM D(2)     0.193000  0.073000  0.250000    1.0000    4.00000  ISO
ATOM D(3)     0.672000  0.379000  0.105000    1.0000    8.00000  ISO
TEXT Instrumental parameters for material (or phase) 1 in data set 1
INST   0.1000000E+01    0.200000   -0.500000    0.500000
PEAK GAUSS      0.000000
TEXT R-factors:     Rwp =724.5%     Rexp =  5.9%     RI =737.4%
TEXT Refinement codewords for diffracting material (or phase) 1
FIX  CELL
FIX  S(1)   XYZ
FIX  S(2)   XYZ
FIX  D(1)   XYZ
FIX  D(2)   XYZ
FIX  D(3)   XYZ
FIX  SCALE
FIX  UVW
FIX  PEAK
BOND     0.0100    2.0000    3.5000
\end{verbatim}}

Although the output is ``fixed'' format, there is no need to keep it this whilst
editing it since the input file is read as free format. The program adds some
text comments to help break the file into sections. This is particularly useful
for large parameter files, especially when fitting either multidata set of
multiphase data.

{\bf Setting up the files for Rietveld refinement}

It must emphasised that the purpose of the Rietveld method is to refine
structures and not to solve them. Hence before commencing a refinement, it is
essential to have some knowledge of the unit cell, space group, and
its contents, i.e. a structural model. The instrumental parameters are usually
known approximately from studies of simple materials such as Ni or Si that are
frequently used for instrument calibration.

\newcounter{steps}
\begin{list}%
{\em Step \arabic{steps}.}{\usecounter{steps}
\setlength{\labelsep}{0.5cm}
\settowidth{\labelwidth}{\em Step 9.}
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\labelsep}}

\item
Some Rietveld programs use polynomial functions to fit the background scattering
associated with every powder diffraction pattern. {\tt PROFIL} requires that the
background is estimated graphically as a series of points that are connected
by straight lines. Intermediate points are obtained by linear interpolation.
This step is readily carried out using the program {\tt PLOT86} with the cursor
and the command {\tt B}. {\tt PLOT86} generates a file called {\tt BACK.DAT}
containing the background points. However, the file {\em must} be edited since
the 2$\theta$ values are still given in the old units of
$\frac{1}{100}^{\circ}$, but it is a simple edit to convert these values to
degrees.

\item
Generate the Rietveld data ({\tt .PRE}) file. This can be done automatically
using the program {\tt PREPAR}. If the data file is not in the required format,
first convert it to the standard format that is now used ({\em v.s.}).
{\tt PREPAR} also requires a file containing the background information. The
file is free format with 2 values per line (2$\theta$, intensity). A warning
message will be given if the program detects that the 2$\theta$ values are in
the old $\frac{1}{100}^{\circ}$ units. The 2$\theta$ values must be given in
ascending order.

\item
Generate a binary data file from the {\tt .PRE} file using the program {\tt
PREPRO}. This program performs a few syntax checks on the data file but does no
calculations on the data.

\item
Create, using a text editor, a file containing the crystallographic model
as described in the previous section, i.e. starting with {\tt TITLE} and
ending with {\tt PEAK}. Set the number of cycles of refinement to zero
and run the program {\tt PROFIL} using this parameter file.
Assuming that the option {\tt OUTP PAR 1} has been specified, the program will
create a new parameter file with all the refinable parameters set to {\tt FIX}.
Edit the new parameter file, e.g. change {\tt FIX SCALE} to {\tt VARY SCALE},
reset the number of cycles of refinement to 3, and rerun the program. If the
refinement does not converge in the given number of cycles, simply rerun
without editing the new parameter file until convergence occurs.

\item
Check the results by typing (or printing) the lineprinter file {\tt PROFIL.LIS}.
Check that bond lengths and angles listed in the lineprinter file make sense.
Regularly observe the progress of the fit in terms of the calculated data
by using the output option {\tt OUTP FIT 1}. The file can be plotted
using the programs {\tt FITOUT} (to convert the data file) and {\tt PLOT86}.
This is better check than simply looking at the $R$-factors.

\item
Once the structure has been refined successfully, it may be plotted using the
program {\tt JACKAL}. Also tables of the parameters with e.s.d.s  are listed in
file {\tt PROFIL.TAB}. Automatic tables of bond lengths, etc. are not yet
available.

\end{list}

{\bf Technical information on the program} {\tt PROFIL}

The program follows the basic procedure as outlined in the original paper by
H.~M. Rietveld ({\em J. Appl. Cryst.} (1969) {\bf 2}, 65--71) and only a brief
r\'esum\'e is given here.



(To be finished)

The thin-film absorption correction for flate plate sample geometry is
given by the simple geometric expression:
\[A_{hkl} = \exp ( - 2 \mu d / \sin \theta) . \]
Since the correction is applied to the model, calculated intensities are
multiplied by this factor.

$R$-factors.



{\bf Pattern decomposition} {\tt PROFIL}

A method of whole pattern decomposition was first described by G.~S.~Pawley
in 1981. More recently, an alternative alorithm based on the Rietveld
method of obtaining I(obs) has been suggested by LeBail. It is this latter
method that has been implemented in this version of {\tt PROFIL}.





\end{document}
