Minimises the sum of squares of given functions without requiring
the explicit calculation of derivatives.
Arguments:
-
On entry M,N,X,DSTEP,DMAX,ACC,MAXFUN,IPRINT,W should be set according to the
- specification of VA05A
On exit X is set to contain the refined values of the parameters
- F is set to the corresponding function values
Prerequisite calls:
-
A routine called CALFUN(M,N,F,X) must be provided to set the array F
Notes:
-
IPRINT must be the name of an integer, NOT an explicit integer
Calls:
- MB11A
MESS
NEWLIN
NEWPAG
Common blocks used:
-
- /IOUNIT/ to use LPT ITO
*** VA05A updated by JCM from HARWELL ***
Classification:
General Least Squares Refinement . . . . . . . Utility
Makes variables for a LSQ cycle from given FIX/VARY and CONSTRAINT
lists.
Arguments:
-
DEFALT is a dummy name for a subroutine to be obeyed if no other
- information is available about a parameter, and which gives
out the values .TRUE./.FALSE. for fixed/varied by default.
GETPAR is a dummy name for a subroutine to be obeyed to get the next
- parameter. It should be replaced by PARRUN in the single-
crystal applications, RUNPAR for Profile Refinement.
VARSXX is the dummy name for a subroutine to be obeyed when all the
- variables have been designated, to record "which variable" is this
parameter" against all possible parameters for this application.
This method of recording the information is new to MK4.
DOTHER name of the dummy subroutine passed tp VARSXX to allow it to
- deal with extra parameters.
Prerequisite calls:
-
Parameter naming must have been set up by LSETUP
All fixing, varying and constraining information must have been set up
into the COMMON /LINKAG/ using routines ADDFIX, ADDCON, SUBCON
ADDVAR
Description:
-
Scans all available information about all parameters. Sets up tables
of: LVRPR "which parameter is this variable" (holds a packed KK value)
- LBSVR "which variable is this basic variable" (all +ve)
LVRBS "which basic is this variable" (+=basic, -=redundant)
LRDVR "which variable is this redundant variable"
Stores all the constraints relevant to this cycle in /CONSTR/
Sets up various useful quantities:
- LVARB=number of basic variables
LVARV=number of variables
NVARF()=numbers of variables in each phase in each family
NBARF()=numbers of basics in each phase in each family
LVFST1()=1 BEFORE starting place in a derivative vector for a
- particular family of a particular phase, i.e. which is the last
variable before the first variable of that family.
LBFST()=1 BEFORE starting place in a basic variable vector for a
- particular family of a particular phase, i.e. which is the last
variable before the first basic variable of that family.
Calls VARSXX (application dependent) to store what used to be held in the
big array LPRVR, i.e. "which variable is this parameter?"
Output:
-
Calls PRIVAR to print out its findings.
Calls:
- ERRCHK
GMZER
KPAK
KSAME
NFIND
PRIVAR
Called by:
- DOMAG
CHILSQ
MAGLSQ
MMPLSQ
MPCLSQ
MPLSQ
PALSQ
SFLSQ
SFTLSQ
SNPLSQ
Common blocks used:
-
- /CONSTR/ to use JCONST JROWPT JCMAT AMOUNT NEXTJ
- /DERBAS/ to use LVARB
- /DERVAR/ to use LVARV
- /IOUNIT/ to use LPT ITO
- /LINKAG/ to use NUMFV KKFV KSTFV KTIME NUMCON KKCON AMCON KPTCON KSTCON
- /PHASE/ to use NPHASE JPHASE
- /POINTS/ to use all members
- /PRBLEM/ to use NFAM LVFST1 LBFST1 NVARF NBARF
- /REFINE/ to use IONLY SIMUL
- /SOURCE/ to use NSOURC JSOURC
*** VARMAK updated by PJB C105 Apr-2001 ***
Classification:
General Least Squares Refinement . . . . . . . Setting Up
Makes variables for cell parameters and propagation vector for
d-spacing LSQ.
Prerequisite calls:
-
Only useful if called from DSLSQ or similar. Expects suitable type
of Least Squares to be set up.
Description:
-
First clears all possible parameters for this application to be fixed.
Then scans all variables as made by VARMAK, identifies each variable as a
type of parameter, and calls individual routines to record the information.
Calls:
- ERRMES
PROPAG
PUNPAK
Common blocks used:
-
- /DERVAR/ to use LVARV
- /POINTS/ to use LVRBS LVRPR
*** VARSDS updated by PJB 29-Sept-93 ***
Classification:
Specific Least Squares Refinement . . . . . . . Setting Up
Records variable pointers for all variables in magnetic
structure-factor LSQ.
Prerequisite calls:
-
VARMAK has set up the variables
Description:
-
First clears all possible parameters for this application to be fixed.
Then scans variables as made by VARMAK. Identifies each variable as a
type of parameter, and calls individual routines to record the information.
Calls:
- MAGVAR
PUNPAK
Called by:
- DOMAG
DOMAG2
PALSQ
Common blocks used:
-
- /DERVAR/ to use LVARV
- /POINTS/ to use LVRPR
- /REFINE/ to use SIMUL
*** VARSMG by JCM 16 Nov 90 ***
Classification:
Specific Least Squares Refinement . . . . . . . Setting Up
Records variable pointers for all variables in structure-factor
LSQ.
Arguments:
-
DOTHER is the name of a logical function to record the variable
pointers for parameters not in the basic structure factor set (F2PARS)
it is LDUMMY for simple structure factor LSQ.
Prerequisite calls:
-
VARMAK has set up the variables
Description:
-
First clears all possible parameters for this application to be fixed.
Then scans variables as made by VARMAK. Identifies each variable as a
type of parameter, and calls individual routines to record the information.
Calls:
- ERRMES
PUNPAK
Called by:
- CHILSQ
MAGLSQ
MMPLSQ
MPCLSQ
MPLSQ
SFLSQ
SFTLSQ
SNPLSQ
Common blocks used:
-
- /DERVAR/ to use LVARV
- /NEWOLD/ to use IGEN ISPC KPACK
- /POINTS/ to use LVRPR
- /REFINE/ to use SIMUL
*** VARSSF by PJB C105 Apr-2001 ***
Classification:
Specific Least Squares Refinement . . . . . . . Setting Up
Makes variables for zero and cell for T2 type LSQ
Prerequisite calls:
-
Only useful if called from T2LSQ or similar. Expects suitable type
of Least Squares to be set up.
Description:
-
First clears all possible parameters for this application to be fixed.
Then scans all variables as made by VARMAK, identifies each variable as a
type of parameter, and calls individual routines to record the information.
Calls:
- PUNPAK
Common blocks used:
-
- /DERVAR/ to use LVARV
- /POINTS/ to use LVRBS LVRPR
- /REFINE/ to use SIMUL
- /ZEROPT/ to use KZERO
*** VARST2 by JCM 17 Aug 92 ***
Classification:
Specific Least Squares Refinement . . . . . . . Crystallographic
Calculates the modulus of the vector H, in either space.
Arguments:
-
On entry H is a 1x3 array holding the given vector
- SCALE is the number by which to multiply the answer
IR indicates the required space. The modulus is calculated
- in real space if IR=1, reciprocal if IR=2.
Notes:
-
Multiplies by the input quantity SCALE - useful if SCALE is equal
to say, lambda/2
Called by:
- ANGRAD
ASPHFF
ATMPLO
BNDLST
BONDA
BONDER
CALCFR
CALCGM
CALCGR
CALCMG
CALCMP
CALCSF
CALMMG
CALPOL
CALPOW
DOTWN1
ERRMAP
EXTINC
FCALC
FIXUNI
FMPCAL
FOUR1D
FOUR1Z
FOURGP
GENMAG
GENMUL
GETGEN
INOBGR
LMCALC
LMMPCA
LMPCAL
PFORMF
SETFOU
SETGEN
SYMUNI
CALMSF
GENREF
GETMSF
GETSFZ
MAGPOW
POWDER
CALCTW
SORASY
SORGAM
Common blocks used:
-
- /CELPAR/ to use CPARS
*** VCTMOD by JCM 26 Apr 84 ***
Classification:
Basic Crystallography . . . . . . . Crystallographic
Calculates Clebsch-Gordon vector coupling coefficient
Arguments:
-
J1,M1,J2,M2,J,M are the angular momentun quanum numbers
They are floating point numbers, only because they may be half
integral.
On exit VECOUP holds the answer
Calls:
- ERRMES
FACT
Called by:
- THREEJ
*** VECOUP updated by PJB 23-Jun-98 ***
Classification:
Mathematical Functions . . . . . . . Utility
Calculates the vector product of two 1x3 vectors.
Arguments:
-
On entry VEC1 and VEC2 hold 1x3 real vectors
On exit PRD = the vector product of VEC1 cross VEC2
Called by:
- ANGDIR
ATMPLT
CALCGM
CALCPA
CALPOL
FIXUNI
GETDC
LATVCS
MAGDIR
PLN3AD
POLUNI
PRMTIV
SETDC
SETGEN
SPHELI
SYMUNI
TRYUNI
UNITID
USYM
CALQSF
OVERLA
PALSQ
*** VECPRD by JCM ***
Classification:
Matrices and Vectors . . . . . . . Utility
Adds a given set of vocabulary and meanings to the Least Squares
total vocabulary.
Arguments:
-
On entry WORD is an array of NW A4 words
- MEAN is a corresponding (3,NW) array of integers, being the family,
- genus and species assigned to the word
Prerequisite calls:
-
In /WDSPC/ IWDNUM should hold the existing number of entries in LSQWD.
If used in a PR context:
In /PHASE/ KPHASE should hold the relevant phase (or zero if for all phases)
In /SOURCE/ KSOURC should hold the relevant source (or zero for all sources)
Description:
-
Copies the word array to LSQWD, starting at entry IWDNUM+1
If the first of a triplet in MEAN is negative, copies it to IWDSPC
Otherwise packs the triplet according to preset packing to IWDSPC
Updates IWDNUM, checking it.
Calls:
- ERRCHK
KPAK
Called by:
- DOPOPS
LSETSF
Common blocks used:
-
- /PHASE/ to use KPHASE
- /SOURCE/ to use KSOURC
- /WDSPC/ to use all members
- /WORDS/ to use all members
*** VOCAB by JCM 4 Aug 90 ***
Classification:
General Least Squares Refinement . . . . . . . Setting Up
Calculates normalised Voigt function
Description:
-
.. VOIGT is the normalised VOIGT function; a convolution of a
- normalised Gaussian (half-width= sigma) and Lorentzian
(Cauchy) function (full-width at half-height= width). The
function is calculated by noting that the VOIGT function
is, to within a scale factor, equal to the real part of the
complex error function.
Calls:
- WERF
*** VOIGT by WIFD Jun 84 ***
Classification:
Mathematical Functions . . . . . . . Utility
P. Jane Brown
Institut Laue Langevin,
Grenoble, FRANCE