Personal tools
You are here: Home documentation MRC Software MRC Headers latline
Document Actions

latline

by Admin last modified 2008-10-30 08:21

This is a program to do fitting of curves to either Intensity or F,Phi data for individual layer lines.

C*LATLINEK.FOR ******************************************************************
C                                                                               *
C       This is a program to do fitting of curves to either                     *
C       Intensity or F,Phi data for individual layer lines.                     *
C       Individual weights are used for F's and phases (or I's)                 *
C       Normally a trial set of A,B for each lattice line are                   *
C       input (optionally this can be calculated internally).                   *
C       This trial set is then refined to minimize the weighted                 *
C       least-squares error between F's and Phases.                             *
C                                                                               *
C       Version  1.01 LATLINE   18.01.82        DAA     VAX                     *
C       Version  1.03           17.02.82        DAA     VAX                     *
C       Version  1.10           25.02.82        DAA     VAX                     *
C       Version  1.11           09.03.82        DAA     VAX                     *
C       Version  1.20           23.10.82        DAA     VAX                     *
C       Version  1.21           07.11.82        DAA     VAX                     *
C       Version  1.22           10.12.82        DAA     VAX                     *
C       Version  1.23 LATLINEA  24.12.82        DAA     VAX                     *
C Version  1.24; 07.12.88; JMB; Option IWP=-2: sigphi input in degrees          *
C                               Guessed phase is weighted                       *
C                               AK adjusted by factor nfobs/nphases             *
C                               Symbols on phase plot show input sigphi         *
C Version 1.25 LATLINEB 15.3.91         RH   removed determinant test           *
C Version 1.26          20.9.93         RH   allow NPARM=1, for NOBS>0          *
C Version 1.27 LATLINEC 21.9.93         RH   min phase sigma 1.0 degree         *
C Version 1.28 LATLINED  5.8.94         RH   overall statistics added           *
C Version 1.29          30.12.94        RH   debug CLNFIT - WPHI                *
C Version 1.30          31.12.94        RH   debug phase residual (NP)          *
C Version 1.31           2.1.95         RH   debug above CLNFIT debug           *
C Version 1.32          22.1.95         RH   to UNIX, NCALC=2 in CLNFIT         *
C Version 1.33          19.1.98         RH   prevent VMETRIC looping            *
C Version 1.34          17.9.99         RH   parameter statements for NOBSMX    *
C                                            NPLTMX,NPROMX,NCALMX,NPRMX,NOUTMX  *
C Version 2.00          30.8.00         RH   plot2000 plots postscript directly *
C Version               21.6.00         TSH  fix wrong NOBSMX value in CLNFIT   *
C Version 2.01          03.7.01         TSH  set XPLTSIZ and YPLTSIZ            *
C                                                                               *
C       Remember to change version number in WRITE statement                    *
C                                                                               *
C********************************************************************************
C                                                                       *
C       Input parameters (unit 5):                                      *
C                                                                       *
C       TITLE           80 Character title for this data set            *
C                                                                       *
C       IPG             Plane group number (1-17)                       *
C                                                                       *
C       IPAT            0 for F & Phase     1 for Intensity data        *
C                                                                       *
C       AK,IWF,IWP      AK = relative weights for phases with           *
C                       respect to the F's                              *
C                       IWF,IWP are flags to use individual weights     *
C                       for F's and Phases in input file:               *
C                       -1 : use individual sigmas   (1/sigma**2)       *
C                        0 : set all weights = 1.0                      *
C                        1 : use individual weights                     *
C                 IWP=  -2 : use individual sigmas; (wt=1/sigma**2);    *
C                          : phase and sigma both input in degrees      *
C       ALAT,ZMIN,ZMAX,DELPLT                                           *
C                       ALAT = lattice size in angstroms                *
C                       ZMIN = minimum z* value expected for data set   *
C                       ZMAX = maximum z* value expected for data set   *
C                       DELPLT = z* interval for plotting               *
C                       if DELPLT = 0.0, then no plotting               *
C                                                                       *
C       DELPRO,RMIN,RMAX,RCUT,PFACT                                     *
C                       DELPRO = real-space  or patterson-space         *
C                       sampling interval for profile function          *
C                       (in angstroms)                                  *
C                       RMIN,RMAX lower,upper boundaries for            *
C                       profile function (angstroms)                    *
C                       in general RMIN = -RMAX                         *
C                       note, overall boundary width must be 2x         *
C                       as wide for Intensities compared to F,Phase     *
C                       RCUT = distance from either boundary to         *
C                       point where tapering of profile is to start     *
C                       (in angstroms) see also PFACT                   *
C                       PFACT controls mode of tapering, starting       *
C                       RCUT inside of RMIN/RMAX and going towards      *
C                       RMIN/RMAX.                                      *
C                       PFACT <= 0  then use linear drop off to zero    *
C                       at RMIN/RMAX                                    *
C                       PFACT > 0  then use gaussian roll-off where     *
C                       PFACT = value of gaussian at RMIN/RMAX          *
C                       (a value of .1 is reasonable)                   *
C                                                                       *
C       IGUESS,BINSIZ                                                   *
C                       IGUESS = 0 to refine input set of lattice data  *
C                              = 1 to generate a new set                *
C                       BINSIZ = delta z* for binning observations      *
C                       This is only used to generate the initial       *
C                       guess, which is then refined against the        *
C                       actual obsered data points.                     *
C                       (a value of .005 to .002 is reasonable)         *
C                                                                       *
C       NCYCLS,MPRINT   Number of refinement cycles to perform.         *
C                       If  <0  then output initial guess.              *
C                       If  =0  then minimizer goes till end            *
C                            else (25-50 is quite reasonable)           *
C                            19.1.98 impose a limit of 2000             *
C                       If MPRINT >0, print var/covar matrix            *
C                                 =0  do not                            *
C                                                                       *
C                                                                       *
C                                                                       *
C       Data formats (all are free-format):                             *
C                                                                       *
C       Observed data  [logical unit = OBS] :                           *
C       H, K, Zstar, Fobs, Phiobs, Weight on Fobs, Weight on Phiobs     *
C                                                                       *
C       If no Fobs for this Zstar you must set Fobs=-999.               *
C       If no Phiobs for this Zstar you must set Phiobs=-999.           *
C                                                                       *
C       For Intensity data:                                             *
C       Fobs    actually = Iobs                                         *
C       Phiobs  should be 0                                             *
C                                                                       *
C       It is assumed that the H,K are in the correct asymmetric        *
C       unit for the symmetry operators to be valid.                    *
C       The data can be un-sorted on Zstar.                             *
C                                                                       *
C                                                                       *
C       Initial guess for the lattice data  [logical unit = GUESS] :    *
C       H, K, Zstar, AMP, PHASE                                         *
C                                                                       *
C       H,K must correspond to the H,K that is on the observed          *
C       data file. Data must be sorted in order of increasing Zstar     *
C       and MUST be in equal intervals of Zstar. The actual sampling    *
C       interval is not critical, as long as it is the same or finer    *
C       than the critical sampling interval of 1./(RMAX - RMIN)         *
C       If the plane group has an inversion-center along Zstar          *
C       then only Zstar >= 0 are allowed; the first value must          *
C       correspond to Zstar=0.                                          *
C                                                                       *
C                                                                       *
C       Output data  [logical unit = OBS] :                             *
C                                                                       *
C       H, K, Zstar, Fcalc, Phicalc, SigmaF, SigmaPhi, Figmerit         *
C               the figure of merit = cos(Sigmaphi)                     *
C                                                                       *
C       Plots are generated on   [logical unit = PLOT]                  *
C                                                                       *
C************************************************************************
C                                                                       *
C                          SPACE GROUP INFO                             *
C                                                                       *
C   Number      Spacegroup   Asymmetric Unit    Real        Imaginary   *
C                                                                       *
C       1       P1              H>= 0                                   *
C                                                                       *
C       2       P21             H,Z>=0          Z=0                     *
C                                                                       *
C       3       P12             H,K>=0          K=0                     *
C                                                                       *
C       4       P121            H,K>=0          K=0                     *
C                                                                       *
C       5       C12             H,K>=0          K=0                     *
C                                                                       *
C       6       P222            H,K,Z>=0        H=0;K=0;Z=0             *
C                                                                       *
C       7       P2221           H,K,Z>=0        (0,2N,Z)     (0,2N+1,Z) *
C                                               (H,K,0)                 *
C                                               (H,0,Z)                 *
C                                                                       *
C       8       P22121          H,K,Z>=0        (H,K,0)                 *
C                                               (2N,0,Z)     (2N+1,0,Z) *
C                                               (0,2N,Z)     (0,2N+1,Z) *
C                                                                       *
C       9       C222            H,K,Z>=0        (H,K,0)                 *
C                                               (H,0,Z)                 *
C                                               (0,K,Z)                 *
C                                                                       *
C      10       P4              H,K,Z>=0        (H,K,0)                 *
C                                                                       *
C      11       P422            H,K,Z>=0        (H,K,0)                 *
C                               K>=H            (H,0,Z)                 *
C                                               (0,K,Z)                 *
C                                               (H,H,Z)                 *
C                                                                       *
C      12       P4212           H,K,Z>=0        (H,K,0)                 *
C                               K>=H            (H,H,Z)                 *
C                                               (2N,0,Z)     (2N+1,0,Z) *
C                                               (0,2N,Z)     (0,2N+1,Z) *
C                                                                       *
C      13       P3              H,K>=0                                  *
C                                                                       *
C      14       P312            H,K>=0          (H,H,Z)                 *
C                               K>=H                                    *
C                                                                       *
C      15       P321            H,K>=0          (H,0,Z)                 *
C                               K>H             (0,K,Z)                 *
C                                                                       *
C      16       P6              H,K,Z>=0        (H,K,0)                 *
C                                                                       *
C      17       P622            H,K,Z>=0        (H,K,0)                 *
C                               K>=H            (H,H,Z)                 *
C                                                                       *
C************************************************************************
C                                                                       *
C               NON-STANDARD ROUTINES USED:                             *
C                                                                       *
C       1)      Plotting routines in subroutine GRAPH                   *
C                                                                       *
C       2)      MOVE(B,A,NBYTES)  transfers NBYTES from A to B          *
C                                                                       *
C************************************************************************
C

eXTReMe Tracker