SHORT REFERENCE GUIDE

*************************************************
Powder Diffraction Structure Analysis Program 
                  DDM
              Version 1.6
*************************************************


Includes Rietveld and Derivative Difference Minimization (DDM) methods
[L.A. Solovyov, J. Appl. Cryst. 37 (2004) 743-749]
        
        
        Leonid A. Solovyov
        Institute of Chemistry and Chemical Technology
        Krasnoyarsk, 660049
        Russia
        E-mail: leosol@icct.ru


12 March 2009


General information

  The program is designed for crystal structure analysis from powder diffraction 
data by making use of either Rietveld [H. Rietveld J.Appl.Cryst. (1969) 65], or 
Derivative Difference Minimization [L.A. Solovyov J.Appl.Cryst. (2004) 743] 
(DDM) method. In the DDM method the refinement is aimed not at minimizing the 
absolute difference between the experimental and calculated profiles but at 
minimizing the oscillations (or curvature) of the difference curve. The squared 
values of the difference curve derivatives are used in DDM as a measure of the 
difference curvature. The main advantage of this method is that it does not 
require the background line modeling or approximations. Eliminating the 
systematic errors caused by inadequate background definitions, DDM allows 
structure refinemet with increased stability and precision.

=============================================================================
COMMAND LINE: ddm.exe [Parameters file]
EXAMPLE: ddm.exe params.ddm
=============================================================================

I. Parameters

  Parameters are stored internally in arrays XL(I,J), GLB(I), and PAR(I,J). XL 
contains the data for the atoms. The first index runs over the atoms; the second 
over the parameters for the atom. GLB contains those parameters which apply to 
all phases such as zero-point and background. PAR contains crystalline-phase 
dependent parameters such as lattice constants, scale factor, profile shape 
parameters n and m, preferred orientation parameters, etc.  The first index runs 
over the phases. There are corresponding arrays LP, LGLB, and LPAR which map the 
parameters to the normal matrix elements. This mapping is determined by the 
user.
  Codewords are entered for each parameter. A zero codeword means that the 
parameter is not being refined.  Assume one wishes to vary the x,y,z coordinates 
of an atom and that y = x/2. If we let the codewords be given as:
                            x:  31.00
                            y:  30.50
                            z:  41.00

then x and y will be assigned to the third normal matrix parameter and z to the 
fourth. Also, 1.00 times the calculated shift in the third parameter will be 
applied to x and 0.50 times to y.  The full calculated shift in the fourth 
parameter will be applied to z. In general, the codeword is formed as:

                         sign(A)*(10P + |A|)

where P is the parameter position in the matrix and A is the factor by which the 
computed shift will be multiplied before use. P is optional; a parameter will be 
refined if A is nonzero. The shifts are also multiplied by a relaxation factor 
before being applied to the parameters.  The user may supply four different 
relaxation factors which apply to four different classes of parameters.
 If P is zero, then the parameter position in the matrix is assigned by the 
program AUTOMATICALLY. Only those parameters which need to be restrained to have 
the same position in the matrix (as x and y in the above example) should be 
numbered by P in the codewords. Holes in the sequence of numbered codewords are 
removed automatically by the program. Making a line with codewords blank (in the 
Parameters file) is equivalent to assigning them zero values.
 
 Starting from version 1.4 the manual numbering of symmetry related parameters 
is optional as the program imposes symmetry restrictions automatically.
  


II. Description of input files

A. The Parameters file

  This file contains the control variables and the structural parameters.  If 
output of a new input file is selected, the current input file will be updated 
at the end of the last cycle (see flag NXT in Line 4). A star (*) before a line 
number indicates that the line's existence depends on the value of a control 
variable. The parameters are entered in free format and should be separated by 
at least one space.
 In the mathematical expressions Q denotes the diffraction angle Theta.

Line   Par.N     Description
1.               Title - any 70 characters to be used to label the printout.    
2.               Data file name
3.       1       JOBTYP - 0 - x-ray case    
                          1 - neutron case(nuclear scattering only)    
                          2 - pattern calculation only, x-ray (does not work)
                          3 - pattern calculation only, neutron (does not work)   
         2        NPROF - profile selection    
                          0 - Gaussian            4 - [Not used]    
                          1 - Lorentzian (Cauchy) 5 - pseudo-Voigt(pV)       
                          2 - Mod 1 Lorentzian    6 - Pearson VII    
                          3 - Mod 2 Lorentzian    7 - Thompson-Cox-Hastings pV 
         3        NPHASE - number of phases (up to 8 phases can    
                           be refined simultaneously)    
         4        NBCKGD - background correction control    
                          0 - background to be refined    
                          1 - background to be read from file named 'backgr'
                              containing an array of the background intensities
                              for each profile point in free format    
                          2,3,..N - background to be determined by linear 
                            interpolation between N datapoints read from Line 9.
         5        NEXCRG - number of excluded regions read from Line 10.
         6        NSCAT  - number of extra scattering sets read from Line 11.
         7        INSTRM - data type     
                           0 - Laboratory Q-2Q X-ray data, or single detector
                               neutron data (the Data file contains only profile
                               intensities, see B. Tape 4)    
                           1 - Other types of data (the Data file contains
                               profile intensities and squared variances)    
         8        IPREF - Preferred orientation function    
                            0 - Rietveld-Toraya function    
                            1 - March-Dollase function    
                            2 - Ellipsoidal function
         9        ISZSTR - size-strain instrumental standard used (for NPROF=7)
                           If ISZSTR=1, instrumental broadening parameters
                           US ZS XS YS are read from Line 12.

4.               Output control flags (0 for off, >0 for on)
         1        IWP  =1: prf-file for WinPLOTR
                       =2: weighted prf-file for WinPLOTR
         2        IPL  =1: text-files with calculated and observed intensities
                       =2: text-files with weighted profile intensities
         3        IPC  =1: list of reflections
                       =2: list of |F|obs, |F|calc & R-F
         4        MAT  =1: correlation matrix
         5        NXT  =1: Parameters file is updated after the last cycle
         6        LST1 =1: number of last refinement cycles to output
         7        LST2 =1: not used
         8        LST3 =1: not used
         9        LSYM =1: symmetry operators output to CIF file

Line   Par.N     Description

5.       1        Lamda(1) - Wavelength1
         2        Lamda(2) - Wavelength2
         3        RATIO - Alpha2/Alpha1 intensity ratio
         4        BKPOS - Origin of polynomial for background (in °2Q)
         5        WDT -  range of calculated profile in units of FWHM
                        (beyond this the calc. profile is set to zero)
         6        CTHM - monochromator coefficient in polarization correction
                          [1 + CTHM*(cos2Q)^2]/[sin2Q sinQ]
         7        TMR -  convolution interval for R-Bragg calculation and
                         profile decomposition in units of FWHM
         8        RLIM - peaks below this angle (2Q) are corrected for asymmetry
                         by the split-FWHM approach; the left side of a peak is
                         given an additional broadening:
                         FWHM_left  = FWHM_right + 2P1*EXP(-2Q*0.084) + P2tanQ
                         where P1, P2 are the asymmetry parameters (Line 13.81)
         9        SAMPLE - angle (2Q) below which the intensities are corrected
                           for the effect of the primary beam falling beyond the
                           sample edges (Bragg-Brentano geometry only)
                           An empirical correction is applied:
                             Icor=I/(1+(.0128+.0106*(SAMPLE-2Q))*(SAMPLE-2Q))
        10        BKCURV - number of average FWHM values used for estimating the
                           output background curve (affects output only)

6.       1       MCYCLE - number of refinement cycles (starting from 0)
         2       EPS  -  run terminates when all shifts are < EPS*standard
                         deviation
                 RELAX - group relaxation factors for shifts
         3          (1) - coordinates & isotropic temperature factors
         4          (2) - anisotropic temperature parameters
         5          (3) - profile width, asymmetry, overall temperature,
                          and preferred orientation parameters
         6          (4) - lattice parameters, 2Q-zero, overall
                            scale factor, and site occupancies

 7.      1       NDEC - number of cycles for profile decomposition run
                        (either DDM or Le Bail methods depending on CDDM)
                        If NDEC > 0, then the structure model is ignored
                        and the squared structure factors F^2 are read from
                        the file named 'ffobs' which is overwritten with the
                        refined F^2s after the final run cycle.
                        If 'ffobs' file is absent, a set of equal F^2 is
                        applied at the first decomposition cycle.
                        If both MCYCLE and NDEC > 0, then the refinement of
                        the profile parameters is run first (with F^2s from
                        'ffobs' file) followed by NDEC decomposition cycles
         2       MAXS - refined parameters control flag
                        MAXS = 0 denotes refinement of all parameters with
                                 nonzero codewords
                        MAXS = -1 removes all refinement codewords
         3       WDDM - DDM convolution interval selection threshold
                      If WDDM>0, the counting statistics is used
                      If WDDM<0, the Durbin-Watson statistics is used
                      If WDDM=0, all convolution intervals are equal to CDDM
         4       CDDM - maximal DDM convolution interval in degrees 2Q 
                      If CDDM=0, Rietveld refinement is performed instead of DDM
         5       IWGHT - weighting scheme flag
                         for DDM IWGHT = 0, 1, 2
                         for Rietveld IWGHT = 0, 1




Line   Par.N     Description
 8.         Global parameters
 8.1     1       ZER     - zeropoint for 2Q (in degrees)
         2       DISP    - sample displacement 2Q correction parameter
         3       SHASM  - asymmetry-related peak shift correction parameter
         4       ABSORP1,
         5       ABSORP2 - absorption correction coeffs. for flat sample:
                              Icor=I*[1 + ABSORP1*exp(-ABSORP2/sinQ)]
                    ABSORP1 = -1 holds for the finite sample thickness effect
           		     ABSORP1 > 0 holds for the surface roughness effect
         6       ABSORP3 - absorption correction coeff. for cylindrical sample:
                              Icor = I*exp[-(1.7133 - 0.0368*sin^2Q)* ABSORP3 +
                                      + (0.0927 + 0.375*sin^2Q)*ABSORP3^2]
 8.2             Codewords for ZER, DISP, SHASM, ABSORP
 8.3             BACK  - background coefficients (six values)
 8.4             FBACK - codewords for background coefficients

*9.             If NBCKGD >= 2, then there are NBCKGD lines
                POS - position in degrees 2Q
                BCK - background counts at this position

*10.            If NEXCRG > 0, then there are NEXCRG lines
                ALOW - low angle bound of excluded region
                AHIGH - high angle bound of excluded region
                NOTE: A reflection will be excluded if any part of 
                          its calculated tail falls in this range.

*11.            If NSCAT > 0, then there are NSCAT sets of lines for extra
                scatterers not included in the incorporated table of scattering
                factor coefficients
*11.1           NAM - symbol identifying this set
                DFP -    f'
                DFPP -   f''
                XMAS - Molecular mass
*11.2           Either one line of the form
                A1 B1 A2 B2 A3 B3 A4 B4 C,
                the coefficients for the analytic approximation to f,
                or a set of lines of the form Posi - Scat, where
                              Posi = sinQ/lambda and Scat = f
                The set is terminated by a line with -100 in the first position.
                If the first form is desired, A2 can not = 0

*12.            If ISZSTR = 1, then there are instrumental broadening parameters
                US, ZS, XS, YS for size-strain calculations (only for NPROF=7).
                They are subtracted from the FWHM terms defined in Line 13.6 

13.        Phase parameters:  NPHASE sets of lines (see Line 3)
13.1             PHSNM - name of phase (maximum 70 characters)
13.2     1       NATOM - number of atoms
         2       IFUR  - Fourier output flag
                         If IFUR=1, F-factors are written to ddm_cif.cif
                         If IFUR=2, F-squared are written to ddm_cif.cif
         3       NDPAR - codeword number of the parameter responsible for
                         structural defects (pseudoposition occupancy parameter,
                         for instance) in the selective anisotropic broadening
                         model [Solovyov (2000) J.Appl.Cryst. 338]
         4       PREF(3) - preferred orientation direction h k l
         5       SAQF  - Brindley particle absorption contrast factor for QPA

13.3             SYMB - space group symbol, e.g. P-1, P63/m, P21/n, P 1 1 2/b,
                        I41/acd, Pmmn, Pmmn S, R-3c, R-3c R, HALL -P 3* 2N, ...
                 ending R means RHOMBOHEDRAL setting, S means ORIGIN CHOICE 1
                 By default (if S is omitted) the ORIGIN CHOICE 2 with the
                 inversion centre at (0,0,0) is selected
Line             Description
******************************* NATOM line sets ********************************
13.4      4 lines for each of the N atoms
13.41            LABEL - identification characters for atom (4 characters)
                 NTYP  - link to scattering data for atom: either name from 11.1
                         or chemical symbol and valence to access the
                         incorporated list of f-coefficients taken from the
                         International Tables.
                 x,y,z - fractional atomic coordinates
                 B     - isotropic temperature parameter
                 N     - occupation number (number of atoms in the unit cell)
        NOTE: if N = -1, the occupation number will be calculated by the program
                 IANIS - isotropic (0) or anisotropic (1) temp. factor flag
                 ADIST - maximal interatomic distance for this atom to output
13.42            CX,CY,CZ - codewords for the fractional atomic coordinates
                 CB       - codeword for the isotropic temperature parameter
                 CN       - codeword for the occupation number
       Lines 13.43 and 13.44 are entered only if IANIS = 1
*13.43            Beta11, Beta22, Beta33, Beta12, Beta13, Beta23 
                          anisotropic temperature parameters
*13.44            CB11, CB22, CB33, CB12, CB13, CB23 
                           codewords for anisotropic temperature parameters
********************************************************************************
13.5
13.51             SF   - scale factor
                         If SF = 0 it will be estimated by the program
                  BQ   - overall isotropic temperature factor
13.52             CSF  - codeword for scalefactor
                  CBQ  - codeword for overall isotropic temperature factor
13.6
13.61             U,V,W,Z,X,Y - FWHM ("H") parameters
                              For NPROF = 0...6
                               H^2 = U*tan^2Q + V*tanQ + W + Z/cos^2Q
                              X & Y are used only when NPROF = 7, where
                               HGauss = [U*tan^2Q + V*tanQ + W + Z/cos^2Q]^0.5
                               HLorentz = X*tanQ + Y/cosQ
13.62             CU,CV,CW,CZ,UX,UY - codewords for the FWHM parameters
13.7
13.71             A,B,C, -  cell dimensions in Angstroms
                  Alpha, Beta, Gamma - cell angles in degrees
                  LAUE - reflection generation flag
                   When LAUE = 1, the set of reflections is generated as for
                   Laue class -1 disregarding the actual lattice symmetry. This
                   option is required when the preferred orientation or
                   anisotropic broadening directions are inconsistent with the
                   crystal symmetry.
13.72             CA,CB,CC,CALPHA,CBETA,CGAMMA - codewords for the
                       cell constants
13.8
13.81            G1, G2, P1, P2 where P1, P2 are the asymmetry parameters
                           and G1, G2 are the preferred orientation
                           parameters used in the formulae:

                        if IPREF=0, Icorr = Iobs[G2 + (1-G2)exp(-G1*A^2)]
                        if IPREF=1, Icorr = Iobs[(G1cosA)^2 + (sinA)^2/G1]^-1.5

                        where A is the acute angle between the scattering vector
                        and the preferred orientation direction in reciprocal
                        space (see PREF in Line 13.2).
                        With IPREF=0, setting G1 to any number > 99.0 for a
                        phase causes the program to generate for that phase only
                        those reflections for which d* is parallel to the
                        preferred orientation vector PREF specified in Line 13.2
13.82            CG1, CG2, CP1, CP2 - codewords for G1, G2, P1, P2                 
Line             Description

13.9                 Profile Shape parameters
13.91            NA, NB, NC
                       For the usual pseudo-Voigt (NPROF=5) the Shape parameter
                                        n = NA + NB*2Q
                       For the Pearson VII (NPROF=6) the Shape parameter
                                    m = NA + NB/2Q + NC/(2Q)^2
                       For all other profiles listed (1 - 3, 7), NA, NB, NC, and
                       their codewords must all be set to zero.
13.92            codewords for  NA, NB, NC

13.10            FWHMmin, FWHMmax - lower and higher FWHM limits for the FWHM
                                    estimation procedure (undocumented)
			IAN3 - anisotropic strain model flag
                       = 1 or -1 indicates 2nd rank anisotropy tensor:
                          Aniso2 = (STR1*h^2 + STR2*k^2 + STR3*l^2 + STR4*2hk +
                                   + STR5*2hl + STR6*2kl)*0.001*d^2
                       = 2 or -2 indicates 4th rank anisotropy tensor:
                          Aniso2 = [STR1*h^4 + STR2*k^4 + STR3*l^4 + 
                          + 3(STR4*h^2k^2 + STR5*h^2l^2 + STR6*k^2l^2) +
                          + 2(STR7*kh^3 + STR8*hl^3 + STR9*lk^3 +
                          + STR10*hk^3 + STR11*lh^3 + STR12*kl^3) +
                       + 4(STR13*klh^2 + STR14*hlk^2 + STR15*khl^2)]*0.00001*d^4
                       For NPROF < 7, H(a)^2 = H^2 + Aniso2*tan^2Q
                       For NPROF = 7 only:
                        if IAN3 > 0, HLorentz(a) = HLorentz + Aniso2^(1/2)*tanQ
                        if IAN3 < 0, HGauss(a) = HGauss + Aniso2*tanQ^2
13.11
13.111           EPR(6) - six preferred orientation coefficients for the
                          Ellipsoidal IPREF = 2) function:
                          Icorr = Iobs[1 + (EPR1*h^2 + EPR2*k^2 + EPR3*l^2 +
                              + EPR4*2hk + EPR5*2hl + EPR6*2kl)*0.001d^2]^-1.5
                          NOTE: When EPR coefficients are refined without
                             restrains, the scale-factor SF should be fixed.
13.112           CEPR(6) - codewords for EPR

13.113           SIZ(6) - six anisotropic size broadening coefficients 
                          The anisotropic broadening term is calculated as:
                          Aniso1 = (SIZ1*h^2 + SIZ2*k^2 + SIZ3*l^2 + SIZ4*2hk +
                                   + SIZ5*2hl + SIZ6*2kl)*0.001*d^2
                       For NPROF < 7, H(a)^2 = H^2 + Aniso1/cos^2Q
                       For NPROF = 7, HLorentz(a) = HLorentz + Aniso1^(1/2)/cosQ
13.114           CSIZ(6) - codewords for SIZ

13.115           STR(1-6) - anisotropic strain broadening coefficients 
13.116           CSTR(1-6) - codewords for STR
       Lines 13.117 - 13.120 are entered if IAN3 = 2
*13.117          STR(7-12) - anisotropic strain broadening coefficients 
*13.118          CSTR(7-12) - codewords for STR
*13.119          STR(13-15) - anisotropic strain broadening coefficients 
*13.120          CSTR(13-15) - codewords for STR



B. The Data file

 This file contains the data from the diffractometer. The first line contains
the variables START, STEP, STOP and DATAID in free format:
  START  - beginning angle in degrees 2Q
  STEP   - step size in degrees 2Q
  STOP   - last angle in degrees 2Q
  DATAID - alphanumeric string identifier

The rest of the file consists of the data themselves in free format. Depending 
on the INSTRM parameter (Line 3) for each data-point either the profile 
intensity alone or both the intensity and its squared variance should be given.
                       
NOTE: The START angle assigned here must correspond to that of the first datum. 
The STOP angle can be any angle less than that of the last datum in the file. 
Any desired angular range can be selected for the refinement by (i) declaring an 
excluded region (NEXCRG in Line 3 and bounds in Line 10) from the START angle to 
the desired beginning and (ii) assigning the desired ending angle to STOP.

C. Optional files 'ddm_bckgr', 'ddm_ffobs', and 'ddm_fwobs'

  These files, if used, should be placed to the same folder from which the 
program was run.
  From the file named 'ddm_bckgr' the background profile intensities are read in 
free format when NBCKGD=1 option is used.
  The file 'ddm_ffobs' contains estimated observed squared structure factors 
after the last refinement (or decomposition) run. It is rewritten automatically 
by the program. It can be created and/or edited manually if the structure 
factors need to be entered at the initial step of the profile decomposition 
procedure (see NDEC description in Line 7).
  The file 'ddm_fwobs' is optional. It may contain fixed FWHM values for 
selected reflections. Five parameters should be specified for each selected 
reflection: h, k, l, FWHM, Nphase
where hkl are the indexes and Nphase is the number of phase to which the 
reflection belongs. The file format is free.
EXAMPLE:
  1   0   0   0.149  1
  1   3  -1   0.209  1
  1   0   1   0.242  2
......................
If 'ddm_fwobs' file exists in the folder from which the program was run the FWHM 
values for the selected reflections are read from it and fixed (not refined). 
This option may be useful in difficult cases of anisotropic peak broadening when 
it can not be satisfactorily modeled.

III. Description of output files

File 'ddm_out.txt' contains detailed output listing

File 'ddm_prf.prf' contains the observed and calculated patterns, which can be 
viewed by the popular program WinPLOTR. WinPLOTR is freely downloadable from:
  http://www-llb.cea.fr/fullweb/winplotr/winplotr.htm

File 'ddm_prf.txt' is a text file with the observed, calculated, difference, and 
background profile intensities and the DDM convolution interval widths (in 
degrees 2Q).

File 'ddm_ref.txt' contains positions and integral intensities of reflections.

File 'ddm_cif.cif' is the Crystallographic Information File, which can be read 
by many programs for crystal structure visualization and analysis.
