Contents Prev Manual

PROGRAM SFTLSQ

Least squares refinement from structure factors measured on
twinned crystals

Description:

Main program for least squares refinement of structure factors measured from twinned crystals. Extinction corrections can be included and the extinction parameters refined.
Geometric slack constraints can be included (see chaper 5 of the CCSL users manual and the documentation of program BONDS)

Input:

The crystal data file must contain all cards needed for structure factor calculations vis:
S cards giving the symmetry.
A C card with the cell dimensions.
A cards defining the atoms, their positions and isotropic. temperature factors.
F cards giving the scattering factors
R cards describing the twinning:
R TMAT followed by 9 numbers giving the twin matrices
(one for each twin component)

R TPOP followed by numbers giving the fractional population
of each twin in the order of the TMA T cards .
optionally:
T cards giving anisotropic temperature factors

Additionally:
L cards indicating which parameters should be refined
(see the CCSL users' manual)

I cards which may have the words words NCYC, CYCL1, PRIN,
MCOR and CONV.
NCYC the number of least squares cycles (default 3)
CYC1 the number to be assigned to the first cycle (default 1)
PRIN frequency at which output lists are printed
PRIN = 0 no printing
PRIN = 1 first cycle
PRIN = 2 last cycle
PRIN = 3 first and last cycles
PRIN = 4 every cycle

MCOR controls the correlations printed at tyhe end of the job
(default +70)
MCOR = 0 whole correlation matrix printed
MCOR = -ve no printing
MCOR = +ve correlations above MCOR printed

CONV convergence criterion; LSQ cycling is terminated if the
maximum shift/esd < CONV (default 0.01)

The data file which should be a list of hkl and the measured structure factors as implied by the L MODE card .

Output:

The usual listing file reporting the data which have been read. This file also contains the output listings requested by the I PRIN card as well as the R-factors and chisqrd at the end of each least squares cycle.
A new crystal data file corresponding to the structure at the end of the least squares refinement.

Running the program:

On running the program the user is asked for the name of the crystal data file and the name of the file containing the structure factor data.
The value of chisqrd at the end of each cycle is reported on the terminal.
After the last cycle user is asked for a name for the new crystal data file.

Calls:

APSHSF CALCTW CENTRE DFTWSF ERRIN2 ERRMES GEOMCO GEOMIN GEOMLS INDFLO LFCALC LSETSF MATCOR MATINV MATSET MATSHF MATTOT MESS NOPFIL NWINSF OPSYM PARRUN PARSSF PREFIN PRNCYC RELATE RFACS RREFSF SETFC STLSSF VARMAK VARSSF WGHTSF

Common blocks used:

/DEPMAT/ to use all members
/EXTN/ to use IEXTYP
/FCAL/ to use FC FCMOD
/IOUNIT/ to use LPT ITO LUNI
/NEWOLD/ to use AMAXSH
/NSYM/ to use CENTRC
/OBSCAL/ to use OBS GCALC DIFF NOBS WT
/POSNS/ to use NATOM
/PRBLEM/ to use NFAM LF1SP
/REFINE/ to use NCYC NCYC1 LASTCY ICYC IPRNT MAG CONV
/SCLDAT/ to use ISCALE SCALE
/SCRACH/ to use MESSAG
/SLAKDA/ to use NSLAK
/SLKGEO/ to use SLONLY
/TWIN/ to use NTWIN

*** SFTLSQ modernised by PJB April 2001 ***

Classification:

General Least Squares Refinement . . . . . . . Main Program

SUBROUTINE CALCTW(H,SFCALC)

Makes the calculated function and derivatives for twinned crystal
LSQ.

Arguments:

On entry H is a 3-sized array containing h,k,l
SFCALC is a subroutine name used for the actual structure factor calculation, like LFCALC

Prerequisite calls:

Structure factor data must have been set up in various COMMON blocks by SYMOP RECIP ATOPOS, SETFOR, SETANI
LSETUP, PARSSF, VARMAK must have set up the Least Squares.
STLSSF must have read the L cards :

Description:

Sets GCALC, the calculated function corresponding to an OBS just read
Applies an extinction correction if there was an E card .
Also produces the vector DERIVV (LVARV long) of derivatives of this function wrt each variable in turn.
The function GCALC is made up of three functions multiplied together.
We write G=P1*P2*P3 where P2 is a simple function of FCALC, P1 is independent of FCALC (being Scale * overall itf), and P3 is the extinction correction.(They are written in this way for ease of differentiation.)
If IREF=2, we are in fact comparing OBS squared with GCALC squared. This is dealt with right at the end, after proceeding as though we were not.
The sequence of operations is:
Get STHL= sin theta/lambda, SSQRD= STHL squared.
Clear derivatives to zero.
Form P1 and its derivatives.
Form P2: get FCALC and derivatives of mod FCALC wrt family 2 variables
Convert derivatives to be of P2, not just mod FCALC
Form P3: convert derivatives
Form GCALC and make all derivatives so that they are of GCALC
Adjust for GCALC squared or not squared if necessary

Notes:

The scale factors are used to refine the twin ratios. Not that they apply to F rather than Fsqrd. This should prevent negative domain populations

Calls:

GMPRD GMZER ISPABS LATABS TESTOV VCTMOD

Called by:

SFTLSQ

Common blocks used:

/BRAGG/ to use STHL SSQRD
/DERVAR/ to use all members
/EXTN/ to use KDOMR KMOSC EXTCOR DEXDFQ DEXDRQ DEXDGQ
/FCAL/ to use FCMOD FCDERS
/OBSCAL/ to use GCALC
/PRBLEM/ to use LVFST1 NVARF
/REFINE/ to use IREF
/SCLDAT/ to use ISCALE SCALE KSCALE
/TWIN/ to use all members

*** CALCTW updated by PJB C134 5-Nov-2004 ***

Classification:

Specific Least Squares Refinement . . . . . . . Crystallographic

LOGICAL FUNCTION DFTWSF(IFAM,IGEN,ISPC)

Called as a substitute for DEFALT out of SUBROUTINE VARMAK, giving
default fix/vary information for structure parameters.

Arguments:

On entry IFAM, IGEN, ISPC specify the parameter.

Description:

On exit DFTWSF is .TRUE. if parameter IFAM,IGEN,ISPC is by default varied
and .FALSE. if fixed.

In general varies, but fixes scattering factor, and only varies an itf if there is no corresponding atf. Only allows A*-F* to vary if there are slack constraints.
Fixes SCAL 1 and varies all TPOP by default

Calls:

DFTWSF

Called by:

SFTLSQ DFTWSF

Common blocks used:

/ANISO/ to use IAPT
/SLAKDA/ to use NSLAK

*** DFTWSF by PJB Apr 2000 ***

Classification:

Specific Least Squares Refinement . . . . . . . Setting Up


Contents Manual

P. Jane Brown e-mail: brown@ill.fr
Institut Laue Langevin,
Grenoble, FRANCE