C---  PROGRAM: RIETVELD  (RIETCOM)
C---  VERSION: 890525  (YYMMDD)
C---
C---  GLOBAL COMMON BLOCK DEFINITION
C---
C-  PROGRAM CONSTANTS
      PARAMETER( MNPTS=5120, MREFS=1024, MATMS=48, MMATX=48, MPHAS=4 )
      PARAMETER( MOVRL=192, IVER=890911 )
      PARAMETER( DTOR  =1.745329252E-2, RTOD  =57.29577951 )
      PARAMETER( DTORD2=8.72664626E-03, RTODT2=114.591559  )
      PARAMETER( PI    =3.141592653590, TWOPI =2.0*PI      )
      PARAMETER( PRSC  = 1.128379167 )
      PARAMETER( KDEBUG=0 )
C-
C-  DATA TABLES
      CHARACTER QABS*2,QRADTN*2,QWGT*3
      CHARACTER QTABN*4,QTBX*4
      COMMON/TABLES/ TBX(256,10),TBD(128,10),TABN(128),IXRAY
      COMMON/TABCHR/ QTABN(128),QTBX(256)
      COMMON/ABSCHR/ QABS(87),QRADTN(5)
      COMMON/ABSDAT/ AABS(5,87)
      COMMON/WGTCHR/ QWGT(109)
      COMMON/WGTDAT/ AWGT(109)
C-
C-  JOB CONTROL PARAMETERS
      COMMON/CCNTD1/ JOBXN,EPS,RELAX(4)
      COMMON/CCNTD2/ RADWAV(2),RADREL(2),PMCCOR,WDTTHK
      COMMON/CCNTD3/ KCLRCW,KCONCW
      COMMON/WSGSS/ KWSGON
C-
C-  INSTRUMENTAL PARAMETERS FOR CONVOLUTION
      COMMON/WGDAT0/ WGRAD(5,2),WGPRO(4,3),WGCAL(6)
      COMMON/WGDAT1/ KGRAD(5,2),KGPRO(4,2),KGCAL(2,2)
C-
C-  LOGICAL UNIT NUMBERS
      COMMON/IOLUNS/ IOTTI,IOTTO,IODCF,IOPTN,IOBKG,IOALT,IOPLT,IONEW
C-
C-  FILE NAMES
      CHARACTER*40   QDCFFN,QPTNFN,QPLTFN,QBKGFN,QLSTFN,QNEWFN,QINSFN
      CHARACTER*40   QSTAFN
      COMMON/QFILES/ QDCFFN,QPTNFN,QPLTFN,QBKGFN,QLSTFN,QNEWFN,QINSFN
      COMMON/QFILE2/ QSTAFN
C-
C-  OUTPUT CONTROL FLAGS
      COMMON/COCFL1/ KOFRLI,KOFCIL,KOFRLM,KOFSGO,KOFPLF
      COMMON/COCFL2/ KOFILS,KOFPLL,KOFSFL,KOFMAT,KOFNCF
C-
C-  PLOT FLAGS
      COMMON/CPLTFL/ KHCPLT(6),KLPPLT(2)
C-
C-  AUTOPILOT PARAMETERS
      COMMON/CAUTOP/ KAUTON,KAUTOV(20),KAUTOR(20)
C-
C-  PREFERRED ORIENTATION PARAMETERS
      COMMON/PODAT1/ KPOCTY(2,MPHAS),KPOSNM(2,MPHAS)
      COMMON/PODAT2/ PPOVEC(3,2,MPHAS),PPOSED(3,48,2,MPHAS)
      COMMON/PODAT3/ PPOPAR(2,2,MPHAS),LPOPAR(2,2,MPHAS)
      COMMON/PODAT4/ APOPAR(2,2,MPHAS)
C-
C-  INTERNAL STANDARD DATA
      COMMON/INTSDT/ KINTSF,KINTSN,RINTSQ,KINTSA(3),RINTSA(3)
C-
C-  EXCLUDED REGIONS
      COMMON/EXCDAT/ NEXCRG,PEXCLO(30),PEXCHI(30)
C-
C-  BACKGROUND PARAMETERS
      COMMON/BKGDAT/ NBCKGD,PBKGTT(30),PBKGIN(30)
C-
C-  SYMMETRY OPERATORS
      COMMON/RTMTX1/ MLT(2,MPHAS),ICET(MPHAS),IV1(801),IV2(800),IV3(800)
      COMMON/RTMTX2/ PVX(400),PVY(400),PVZ(400),PVT(400)
C-
C-  SCATTERING COEFFICIENTS
      COMMON/SCACO2/ QSCNAM(16)
      COMMON/SCACO0/ NSCAT,KPTR(MATMS),SCATAC(10,16),DFP(16),DFPP(16)
      COMMON/SCACO1/ NSCOEF,SINLAM(30),SCAT(30)
C-
C-  GLOBAL PARAMETERS
      COMMON/CGLBDT/ PGLB(19),AGLB(19),LGLB(19)
C-
C-  COPIES OF CODEWORDS
      COMMON/CCWCP1/ CPYATM(11,MATMS),CPYPHS(26,MPHAS),CPYGLB(19)
C-
C-  REFLECTION RELATED PARAMETERS
      CHARACTER QLAUGR*8
      COMMON/CRFDT1/ QLAUGR(MPHAS)
      COMMON/CRFDT2/ KINDRF(MPHAS)
      COMMON/CRFDT3/ PREFTT(MREFS),PREFLP(MREFS)
      COMMON/CRFDT4/ KREFRN(MNPTS),KREFDT(MREFS),KREFNM(MPHAS)
      COMMON/CRFDT5/ PREFPK(MREFS)
C-
C-  PROFILE-SHAPE-FUNCTION RELATED PARAMETERS
      COMMON/CPSFD1/ NPSF(2,MPHAS),RLIM(MPHAS)
      COMMON/CPSFD2/ PVIIN(MPHAS,MOVRL)
      COMMON/CPSFD3/ PVIID(MPHAS,MOVRL),PVIID2(MPHAS,MOVRL)
      COMMON/CPSFD4/ PPHASY(MPHAS),LPHASY(MPHAS),APHASY(MPHAS)
      COMMON/CPSFD5/ PPHUVW(3,2,MPHAS),PPHPSF(3,2,MPHAS)
      COMMON/CPSFD6/ LPHUVW(3,2,MPHAS),LPHPSF(3,2,MPHAS)
      COMMON/CPSFD7/ APHUVW(3,2,MPHAS),APHPSF(3,2,MPHAS)
      COMMON/CPSFD8/ NPSFKK,GAM1,GAM2,GAM3,PSFVAL,PSFDX,PSFDY(8)
      COMMON/CPSFD9/ FWHM,FWHML,FWHMH,EXPM,EXPML,EXPMH
C-
C-  STRUCTURE-FACTOR RELATED PARAMETERS
      COMMON/CSRDT1/ F2TOT(MREFS),F2STR(MREFS),F2MAG(MREFS)
      COMMON/CSRDT2/ SAA100,SAA010,SAA001,SAB100,SAB010,SAB001
      COMMON/CSRDT3/ SFNAR,SFNAI,SFNBR,SFNBI
C-
C-  AMORPHOUS-PROFILE PARAMETERS
      COMMON/AMODAT/ KAMOR,KAMSTR,KAMEND
C-
C-  MEASURED/CALCULATED PATTERN
      CHARACTER QTITLE*80
      COMMON/CPTND1/ QTITLE
      COMMON/CPTND2/ THMIN,STEP,THMAX,CTIME
      COMMON/CPTND3/ YOBS(MNPTS),YCLC(MNPTS),YBKG(MNPTS),KPPTS
C-
C-  STRUCTURE-RELATED PARAMETERS
      CHARACTER QSSYMB*1,QPHSNM*32,QXTALS*20
      CHARACTER QATLBL*8,QATTYP*4,QASPG*20
      CHARACTER QSCNAM*4
      COMMON/QPHDT1/ QSSYMB(20,MPHAS),QPHSNM(MPHAS),QXTALS(MPHAS)
      COMMON/QPHDT2/ QATLBL(MATMS),QATTYP(MATMS),QASPG(MATMS)
      COMMON/PHSDAT/ NPHASE,NATM(2,MPHAS),KATMPF(MPHAS)
      COMMON/PPHDT1/ VO2CMP(MPHAS),DENCMP(MPHAS),ABSCMP(MPHAS)
      COMMON/PPHDT2/ PATOM(11,MATMS),AATOM(11,MATMS),LATOM(11,MATMS)
      COMMON/PPHDT3/ PPHSCA(MPHAS),PPHOIT(MPHAS),PPHABS(MPHAS)
      COMMON/PPHDT4/ LPHSCA(MPHAS),LPHOIT(MPHAS),LPHABS(MPHAS)
      COMMON/PPHDT5/ APHSCA(MPHAS),APHOIT(MPHAS),APHABS(MPHAS)
      COMMON/PPHDT6/ PPHLAT(6,MPHAS),LPHLAT(6,MPHAS),APHLAT(6,MPHAS)
C-
C-  MAGNETIC SCATTERING PARAMETERS
      COMMON/CMGDT1/ KMAGSF(MPHAS),KMAGSI(MATMS)
      COMMON/CMGDT2/ PMAGVE(3,MATMS),CMAGVE(3,MATMS),LCMAG(3,MATMS)
      COMMON/CMGDT3/ CWMAGC(3,MATMS)
C-
C-  GENERAL TRACKING PARAMETERS
      COMMON/PGMDT1/ IPHASE,IORD1,IORD2,IORDC,MODNRF
      COMMON/PGMDT2/ ICURPT,CURTHT,TTHOMC
      COMMON/PGMDT3/ KMXRND,KCURND,KMXCYC,KCUCYC,KMXVAR
      COMMON/PGMDT4/ KANISU(MATMS),KCLCSF(MPHAS)
      COMMON/PGMDT5/ SAVE(6,MPHAS)
C-
C-  REFINEMENT ALGORITHM RELATED PARAMETERS
      DOUBLE PRECISION RJAC,RJVX
      COMMON/CRAGT1/ RJAC(MMATX,MMATX),RJVX(MMATX),NMATPT,COND
      COMMON/CRAGT2/ CHIS1,CHIS2,CHIS3,CHID1,RESR,RESRWP
