C==================================================================
C
C	COMMON BLOCKS FOR PROGRAM FILECONV
C
C==================================================================
C
C  GENERAL BLOCKS...
C
     	PARAMETER DTOR= 0.8726646259E-2, RTOD= 114.591559
     	COMMON /GENRAL/ IREC
C
C	IREC --- READ RECORD POINTER (FOR DEBUGING PURPOSE)
C==================================================================
C
C	INPUT/OUTPUT BLOCKS...
C
     	PARAMETER IINP= 1, IOUT= 2, NTYP= 60
     	CHARACTER FILTYP(NTYP)*24
     	CHARACTER FILINP*32, FILOUT*32
     	COMMON/IOFILE/IERR,JFIL,IFLI,IFLO,ITYI,ITYO,FILINP,FILOUT,FILTYP
C
C	IERR --- ERROR FLAG:
C	     FROM  READ: 0=NO ERROR, 1=ERROR DURING READ, 2=OPEN FAILURE
C			 3=BAIL OUT
C	     FROM WRITE: 0=NO ERROR, 1=ERROR DURING WRITE OR OPEN FAILURE
C			 3=BAIL OUT
C	JFIL ----- FILE TYPE NOT SUPPORTED YET
C	IFLI ----- INPUT FILE TYPE
C	IFLO ----- OUTPUT FILE TYPE
C	ITYI ----- INPUT FILE CATEGORY
C		   1=RAW, 2=DIF, 3=PLT, 4=DAT
C	ITYO ----- OUTPUT FILE CATEGORY
C		   1=RAW, 2=DIF, 3=PLT, 4=DAT
C	IINP ----- LOGICAL UNIT NUMBER FOR INPUT DATA FILE
C	IOUT ----- LOGICAL UNIT NUMBER FOR OUTPUT DATA FILE
C	FILINP --- INPUT DATA FILENAME
C	FILOUT --- OUTPUT DATA FILENAME
C	NTYP ----- MAX NUMBER OF FILE TYPES CONVERTABLE
C	FILTYP --- CHARACTER ARRAY THAT STORES THE FILE TYPE NAME
C==================================================================
C
C	FILE HEADER BLOCK...
C
     	INTEGER ITYP*2,ISBF*4,LENG*4
     	COMMON /FILHED/ DIVER, ITYP, NHDB, ISBF, LENG,
     &  DIFSTP,DIFSTT, DIFSLE             ! line added for d5000 S.Z.
C
C	ITYP --- DATA FILE TYPE
C	NHDB --- NUMBER OF RECORDS IN THE HEADER BLOCK
C	ISBF --- STARTING RECORD OF SPECIFICATION BLOCK REFERENCES
C	LENG --- LENGTH OF SPECIFICATION BLOCK REFERENCES
C==================================================================
C
C	FILE BLOCK REFERENCES...
C
     	PARAMETER NSBR= 12
     	CHARACTER IRLR(NSBR)*4
        INTEGER*4 IRPR
     	COMMON /FILRFR/ IRPR(NSBR,2), IRLR
C
C	NSBR --- NUMBER OF SPECIFICATION BLOCK REFERENCES
C	IRPR --- SPECIFICATION BLOCK REFERENCES (POINTERS AND LENGTH)
C	IRLR --- LABEL OF SPECIFICATION BLOCK REFERENCES
C==================================================================
C
C	FILE DESCRIPTION BLOCK...
C
     	INTEGER*2 FTYP, MTYP, NREP, MPRO, NRNG,MTHC
     	CHARACTER NAME(3)*4, SCAN*1, STYP*1,SLID(20)*4,LPREP*1
     &  ,DACOUT*1
        REAL*4 DATM,TIMM,INTMAX,SPCAN1,SPCAN2
     	COMMON /FILDES/ NAME, DATM, TIMM, FTYP, MTYP, NREP,
     	1 MPRO, NRNG, SCAN, STYP, SLID,INTMAX
C
C	NAME --- OPERATOR NAME
C	DATM --- ENCODED DATE
C	TIMM --- ENCODED TIME
C	FTYP --- FILE TYPE
C	MTYP --- METHOD OF ANALYSIS
C	NREP --- NUMBER OF SERIES OF MEASUREMENTS
C	MPRO --- MEASUREMENT PROCEDURE
C	NRNG --- NUMBER OF SCAN RANGES
C	SCAN --- SCAN MODE
C	STYP --- SERIES TYPE
C	SLID --- SAMPEL ID
C==================================================================
C
C	LINE MEASUREMENT BLOCK...
C
        REAL*4 BANG
     	COMMON /LINEMM/ BANG(14)
C							!100
C	BANG(1) --- STARTING ANGLE
C	BANG(2) --- ENDING ANGLE
C	BANG(3) --- STEP WIDTH
C	BANG(4) --- MAX COUNTS
C	BANG(5) --- TWO-THETA OF MAX COUNTS
C	BANG(6) --- MIN COUNTS
C	BANG(7) --- TWO-THETA OF MIN COUNTS
C	BANG(8) --- RESERVED
C	BANG(9) --- NUMBER OF OSCILLATIONS
C	BANG(10)--- COUNT TIME (SEC) FOR PEAK
C	BANG(11)--- COUNT TIME FOR BACKGROUND
C	BANG(12)--- RESERVED
C	BANG(13)--- DELAY TIME
C	BANG(14)--- FIXED ANGLE OF MEASUREMENT
C	DANG(*) --- USER MODIFIABLE SET OF BANG(*)
C==================================================================
C
C	INSTRUMENTATION BLOCK...
C
        INTEGER*2 CHRLIN,DIFNUM
     	CHARACTER ANODE(6)*2,DIFVER*1,GONINT*1
        REAL*4 WAVE
     	COMMON /INSTRU/ DIFNUM,DIFVER,GONINT,CHRLIN,IELE,
     &  WAVE(5,6), ANODE
C
C	IELE -------- TARGET ELEMENT (DEFAULT=4,Cu)
C	WAVE(*,1) --- Cr
C	WAVE(*,2) --- Fe
C	WAVE(*,3) --- Co
C	WAVE(*,4) --- Cu
C	WAVE(*,5) --- Mo
C	WAVE(*,6) --- USER SPECIFIED
C	WAVE(1,*) --- WAVELENGTH OF K-ALPHA 1
C	WAVE(2,*) --- WAVELENGTH OF K-ALPHA 2
C	WAVE(3,*) --- WAVELENGTH OF K-ALPHA
C	WAVE(4,*) --- WAVELENGTH OF K-BETA
C	WAVE(5,*) --- KA1/KA2 RATIO
C==================================================================
C
C	INTENSITY DATA BLOCK...
C
     	PARAMETER MNP= 10000
     	COMMON /COUNTS/ MODE, NPTS, XOBS(MNP), YOBS(MNP)
C
C	MNP ---- MAXIMUM NUMBER OF DATA POINTS ALLOWED
C	MODE --- 0 = X --- TWO-THETA
C		 1 = X --- D-SPACING
C		 2 = X --- Q-SCAN (Q=2PI/D=4PI*SIN(THETA)/LAMDA)
C	NPTS --- TOTAL NUMBER OF DATA POINTS STORED IN YOBS
C	XOBS --- ARRAY TO STORE THE X-VALUES
C	YOBS --- ARRAY TO STORE THE RAW COUNTS
C==================================================================
C
C	DIFILE BLOCK...
C
     	PARAMETER MNK= 500
     	CHARACTER PEAK*4
     	REAL*4 F2TH,C2TH,PHGH,AREA,RELA,FWHM
C        INTEGER*4 PHKL
        INTEGER*2 PHKL,NPKS	      !S.Z. for d5000 formating
     	COMMON /DIFILE/NPKS, IRES, JRES, CUTI(2), CUTF(2),
     	1 F2TH(MNK), FDSP(MNK), C2TH(MNK), CDSP(MNK),
     	1 PHGH(MNK), AREA(MNK,2), RELA(MNK),
     	1 FWHM(MNK), PHKL(3,MNK), PEAK(MNK)
C
C	MNK ---- MAXIMUM NUMBER OF PEAKS ALLOWED
C	NPKS --- TOTAL NUMBER OF PEAKS STORED
C	IRES --- RESIDUAL PATTERN FLAG: 0=CONTAINED, 1=NOT CONTAINED
C	JRES --- USE THE RESIDUAL PATTERN: 1=NO, 2=YES
C	CUTI --- INTENSITY CUTOFFS (%)
C	CUTF --- FWHM CUTOFFS (D)
C	F2TH --- OBSERVED TWO-THETA
C	FDSP --- OBSERVED D-SPACING
C	C2TH --- CORRECTED TWO-THETA
C	CDSP --- CORRECTED D-SPACING
C	PHGH --- PEAK HEIGHT (CPS)
C	AREA(*,1) --- INTEGRATED INTENSITY
C	AREA(*,2) --- RESIDUAL INTENSITY
C	RELA --- RELATIVE INTENSITY
C	FWHM --- FULL WIDTH AT HALF MAXIMUM
C	PHKL --- REFLECTION HKL
C	PEAK --- PEAK TYPE LABEL
C==================================================================

