Contents Prev Manual

LOGICAL FUNCTION SAID(INCHAR,WANT)

Decides whether the character variables INCHAR and WANT are the
same, ignoring any distinction between upper and lower case.

Arguments:

On entry INCHAR is an character variable to test
WANT is the character variable to match

Description:

Sets SAID .TRUE. if INCHAR and WANT are equal, ignoring the case if they are letters.

Calls:

LETTER

Called by:

NOPFIL RDWORD GENREF GRAFIC

*** SAID modified by PJB July 95 ***

Classification:

Tests . . . . . . . Utility

SUBROUTINE SATFND(H,HS,NR)

Finds the indices HS of the satellite equivalent to H, offset by
the propagation vector PROP from a reciprocal lattice point.

Arguments:

On entry H is a 1x3 vector in reciprocal space.
On exit NR is the number of the symmetry operator which takes H
into HS

NR is set to zero if an allowed satellite was not found.
HS is a 1x3 vector holding the satellite equivalent vector.

Prerequisite calls:

SYMOP and DOMAG1 must have set up the symmetry.

Calls:

GMEQ MAGABS ROTSYM

Common blocks used:

/NSYM/ to use NOPC
/SATELL/ to use KSTAB NKSTAR

*** SATFND updated by PJB 23 Nov 90 ***

Classification:

Magnetic Structure Factors . . . . . . . Crystallographic

SUBROUTINE SATGEN(HF,HS,MUL,NUM)

Generates a set of magnetic satellite reflections.

Arguments:

On entry HF contains the indices of the fundamental reflection
On exit HS is an array of satellites of the fundamental which are
inside the asymmetric unit

MUL is an array containing the multiplicity of each satellite
NUM is the number of distinct satellites found

Prerequisite calls:

SYMOP, SYMUNI and DOMAG1 must have set up the symmetry.

Calls:

GMADD GMEQ GMREV MULBOX ROTSYM

Common blocks used:

/NSYM/ to use NOP NOPC
/SATELL/ to use PROP KSTAB KCENT

*** SATGEN corrected by PJB 2-Jan-96 ***

Classification:

Magnetic Structure Factors . . . . . . . Crystallographic

SUBROUTINE SAVMAP

Writes 1 layer of map to given file, plus information for later
retrieval.

Prerequisite calls:

One of FOUR1Z, FOURGP etc must have been obeyed first to produce map.

Output:

Writes on first entry a header block, plus one map; on subsequent entries, one map, and on the final entry one map and a trailer block.
The material written is the value of Z, NOBS and NUSED, and the array DENS.

Notes:

The map can be later got back by GETMAP.

Calls:

MESS

Called by:

FORFIG FOURPL

Common blocks used:

/CARDRC/ to use NTOTAL IO10
/IOUNIT/ to use LPT ITO
/MAPDA/ to use OUTLIM NX NY NDIM DENS NOBSIN NUSED
/MAPSV/ to use ZCSV NDUMPS NSAV

*** SAVMAP updated by JCM 10 May 88 ***

Classification:

Fourier Calculations . . . . . . . Crystallographic

LOGICAL FUNCTION SAYS(WANT)

Decides whether the string WANT matches a string of the same
length,just read into /SCRACH/ ignoring any distinction between upper and lower case.

Arguments:

On entry WANT is the string to test

Description:

Sets SAYS .TRUE. if WANT matches the string at the start of ICARD, ignoring the case of letters.

Calls:

LETTER

Called by:

NEXCON NOPFIL CALMSF CALQSF D3OP99 INFILE GETMSF GETSFZ GRAFIC MADUBM MAG3D MAGPOW POWDER SORGAM

Common blocks used:

*** SAYS by PJB 1-Oct-93 ***

Classification:

Tests . . . . . . . Utility

FUNCTION SCALPR(A,B)

Forms the scalar product of two orthogonal vectors (or of one from
real space with one from reciprocal space).

Arguments:

On entry A and B are vectors of dimension 3

Description:

The function is set to the scalar product of A and B (not involving cell parameters) e.g. with one vector from real &$1;one from reciprocal space

Notes:

The function SCLPRD gives the scalar product using the cell parameters.

Calls:

GMPRD

Called by:

ALRPOL ANGDIR ATMPLT CALCMG CALPOL FCALC FCHALC FMCALC FMMPCA FMPCAL GENMUL GETDC GETGEN ISPABS LATABS LFCALC LMCALC LMMPCA LMPCAL MAGCON MAGDIR MULBOX PLN3AD POLUNI SETDC SPHELI SYMREF TRYUNI UNITID USYM LCHALC GETMSF GETSFZ MAG3D OVERLA MG3DGL MVENTR MAKROT

*** SCALPR by JCM ***

Classification:

Matrices and Vectors . . . . . . . Utility

SUBROUTINE SCLCHN(NP,A,NFIX,FIX)

A specialist routine used during the setting up of constraints on
LSQ variables. Scales a chain of connected variables by the given constant.

Arguments:

On entry NP points to the first element of the chain in the arrays
NFIX, FIX.

A is the real constant by which the chain is to be scaled,
NFIX is an integer array holding pointers within itself to
describe the existing chain,

FIX is a real array of multipliers of the corresponding
elements of NFIX.

Description:

Scales all the elements of FIX which correspond to NFIX(NP) and those elements which are chained to it.

Called by:

RELPAR

*** SCLCHN by JCM 13 Jul 83 ***

Classification:

General Least Squares Refinement . . . . . . . Setting Up

FUNCTION SCLPRD(H1,H2,IR)

Forms the scalar product of two vectors referred to crystal axes.

Arguments:

On entry H1 and H2 are two 1x3 vectors referred to the crystal axes.
They are in real space if IR=1, reciprocal if IR=2.

Prerequisite calls:

RECIP must have been obeyed to set up the cell parameters.

Description:

The function is set to be the scalar product of H1 and H2

Called by:

ANGLST ANGRAD BONDA

Common blocks used:

/CELPAR/ to use CPARS

*** SCLPRD by JCM 26 Apr 84 ***

Classification:

Basic Crystallography . . . . . . . Crystallographic

SUBROUTINE SERROR(M,N,F,X,W,S,H,SD)

Called after VA05A to give the standard deviations of the
parameters.

Arguments:

Input arguments:-
M,N,F,X,W as defined in VA05A description

Output arguments:-
S=Sum of squares
H=Fractional variance covariance matrix
SD=Fractional standard error of parameter (provided that the covariance is negligible)

Prerequisite calls:

Minimisation procedure VA05A from the Harwell library

*** SERROR from PJB by R M Richardson 22 Sep 80 ***

Classification:

General Least Squares Refinement . . . . . . . Utility

SUBROUTINE SETABS

Sets up data for the calculation of absorption (or related)
integrals.

Prerequisite calls:

RECIP must have read in the cell parameters.

Description:

Calls SETDC and SETG to set up the COMMON blocks /DGEOM/ and /GAUSS/
Checks that all necessary quantities have been given and are acceptable.
Checks that at least 3 plane faces have been given on G FACE cards .
Checks that D L/ R card has been given.
If no G MODE card has been given, assumes mode 1, simple absorption correction.
If no G PNTS card has been given assumes 5 x 5 x 5
If no G MU card has been given assumes that mu will be set by a main program

Input:

Causes D and "G" cards to be read from the copy of the Crystal Data
File on unit IO10.

Output:

Writes its findings to unit LPT.

Calls:

ERRMES INPUTG MESS SETDC SETGAU

Called by:

ABSMSF AVEXAR INCMSF SORGAM

Common blocks used:

/ABSDAT/ to use MODEA
/CPLANE/ to use NP
/DREAD/ to use all members
/GAUSS/ to use NL NM NN
/GREAD/ to use all members
/IOUNIT/ to use LPT

*** SETABS by JCM 4 Oct 85 ***

Classification:

Data Collection and Reduction . . . . . . . Setting Up

SUBROUTINE SETANI

Reads
"T" cards to set up for calculation of anisotropic temperature factors.

Prerequisite calls:

RECIP and ATOPOS must have read the cell parameters and atomic positions.

Description:

Reads cards starting "T" giving the atom name, type of atf required and 6 coefficients in order a11, a22, a33, a23, a13, a12.
SETANI converts the 6 coefficients to type 5 for internal use, stores them in ATF in COMMON /ANISO/ and sets up vector IATYP which says which type they started as.

Input:

Causes "T" cards to be read from the copy of the Crystal Data
File on unit IO10.

Output:

Writes its findings to unit LPT.

Notes:

Types of atf at present allowed are: 0: Convert given itf to an atf, then proceed as if type 2. 2: exp-{1/4(a11 ha* ha* + . . +a12 ha* kb* + . . )} 3: exp-{2*pi*pi(a11 ha* ha* + . .+2a12 ha* kb* + . .)} 4: exp-(a11 h h + . . +a12 h k + . .) 5: exp-(a11 h h + . . +2a12 h k + . . )
Numbers 3 and 4 are out of Stout and Jensen pp449-450, number 2 is used in Hewat profile refinement and 5 is the form used internally in this program.

Calls:

ATOPOS ERRATM ERRCHK IATOM INPUTT JGMZER MESS

Called by:

SETFC SETFCM MMPLSQ MPLSQ

Common blocks used:

/ANISO/ to use ATF IAPT IATYP
/CARDRC/ to use NYZ IERR
/CELPAR/ to use CELL CPARS
/CONSTA/ to use PI TWOPI
/IOUNIT/ to use LPT
/POSNS/ to use NATOM TF

*** SETANI by JCM 23 Sep 83 ***

Classification:

Structure Factor Calculations . . . . . . . Setting Up

SUBROUTINE SETDC

Reads
D cards to set up crystal orientation and diffraction geometry.

Prerequisite calls:

RECIP must have read in the cell parameters.

Description:

Sets the normalised orientation matrix into UM, the wavelength into
WLGTH, and the type of geometry into IGEOM all in COMMON /DGEOM/.
Also sets other useful quantities in /DGEOM/ for subsequent calculation of the direction cosines of the incident and diffracted rays.
If IGEOM indicates 4-circle bisecting geometry, checks the determinant of the UB matrix. If it is a little different from 1., adjusts the matrix elements until it is < 0.0001 away from 1.

Calls:

ERRIN2 ERRMES GMEQ GMPRD INPUTD ORTHO RECIP SCALPR TRANSQ TRINV3 UNIVEC VECPRD

Called by:

SETABS SETLP SETPOL CALQSF GENREF SORGAM

Common blocks used:

/DGEOM/ to use IGEOM UM ANGLIN
/DREAD/ to use all members
/CARDRC/ to use IERR
/IOUNIT/ to use LPT ITO

*** SETDC by JCM 8 Oct 85 ***

Classification:

Data Collection and Reduction . . . . . . . Setting Up

SUBROUTINE SETFC

Calls all the setting up routines needed for nuclear structure
factor calculations.

Description:

Calls INPUTN, SYMOP, OPSYM(1), RECIP, ATOPOS, SETFOR and SETANI to set data in the COMMON blocks /SYMDA/, /SYMTAB/, /NSYM/, /CELLDA/, /ATNAM/, /POSNS/, /FORNAM/, /FORDA/, possibly /ANSCAT/ and /ANISO/.

Input:

Causes all the crystallographic and structure cards to be read from the copy of the Crystal Data File on unit IO10.

Output:

If any of the constituent routines sets the error flag IERR in /CARDRC, prints an error message and stops.

Calls:

ATOPOS ERRMES INPUTN OPSYM RECIP SETANI SETFOR SYMOP

Called by:

ADDFC GENREF GETSFZ POWDER SFLSQ SFTLSQ SORGAM

Common blocks used:

/CARDRC/ to use IERR
/IOUNIT/ to use LPT

*** SETFC updated by JCM 17 Feb 88 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SETFCM(MAGSET)

Calls the routines needed to set up magnetic structure factor
calculations (or non-magnetic also).

Arguments:

On entry MAGSET is the name of a subroutine to do the specific magnetic
setting up. MAGSET is therefore DOMAG1 if actually a
magnetic structure, or DUMMY if non-magnetic.

Description:

Like SETFC it calls:
INPUTN, SYMOP, OPSYM(1), RECIP, ATOPOS, SETFOR and SETANI to set data in the COMMON blocks /SYMDA/, /SYMTAB/, /NSYM/, /CELLDA/, /ATNAM/, /POSNS, /FORNAM/, /FORMDA/, possibly /ANSCAT/ and /ANISO/

If MAGSET=DOMAG1, calls DOMAG1(1) to read the magnetic data from "Q" cards and write the COMMON blocks /MAGDAT/, /SATTEL/ and /SYMMAG/.

Input:

Causes all the crystallographic and structure cards to be read from the copy of the Crystal Data File on unit IO10.

Output:

If any of the constituent routines sets the error flag IERR in /CARDRC, prints an error message and stops.

Calls:

ATOPOS ERRMES INPUTN OPSYM RECIP SETANI SETFOR SYMOP

Called by:

CALMSF CALQSF CHILSQ GETMSF MAG3D MAGLSQ MAGPOW MG3DGL MVENTR PALSQ

Common blocks used:

/CARDRC/ to use IERR
/IOUNIT/ to use LPT
/REFINE/ to use MAG MPL

*** SETFCM by PJB 31-May-1994 ***

Classification:

Magnetic Structure Factors . . . . . . . Setting Up

SUBROUTINE SETFOR

Sets up data for scattering or form factor calculations.

Description:

Reads "F" cards which all start "F <name> ITYP"
Where <name> is a character string of maximum length 4 introduced and terminated by spaces. <name> is the label of the scattering factor and will often be a chemical symbol. The factor applies to all atoms whose name starts with the scattering factor name. In the atom name the character following <name> must be a non-letter.
For example - a set of A cards :
A Pb1
A FreD
A Pb2
A P4
A O14A
A O14B would need 4 scattering factors, labelled:
F Pb (applies to Pb1 and Pb2)
F P (applies to P4)
F O (applies to O14A and O14B)
F FreD (applies to FreD)
ITYP is an integer indicating the way in which the form-factor will be
given

ITYP = 0 means "this is a multiplicative factor". It is useful
when the user wants to scale his structure factors up or down, without altering his other "F" cards .

For ITYP positive, at present 4 values are defined:
ITYP = 1 Neutron nuclear scattering. In this case the scattering
length is given on the same card after ITYP

ITYP = 2 Form factors given by series expansion of exponential terms,
of the form: sum[a(n)*exp{-a(n+1)*s*s}] + c
with n=1,2,3 or 4 and s=sin(theta)/lambda
the coefficients a(n) and c are given on one, or possibly two "F" cards . The cards each start "F <name> ITYP" and the 5, 7 or 9 coefficients follow ITYP in flexible FORMAT. If it is necessary to use two cards they should be consecutive.

ITYP = 3 Form factors given tabulated against s=sin(theta)/lambda.
the tabulated values, pairs of s and f in ascending s, follow.
If multiple cards are needed each should start "F <name> 3" and they must be consecutive.

ITYP = 4 As 2, but the result is multiplied by sin(theta)/lambda squared
This is the form of expansion used for the <jl> form factors with l not zero.

ITYP = 5 Obtain form factor from radial functions supplied on
W RADF cards .

ITYP negative indicates an anomalous scattering factor.
At present only type -1 is defined, which is the straightforward complex anomalous scattering factor. Two numbers follow the -1 on the "F" card ; they are f' and f" the real and imaginary parts of the complex multiplicative factor to be applied to this atom (in addition to any other scattering factor).

Input:

Reads "F" cards from the copy of the Crystal Data File on unit IO10.

Output:

Writes its findings to unit LPT.

Notes:

If "slack constraints only" is set, allows "no F cards ".

Calls:

ATOPOS ERRCH2 ERRIN2 ERRMES INPUTF LENGT LMATCH MESS RDREAL

Called by:

SETFC SETFCM FORFAC MMPLSQ MPLSQ

Common blocks used:

/ANSCAT/ to use NAMODE FDASH
/ATNAM/ to use ATNAME
/CARDRC/ to use NYZ IERR
/FONAM/ to use FONAME
/FORGRP/ to use all members
/FORMDA/ to use NFORMF MODE NT CMULT NUMFNM
/IOUNIT/ to use LPT ITO
/POSNS/ to use NATOM
/SLKGEO/ to use SLONLY

*** SETFOR updated by JCM 24 Nov 91 ***

Classification:

Structure Factor Calculations . . . . . . . Setting Up

SUBROUTINE SETFOU(MNEED)

Sets up data for Fourier map calculations.

Description:

Reads in: one "N" card with the title
several "M" cards with map information (including that for contour plotting if required by user)

Sets up: COMMON ready for calls of FORIER, which will then organise
the actual calculation of (possibly several) maps, and their plotting, printing and saving as requested.

Sets defaults of: 3 dimensions if no M NDIM card is given
no resolution if no M DELT card is given a scale for Fourier coefficients of 1. if no M SCAL card is given a map scale of 2.5 cm/Angstrom if no M CM/ A card is given.

Checks that M cards have been read for DTYP, SMAX, FTYP, MESH.

Input:

Causes "N" and "M" cards to be read from the copy of the Crystal
Data File on unit IO10. 2 MNEED is the mask of Mcards needed to allow multiple use of INPUTM

Output:

Writes its findings to unit LPT.

Calls:

ATOPOS ERRCHK ERRIN2 ERRMES FINDCD GMEQ GMUNI INPUTM INPUTN JFIX JGMEQ LENGT MESS RECIP RESHUF SORTX TESTOV TRANSQ USYM VCTMOD

Called by:

FORFIG FOURPL

Common blocks used:

/ATNAM/ to use ATNAME
/CONTUR/ to use ZPLVAL IZPL CONT NCONT
/FRIED/ to use FRIEDL
/CARDRC/ to use IERR
/IOUNIT/ to use LPT ITO
/MAPDA/ to use OUTLIM NX NY NXY NH NK NHK NKX NDIM SCALF1 SCALF2 DELTA SMAX MODET
/MAPGT/ to use ZGTVAL IZGT
/MAPLAB/ to use NLABS SYSIZE LABAT LSYMB LCOLOR
/MAPPR/ to use all members
/MAPRD/ to use ZRDVAL IZRD
/MAPSV/ to use ZSVVAL IZSV
/MREAD/ to use all members
/PLOMAP/ to use SCALMP
/XENDA/ to use XLIM NDIMEN MSTOP

*** SETFOU updated by PJB April 2006 C142 ***

Classification:

Fourier Calculations . . . . . . . Setting Up

SUBROUTINE SETGAU

Sets up the COMMON /GAUSS/ for Gaussian integration (for use in
absorption correction type integrals).

Prerequisite calls:

NL,NM,NN in /GAUSS/ should be the required number of Gauss points
to scan the given crystal in the 3 directions x,y,z.

INPUTG should have read all the "G" cards .

Description:

Sets up a 3D mesh of Gauss points and weights covering the given crystal whose faces are described in /CPLANE/. In /GAUSS/ the arrays XX, YY, ZZ hold the x,y and z coordinates of the points referred to the standard crystallographic axes, and the array WW holds the weights.

Output:

Writes the crystal volume so found to unit LPT.

Notes:

SETGAU may be called several times in one job, to enable comparison between integrations using different numbers of points.

Calls:

ERRCHK ERRMES GAUSPT INPUTG TESTOV

Called by:

SETABS SETPOL

Common blocks used:

/CPLANE/ to use all members
/GAUSS/ to use all members
/IOUNIT/ to use LPT
/SCRAT/ to use all members

*** SETGAU BY JCM ***

Classification:

Data Collection and Reduction . . . . . . . Setting Up

SUBROUTINE SETGEN(S)

Sets up the generation of a complete set of reflection indices.

Arguments:

On entry S is the maximum value of Sin(theta)/lambda required.

Prerequisite calls:

SYMUNI to define the asymmetric unit

Description:

Uses the defined asymmetric unit and given S to set up COMMON /HKLGEN/ ready for repeated entries to GETGEN. GETGEN will generate all hkl's in the given asymmetric unit with sin(theta)/lambda < S.
S is put into COMMON /BRAGG/ here.

Calls:

BINDIG DETER3 ERRMES FCTOR GMEQ GMSUB GMUNI GMZER INVENT JFIX ONCARD PRMTIV VCTMOD VECPRD

Called by:

GENMAG GENREF GETMSF GETSFZ MAGPOW POWDER

Common blocks used:

/FUNIT/ to use NASYM ASYM EDGE
/HKLGEN/ to use STEP PT VECEND PRPT NP
/IOUNIT/ to use LPT ITO IOUT

*** SETGEN corrected by JBF 15 Aug 94 ***

Classification:

Manipulation of Reflection Indices . . . . . . . Setting Up

SUBROUTINE SETLP

Prepares to calculate (X-ray) Lorentz and polarisation
corrections.

Prerequisite calls:

RECIP should have read the cell parameters.

Description:

Reads and checks the D cards necessary for LP corrections and puts required data into COMMON /DGEOM/
Checks the presence of D WVLN and D TH2M (for type 10 IGEOM) cards.

Output:

Writes a title to unit LPT.

Calls:

ERRMES MESS SETDC

Common blocks used:

/DGEOM/ to use IGEOM
/DREAD/ to use all members
/IOUNIT/ to use LPT

*** SETLP by JCM 8 Oct 85 ***

Classification:

Data Collection and Reduction . . . . . . . Setting Up

SUBROUTINE SETPOL

Reads the up and down polarisations of a polarised neutron beam.

Description:

Reads the "P" card giving the polarisation and flipping efficiency both with their standard deviations. Stores the data in COMMON /POLDA/.
A new card format (1997) allows the "UP" and "DOWN" polarisations to be given with ther standatd deviations. If this format is chosen the polarisations should be preceeded by the 'words' "UP", or "DOWN" as appropriate. If MODE is to be given it should be preceeded by the 'word' "DEPO".
If a negative efficiency is read it is assumed that the UP and DOWN polarisations are given
SETPOL also sets the polarisation direction POLND on crystallographic axes if the crystal geometry is specified on D cards .

Input:

Reads the "P" card from the copy of the Crystal Data File on unit IO10.

Output:

Writes its findings to unit LPT

Notes:

As of the Mar 1997 revision the data stored and used are the up and down polarisations and their standard deviations. If the old format with the flipper efficiency is used the treatment of its standard deviation is not quite correct.

Calls:

CARDIN ERRMES INPUTG MESS NCFIND RDINTG RDREAL RDWORD SETDC SETGAU

Called by:

CHILSQ MAGLSQ MMPLSQ PALSQ SORGAM

Common blocks used:

/DGEOM/ to use UM
/IOUNIT/ to use LPT
/POLDA/ to use all members

*** SETPOL updated by PJB C104 27-Apr-2001 ***

Classification:

Data Collection and Reduction . . . . . . . Setting Up

SUBROUTINE SHFESD(J)

During the application of LSQ shifts, calculates the shift and ESD
for a "redundant" variable.

Arguments:

On entry J points to the constraint information in /CONSTR/
for this redundant variable (which is related to a set of basic variables by the given constraint J)

Description:

On exit SHIFT is set to the linear combination of relevant shifts
in basic variables,

ESD is set to the square root of the sum of squares of their esds.

Called by:

APSHDS APSHSF APSHT2

Common blocks used:

/CONSTR/ to use JROWPT JCMAT AMOUNT
/DERBAS/ to use DERIVB
/MATDAT/ to use BLSQ
/NEWOLD/ to use SHIFT ESD

*** SHFESD by JCM 7 May 86 ***

Classification:

General Least Squares Refinement . . . . . . . Utility

SUBROUTINE SID(A,N,ND1,ND2,D)

Solves a set of simultaneous linear equations.

Arguments:

A is an N by N+1 sized matrix written in a table of dimension ND1
by ND2

On entry A(1:N,1:N) contains the matrix of coefficients
A(1:N,N+1) contains the column of right-hand sides

On exit D is the value of the determinant
A(1:N,N+1) contains the solution if D is not zero

*** SID *** A BARTHELEMY 19/2/75 *

Classification:

Matrices and Vectors . . . . . . . Utility

SUBROUTINE SINCOS(SN,CS,L1)

Calculates sin from cos or vice-versa.

Arguments:

On entry SN is a sine or cosine of an angle
On exit CS is the cosine or sine respectively of the same angle
L1 is a character variable which is used to identify the
calling routine if the abssolute value of SN is greater than 1.

Notes:

If ABS(SN)>1 the routine writes an error message and STOPS

Called by:

ALRPOL ANGERS ANGLST ARCCOS BONCOS BONDA EXTPAR GEOMLS GETDC MAGDIR RECELL USYM

Common blocks used:

/IOUNIT/ to use LPT ITO

*** SINCOS updated by JCM 1 Jul 86 ***

Classification:

Trigonometry . . . . . . . Utility

SUBROUTINE SORTN(IVAL,IP,N)

Sorts pointers to an integer array using Heapsort.

Arguments:

On entry IVAL is an array of N integers.
On exit IP is an array of N pointers to IVAL in ascending order

Notes:

Copyright John Matthewman 18 July 1983
HEAPSORT (See Knuth 'Art of Computer Programming' Vol 3, Section 5.2.3)

Called by:

AINOUT PFSET GETMSF GETSFZ MAGPOW POWDER

*** SORTN updated by JHM/JCM 22 Aug 86 ***

Classification:

Miscellaneous . . . . . . . Utility

SUBROUTINE SORTX(VAL,IP,N)

Sorts pointers to a real array using Heapsort.

Arguments:

On entry VAL is an array of N real numbers.
On exit IP is an array of N pointers to VAL in ascending order

Notes:

Copyright John Matthewman 18 July 1983
HEAPSORT (See Knuth 'Art of Computer Programming' Vol 3, Section 5.2.3)

Called by:

MUCALC SETFOU POSORT

*** SORTX updated by JHM/JCM 22 Aug 86 ***

Classification:

Miscellaneous . . . . . . . Utility

SUBROUTINE SPACE(NT,NSCR,NGENS)

Interprets symbols from an
S card which are the space group name.

Arguments:

On entry NT is a string of characters representing a space group short name.
There must be at least one space between elements, e.g. P21 21 21.
On exit NSCR is the unit on which S cards have been temporarily written.
NGENS is the number of generators.

Description:

Generates S cards for subequent interpretation by SYMOP.

Notes:

This is not the best or simplest way of doing this, but it came from a working program. *** SPACE adapted from an anonymous program by JCM 22 Aug 92 ***

Calls:

CENTRE ERRCH2 ERRMES NCFIND ONCARD ORTHO RDNUMS UPPER

Called by:

SYMOP

Common blocks used:

/IOUNIT/ to use LPT ITI ITO IOUT

*** SPACE corrected by PJB 02-Nov-1994 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SPCSET(N)

Defines the "space" in which coordinates will be given for
plotting.

Arguments:

On entry N is the number of the space in which subsequent "plot"
coordinates will be given.

Prerequisite calls:

PLTRIN must have been used to set up matrices defining the transformation from space N to "plotter" space.
For plotting FOURIERS:
Matrix 1 takes CCSL into plotter
Matrix 2 takes picture into CCSL
Matrix 3 takes map into picture
Matrix 4 takes char 1 into picture
Matrix 5 takes char 2 into picture (if required)
Matrix 6 takes char 3 into picture (if required)
These must have been set up initially. They are mostly unchanging, but to move from one picture to the next we alter column 3 of matrix 2.

Description:

The current space is held in NSPCE in COMMON /PLTRAN/.
Coordinate systems useful in most plotting applications:
1=Plotter (actual coordinates on a particular graphical output device) 2=CCSL (the coordinates in which the programs are written)

Coordinate sytems 3 to 7 are for user applications; for example in plotting
Fourier maps they are used as follows:
3=Picture (one "picture" which contains one section of the map) 4=Map (The crystallographically related axes of the Fourier
calculation).
5=Character type 1 (in contouring, the text under the map) 6=Character type 2 ( the title over the map) 7=Character type 3 (the contour list panel)

A new conversion matrix is set up into PTRAN(,,1).
It should take a point expressed in current coordinates (space N) into plotter coordinates (space 1).

Calls:

ERRIN2 GMEQ GMUNI GMZER PMTMUL

Called by:

ATMPLO ATMPLT CIRCLE MAPCON MAPDRW MAPFRA MAPKEY MAPTIT PLOTO PLTTXT FORFIG FOURPL MAG3D AROW3D LABAXE

Common blocks used:

/PLTRAN/ to use PMTRIX PTRAN NSPCE NTRAN MAXSP

*** SPCSET updated by JCM 14 Nov 89 ***

Classification:

Graphical Output . . . . . . . Crystallographic

SUBROUTINE SPGNAM(N,NAME)

Decodes space group symbol or integer from
S GRUP card

Arguments:

On entry N is the space group number,
or, if 0, means that the group symbol is given.

On exit NAME is 16 characters of short space group symbol.

Prerequisite calls:

On entry the card is in /SCRACH/

Calls:

ORTHO

Called by:

SYMOP

Common blocks used:

*** SPGNAM by JCM 30 Aug 92 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SPHARM(Y,T,P,LMAX,NUM)

Calculates spherical harmonics.

Arguments:

On entry T and P are the spherical polar angles theta and phi
defining the orientation of the spherical harmonic function (in radians).

LMAX is the number of different l values to calculate
(LMAX=maximum l +1)

NUM is the total number of spherical harmonic functions
which will be calculated (NUM=LMAX(LMAX+1)/2)

On exit Y(N) is complex and is set to the value of the Nth
spherical harmonic, these being in sets of constant l arranged in order of increasing l with m running from 0 to l within each l value.

Notes:

Only values for positive m are stored

Calls:

TRIG

Called by:

PFORMF

Common blocks used:

/CONSTA/ to use TWOPI

*** SPHARM by PJB Apr 84 ***

Classification:

Mathematical Functions . . . . . . . Utility

SUBROUTINE SPHELI(IM,MODE)

Imposes perpendicularity on the two components of a helix.

Arguments:

On entry IM labels the magnetic atom in question
MODE = 0 For the setting up entry
MODE = 1 First least squares entry
MODE = 2 On entries after least squares cycles

Calls:

DEGREE ERRRE2 KPAK SCALPR TESTOV UNIVEC VECPRD

Called by:

DOMAG DOMAG2 MAGCNC MAGCNL

Common blocks used:

/ATNAM/ to use ATNAME
/MAGDAT/ to use JMAGAT ANGM SPIND
/PHASE/ to use JPHASE
/SOURCE/ to use JSOURC

*** SPHELI updated by PJB 30-May-95 ***

Classification:

Magnetic Structure Factors . . . . . . . Crystallographic

SUBROUTINE SPHPOL(ANG1,ANG2,SD,MODE)

Sets up spherical polar spin directions for magnetic structures.

Arguments:

On entry ANG1 holds the first spherical polar angle (with Z) in degrees
ANG2 holds the second spherical polar angle (with X) in degrees
MODE is 1 if the 3 directions alone are wanted,
3 if the derivative directions are also wanted.

On exit SD always holds in its first 3 elements the components of the
spin direction on the X, Y, Z (standard orthogonal) axes.
If MODE=3 it also holds elements for the LSQ derivatives in columns 2 and 3.

Calls:

RADIAN

Called by:

DOMAG DOMAG2 MAGCNC MAGCNL MAGCON MAG3D MG3DGL MVENTR

*** SPHPOL by PJB 24 Jan 89 ***

Classification:

Magnetic Structure Factors . . . . . . . Setting Up

SUBROUTINE SPLINE(N,X,F,D)

Sets up a cubic spline to fit a curve.

Arguments:

On entry N is the number of points on a curve
F(I) are the N function values at the N points X(I)
D(I) is set to the derivative if the spline at the point I
for all N points.

Notes:

Uses working space in COMMON /SCRAT/
For further details see the description of the Harwell Library

Common blocks used:

/IOUNIT/ to use LPT
/SCRAT/ to use all members

*** SPLINE from HARWELL TB04A 21 May 85 ***

Classification:

Mathematical Functions . . . . . . . Setting Up

FUNCTION SPLINT(IX,N,U,S,D,X)

Evaluates a cubic spline given spline values and first derivative
values at the given knots.

Arguments:

On entry IX allows the caller to take advantage of spline parameters
set on a previous call in cases when an X point follows the previous X point.

If IX < 0 the whole range is searched for knot interval;
If IX > 0 it is assumed that X is greater than the X of the previous call and search started from there.
N=The number of knots.
U holds the knots.
S holds the spline values.
D holds the first derivative values of the spline at the
knots.

X=the point at which the spline value is required.

Prerequisite calls:

A call of SPLINE must have set up the knots in D.

Notes:

The spline value is defined as zero outside the knot range, which is extended by a rounding error for the purpose.

*** SPLINT from HARWELL TG01B 21 May 85 ***

Classification:

Mathematical Functions . . . . . . . Utility

SUBROUTINE STATIS(MODE)

Calculates means and other statistics for a set of measurements of
a single quantity.

Arguments:

MODE is an integer indicating which of the two sets of data held in /REFS/ is to be used
MODE=Negative number initialise by clearing SUMS to zero
MODE=0 read and average both sets
MODE=1 read and average the first block of data in REFS
MODE=2 read and average the second block needed for statistical output. It should be cleared by calling

Prerequisite calls:

INPUAR to fill in the data in /REFS/
The vector SUMS in COMMON /STATS/ is used to accumulate quantities
STATIS(-1) before reading the data
SUMS(1) holds the sum of the observations
SUMS(2) the sum of the standard deviations
SUMS(3) the sum of the means of repeated measurements
SUMS(4) the sum of the standard deviations of repeated measurements
SUMS(5) the sum for repeated observations of their weighted squares
minus the weighted square of the mean

SUMS(6) the number of repeated observations
SUMS(7) the sum of the means of equivalent observations
SUMS(8) the sum of the standard deviations of equivalent observations
SUMS(9) as SUM(5) for equivalent observations
SUMS(10) holds the number of equivalent observations
SUMS(11) the sum of all weighted observations
SUMS(12) the sum of the means for all observations

Calls:

GMZER WTMEAN

Called by:

ABSMSF INCMSF SORGAM

Common blocks used:

/REFS/ to use LL II ITEMS
/STATS/ to use WRK1 WRK2 WRK3 AMEAN DEV SUMS DX RAT DRAT

*** STATIS updated by PJB 13 Feb 2001 ***

Classification:

Data Collection and Reduction . . . . . . . Crystallographic

SUBROUTINE STERMS(G,R,H,S)

Calculates a term in the spherically symmetric form factor
summation, for a 3D averaged form-factor involving Sk and r only.

Common blocks used:

/CONSTA/ to use PI TWOPI FOURPI

*** STERMS by PJB 17 Jan 85 ***

Classification:

Mathematical Functions . . . . . . . Utility

SUBROUTINE STLSFW

Sets up the main program FWLSQ to perform LSQ on Forsyth & Wells
scattering factor coefficients.

Input:

Reads in and interprets an I card and an L VALS card giving the 5, 7 or 9 initial values.

Output:

Writes its findings to unit LPT.

Calls:

CENTRE ERRMES FINDCD IICD1 INPUTI RDNUMS

Common blocks used:

/FWVALS/ to use all members
/IOUNIT/ to use LPT
/REFINE/ to use IREF

*** STLSFW by JCM 17 Nov 84 ***

Classification:

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

SUBROUTINE STLSSF

Sets up any main program which does single crystal structure
factor LSQ.

Description:

Reads in I and L cards . If the refinement is actually a simple application of geometric slack constraints, with no other observations, sets this up (by recording "no. of scale factors=0" in LF1SP(2)), deals with a possible absence of fudge factors, and exits.
Sets MODOBS = MODER/100 and MODER = MOD(MODER,100).
MODOBS = 1 indicates that the reflection file contains intensities rather than structure amplitudes
Otherwise deals with defaults for:
L TFAC: set TFAC=0 and fixed
L SCAL: set SCAL(1)=0, variable, and NSCALE=1
L REFI: assumes refinement type 1, "on mod Fc"
L MODE: assumes mode 3, data input as h,k,l, obs, sigma(obs), possible
scale zone, possible code.

L WGHT: assumes weighting type 2, "use 1/sigma sqrd".
L FUDG: assumes no fudge factors.

Input:

Reads and interprets:
An I card giving general instructions (including NCYC, CYC1, MCOR,
and PRIN items, if required).

All L cards except FIX, VARY and RELA.

Output:

Writes its findings to unit LPT.

Calls:

ERRMES GEOMIN IICD1 INPLSF INPUTI MESS

Called by:

CHILSQ MAGLSQ MMPLSQ MPLSQ PALSQ SFLSQ SFTLSQ

Common blocks used:

/CARDRC/ to use IERR
/IOUNIT/ to use LPT ITO
/PRBLEM/ to use LF1SP
/REFINE/ to use IREF
/SCLDAT/ to use NSCALE
/SLAKDA/ to use NSLAK
/SLKGEO/ to use SLONLY

*** STLSSF updated by PJB 26-April-2000 ***

Classification:

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

SUBROUTINE STPLOT

Sets up the plotting of maps; fits elements of a picture
together.

Prerequisite calls:

Plotting of a Fourier map must be set up by SETFOU. In particular:
NX=number of x values wanted for plotted points
NY=number of y values wanted for plotted points
PMAP(2,2) in /CONTUR/ holds the matrix which converts map coords
to cms, set by USYM.

There is a title in ITITLE, of length NTITLE, read by INPUTN

Description:

Calls the special plotting routine PIGLET to do whatever is necessary locally to start using graphical output.
Decides the scales of various sizes of characters which will be written on a picture. Sets up all conversion matrices needed in subsequent map plotting, by calculating the layout of the various elements of a picture (map, title, expanatory text, etc) within its frame.
Finally calls PIGLET to do whatever is required locally to start the whole plot, now we know how big it will be.

Calls:

ERRIN2 GMEQ GMZER KANGA2 PIGLET PLTRIN

Called by:

FOURPL

Common blocks used:

/BITMAP/ to use NWORDS
/CONTUR/ to use IZPL PMAP
/IOUNIT/ to use LPT ITO
/LENINT/ to use all members
/MAPDA/ to use NX NY
/NTITL/ to use NTITLE
/PLODAT/ to use PAPERW ASPECT BORDER CHUNIT FROMCM
/PLOMAP/ to use WIDTOT HGTTOT WIDPIC HGTPIC WIDMAP HGTMAP WIDTTL HGTTTL WIDTXT HGTTXT WIDCON XMARG YMARG XWHITE YWHITE NYPIC IYPIC CHSCAL
/TITLE/ to use all members

*** STPLOT updated by JCM 26 Sep 87 ***

Classification:

Graphical Output . . . . . . . Setting Up

SUBROUTINE SUBSYM(ITAB)

Replaces all the symmetry parameters by those of a subgroup.

Arguments:

On entry ITAB is a table of dimension NOPC in which ITAB(I)=+-1
if element I (or the -ve element) is in the subgroup

IABS(ITAB(I)) is not 1 otherwise
ITAB(1)=-1 if the sub-group is non-centrosymmetric.

Prerequisite calls:

SYMOP

Description:

Replaces the full symmetry by the configurational symmetry of a magnetic structure.
Stores all necessary quantities in the COMMON /OLDSYM/.

Notes:

The routine SYMBAK may be used to restore the stored symmetry.

Calls:

GENELM GMEQ GMREV JGMEQ JGMZER MESS

Called by:

GENMAG

Common blocks used:

/IOUNIT/ to use LPT IOUT
/NSYM/ to use NOP NCENT NOPC NGEN CENTRC
/OLDSYM/ to use all members
/SYMDA/ to use SYM TRANS
/SYMTAB/ to use MULTAB INVERS NORD IGEN

*** SUBSYM corrected by PJB 24-Oct-94 ***

Classification:

Basic Crystallography . . . . . . . Crystallographic

SUBROUTINE SUMVEC(A,I,J,K,SUM)

Calculates the sum of elements of a real array

Arguments:

On entry A is a real vector of length at least J
I is the position in the array of the first element in the sum
J is the position beyond which elements are not included
K is the "step" between included elements

On exit SUM is the sum of the chosen elements

Description:

Sets SUM=the sum of elements of array A by a DO LOOP 'I,J,K', dealing correctly with J < I, and therefore usable in both FORTRAN 66 &$1;77.

Called by:

GAUSPT

*** SUMVEC by JCM 26 Sep 85 ***

Classification:

Matrices and Vectors . . . . . . . Utility

SUBROUTINE SYMBAK

Restores the original symmetry operators after a call to SUBSYM.

Calls:

GMEQ JGMEQ MESS

Called by:

GETMSF MAGPOW

Common blocks used:

/IOUNIT/ to use LPT
/NSYM/ to use NOP NCENT NOPC CENTRC
/OLDSYM/ to use OSYM OTRANS JNVERS JNORD MOLTAB IOGEN NOPO NCENTO NOPCO
/SYMDA/ to use SYM TRANS
/SYMTAB/ to use MULTAB INVERS NORD IGEN

*** SYMBAK by PJB 1 May 92 ***

Classification:

Basic Crystallography . . . . . . . Crystallographic

SUBROUTINE SYMCEN(NC)

A specialist routine used during the input of space group symmetry
to discover whether there is a centre of symmetry.

Prerequisite calls:

Called at the start of routine SYMGEN.

Description:

Takes the temporary copy of the space group as generated in the scratch COMMON /SCRAT/ and scans it for a centre of symmetry at the origin.
Sets NCENT=1 for non-centrosymmetric, 2 for centrosymmetric.
CENTRC=.TRUE. if centrosymmetric, .FALSE. otherwise
NC=0 if non-centrosymmetric, or the number of the (-x,-y,-z)
operator.

NOPC=NOP/NCENT.

Output:

Writes its findings on unit LPT.

Calls:

ERRCHK GMEQ GMSCA GMZER

Called by:

SYMGEN

Common blocks used:

/IOUNIT/ to use LPT
/NSYM/ to use NOP NCENT NOPC CENTRC
/SCRAT/ to use all members
/SYMDA/ to use ORIGIN

*** SYMCEN by JCM 11 Jul 83 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SYMEQU(HI,H,K,N,MI,UU,BETA)

Generates new indices and a phase, in Fourier calculations.

Arguments:

On entry HI is a 1x3 vector containg h,k,l
N is the number of a symmetry operator
H is an array of indices already found for this HI
MI is the number of entries in H.

On exit EH holds the new h,k,l
UU=0. if these indices have occurred before in the array H
or, if NDIM=2 or 3, =-1 if the (-h,-k,-l) operator was
necessary to put EH into the correct half of reciprocal space with l >=0,
+1 if (-h,-k,-l) was not used.
or, if NDIM=2, the transformed l is non-zero; or, if NDIM=4 for a bounded section, UU= the coefficient
needed for this EH in the sum.

BETA is the phase for this h,k,l.

Prerequisite calls:

Fourier calculations should be set up by SETFOU.

Calls:

EQVEC INDFIX ROTSYM TESTOV

Called by:

FOUR1D FOUR1Z FOURGP

Common blocks used:

/CONSTA/ to use TWOPI
/MAPDA/ to use NDIM MODEF SECZER SECEND
/NSYM/ to use NOP
/SYMDA/ to use TRANS

*** SYMEQU updated by PJB 29 Apr 88 ***

Classification:

Fourier Calculations . . . . . . . Crystallographic

LOGICAL FUNCTION SYMFIX(KK)

Says whether a LSQ parameter is fixed by symmetry or not.

Arguments:

On entry KK holds packed parameter spec
On exit SYMFIX is TRUE if KK is fixed by symmetry (not just by user)

Calls:

KSAME

Common blocks used:

/LINKAG/ to use NUMFV KKFV KSTFV

*** SYMFIX by JCM 7 Jun 88 ***

Classification:

General Least Squares Refinement . . . . . . . Utility

SUBROUTINE SYMFRI

Reads and interprets an item "FRIE" on an
I card .

Prerequisite calls:

Called at the end of the specialist routine SYMTID, which is used to tidy the symmetry operators towards the end of their input.

Description:

Finds the item "FRIE" if it is present, and reads a following integer.
Sets the LOGICAL FRIEDL to be TRUE if Friedel's law is to be assumed, that h,k,l is equivalent to -h,-k-l.

Input:

The item "I FRIE n" has n=0 for "do NOT assume Friedel's law". The default is to assume the law.

Output:

Reports its findings on unit LPT.

Notes:

used for non-centrosymmetric structures only.

Calls:

MESS ONCARD

Called by:

SYMTID

Common blocks used:

/FRIED/ to use FRIEDL
/IOUNIT/ to use LPT
/NSYM/ to use CENTRC

*** SYMFRI updated by JCM 14 Jul 86 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SYMGEN

Produces the generators of a space group which has been read by
SYMOP.

Prerequisite calls:

The entire group must be in the COMMON /SCRAT/, with TSYM holding the rotation matrices and TRANS the corresponding translation vectors. /SCRAT/ also holds the temporary multiplication table for operators,
MULTAB.

Description:

SYMGEN has 4 main sections. The first has been separated off as routine
SYMCEN, and the last as SYMTID.
SYMCEN identifies a centre of symmetry at the origin if there is one.
Part 2 fills in the vector NNORD as a temporary list of the orders of each of the operators.
Various elements of NNORD are set to zero:
firstly, all those centrosymetrically related to others, next, for those of orders 3,4 or 6, zeros are inserted for the element cubed, to the power 4, etc.

Part 3 sets up the pointer vector ITAB, 1xNOPC sized, and JTAB 1xNOP sized. It makes a list of the generators of the group in IGEN, counting them in NGEN. A new numbering of operators in made in JTAB, and used to index ITAB. NUMOP counts up as elements of the group are generated, stopping at NOPC.
SYMTID tidies the information out of the temporary arrays in /SCRAT/ into /SYMDA/ and /SYMTAB/, and sets up a table of pointers to invers elements, INVERS.

Calls:

BINDIG JGMZER SYMCEN SYMTID

Called by:

SYMOP

Common blocks used:

/IOUNIT/ to use LPT ITO IOUT
/NSYM/ to use NOP NOPC NGEN CENTRC
/SCRAT/ to use all members
/SYMTAB/ to use IGEN

*** SYMGEN by PJB/JCM 8 Jul 83 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SYMOP

Reads all the symmetry operators or a space group specification
from "S" cards , and generates the space group.

Description:

Reads all "S" cards and stores (ultimately):
the space group rotation matrices in SYM in /SYMDA the translation vectors associated with them in TRANS in /SYMDA the lattice translation in ALAT in /SYMDA
NOP=total number of operators, in /NSYM
NOPC= the number of operators actually stored (half NOP if
centrosymmetric with origin at centre), in /NSYM

NLAT= the number of lattice vectors, in /NSYM
NCENT=1 if non-centrosymmetric, 2 if centrosymmetric, in /NSYM
NGEN= the number of generators of the space group, in /NSYM

Only the generating elements of the space group need be given.
The position X,Y,Z is assumed, and non-primitive lattice translations are taken care of.
Operators related by a centre are eliminated.

Input:

Reads all the "S" cards from the copy of the Crystal Data File held on unit IO10.

Notes:

The complete group of operators formed may be printed out using OPSYM.

Calls:

EQOP EQPOS ERRMES FRAC3 GMADD GMPRD GMUNI GMZER INPUTS JFIX MESS NOPFIL ONCARD SPACE SPGNAM SYMGEN

Called by:

ATOPOS RECIP SETFC SETFCM ABSMSF ARRINC ARRNGE AVEXAR BONDS EXTCAL INCMSF MMPLSQ MPLSQ

Common blocks used:

/CARDRC/ to use NYZ IERR
/IOUNIT/ to use LPT
/NSYM/ to use NOP NLAT
/SCRAT/ to use all members
/SYMDA/ to use ALAT

*** SYMOP updated by JCM 30 Aug 92 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SYMREF(HIN,HOUT,NREFS,PHASE)

Generates a set of equivalent reflections and related phases.

Arguments:

On entry HIN holds an array of 3 reals, h,k,l
On exit HOUT is a 2-D real array of sets of related h,k,l values.
NREFS is set to the number of generated sets (including h,k,l)
PHASE holds an array of scalar products, hx+ky+lz, with h,k,l
corresponding to the array HIN, and x,y,z being the translation vector corresponding to the symmetry operator which produced it (in fact, the negated vector for the inverse operator).

Prerequisite calls:

The space group symmetry must be set up by a call of SYMOP

Calls:

EQVEC GMREV ROTSYM SCALPR

Called by:

GENREF

Common blocks used:

/NSYM/ to use NOP NCENT NOPC
/SYMDA/ to use TRANS
/SYMTAB/ to use INVERS

*** SYMREF corrected by PJB (davinda) 22-Apr-1994 ***

Classification:

Basic Crystallography . . . . . . . Crystallographic

SUBROUTINE SYMTID(NC)

Tidies all the arrays connected with the space group symmetry.

Prerequisite calls:

A specialist routine called at the end of routine SYMGEN.

Description:

Copies out of the scratch COMMON /SCRAT/:
rotation matrices TSYM to SYM in /SYMDA/ translation vectors TTRANS to TRANS in /SYMDA/ orders of elements NNORD into NORD in /SYMTAB/ multiplication table from MLTAB to MULTAB in /SYMTAB/

An inverting element is indicated by a -ve entry in NORD.
Also sets up the constraints imposed on the cell parameters In both spaces) by the symmetry. This is done here in case the user is about to use routines SCLPRD and VCTMOD, which refer to the cell parameter quadratic products. If RECIP has not yet been obeyed, the actual cell parameters are not available, so sensible guesses (consistent with the symmetry) are inserted.

Output:

Writes to unit LPT a brief report of the generators.

Calls:

BINDIG DETER3 GMEQ MESS RELSM6 SYMFRI

Called by:

SYMGEN

Common blocks used:

/CELFIX/ to use IPTCEL AMCELL
/CELPAR/ to use CPARS
/IOUNIT/ to use LPT ITO IOUT
/NSYM/ to use NOP NOPC NGEN CENTRC
/SCRAT/ to use all members
/SYMDA/ to use SYM TRANS
/SYMTAB/ to use MULTAB INVERS NORD IGEN

*** SYMTID by JCM 11 Jul 83 ***

Classification:

Basic Crystallography . . . . . . . Setting Up

SUBROUTINE SYMUNI

Selects a reciprocal space asymmetric unit fitting the symmetry.

Prerequisite calls:

SYMOP should have been obeyed, leaving NORD holding the orders of the
symmetry operators, INVERS pointing at their inverse elements,
FRIEDL set and the operators in SYM and TRANS.

Description:

Sets up in /FUNIT:
NASYM planes bounding an asymmetric unit in ASYM
EDGE to hold edges
ANG to hold angles
NMUL to hold fraction of reciprocal space used

By a call of UNITID makes the found unit hold the required typical h,k,l whose default is 13,11,10 (i.e. all positive, h > k > l)
By a call of POLUNI fills in /GUNIT with indicators used in finding the multiplicity of a reflection.
Builds up tentative unit in COMMON /SCRAT in ASY, communicating with other routines like FIXUNI via /SCRAT.
Works from a list of mirror planes in /SCRAT; a unit may not contain A mirror. Notes also if point group is cubic, and takes those separately.
Uses a list of axes of symmetry elements in AXI in /SCRAT.
If not cubic, and mirror planes are not enough to form a unit of the correct size, uses such axes to form the remaining planes. If there is only 1 axis, takes an arbitrary plane containing it, and symmetry related planes.
If there are more than one, the first is "principal" and must either be perpendicular to a unit plane, or contained in it (all planes). Planes are taken through this axis and those of other elements in turn.
Point group are dealt with as follows:
Triclinic: 1 and -1 are singled out; -1 is given an arbitrary plane.
Cubic: 3 planes are needed, each containing two axes. If no 4 axis,we have:
either 23 for which we need three 3 axes (distinguished by NMUL=12) or m3 for which we need one 3 and two 2's

If a 4 is present, then 4 3 3 will do for 432 and -43m,
but m3m needs 4 3 2 (and is detected by having NMUL=48).

Mirrors: use of mirrors as planes will finish:
monoclinic: m orthorhombic: mm2 and mmm tetragonal: 4mm and 4/mmm trigonal 3m hexagonal: 6mm, -6m2 and 6/mmm

Single axis: a number of planes through a single axis will finish:
monoclinic: 2 and 2/m orthorhombic: no more tetragonal: 4, -4 and 4/m (which has also 1 mirror) trigonal: 3 and -3 hexagonal: 6, -6, 6/m (the last two having 1 mirror also)

Principal axis: planes through principal axis and a "2" axis finish:
orthorhombic: 222 tetragonal: 422 and -42m (which has 1 mirror also) trigonal: 32 hexagonal: 622

This leaves -3m, which belongs to the "principal axis" category above, but because we have removed the centrosymmetrically related operators has no explicit "2" axes left. There are two ways of dealing with this - a plane perpendicular to the principal axis, or a halving of the angle between existing planes. For the moment the former is taken.

Output:

If the procedure outlined above does not produce a sensible outcome, writes error mesages and stops.

Notes:

This highlights a general point. For most point groups it is evident how many planes must be used to slice space into suitable units, but for a subset of them (422, -42m, -3, 32, -3m, 622 : for laymen, those which:
are non-cubic have at least 6 spots have both black and white spots but not superimposed
the space may be carved into two different sets of units, one with 3 faces and one with 2. The above methods will generally give preference to 2, except in the case of -3m as described.
The user may not get exactly the unit he wants for this reason. He is allowed to specify typical indices of a reflection to be inside the finished unit, but this will not influence the carving in the cases mentioned. I have in mind to allow him also to offer a plane, so that, e.g., in 422 if he offers the equator plane, he will get the broader wedge of space cut off by that plane, instead of the narrower wedge "infinite" in both directions.

Calls:

AXIS ERRMES FIXUNI GMEQ GMZER INPUTU JGMZER PLN3AD POLUNI ROTSYM TRANSQ UNITID VCTMOD VECPRD

Called by:

GENMAG ARRINC ARRNGE GENREF GETMSF GETSFZ MAGPOW POWDER

Common blocks used:

/FRIED/ to use FRIEDL
/FUNIT/ to use NMUL
/IOUNIT/ to use LPT ITO
/NSYM/ to use NOP NOPC CENTRC
/SCRAT/ to use all members
/SYMDA/ to use SYM
/SYMTAB/ to use INVERS NORD

*** SYMUNI updated by PJB 14 Jun 88 ***

Classification:

Basic Crystallography . . . . . . . Setting Up


Contents Manual

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