      SUBROUTINE DFAULT(FN,DSP,IG,YD,ITERM,TYP,IX,D1,D2,D3,D4,LOGO,FR
     1,VER,DLT,INST)
C
      INTEGER INST(2)
C   READS SY0:SPECPLOT.DFT TO GET DEFAULT CONDITIONS
C
      COMMON /SCN/ XS,XF,YS,YF,XXS,XXF,YYS,YYF,CSTR,CFIN,CYMIN,CYMAX,STR
     1,FIN,YMIN,YMAX,ZZ,CW,CH,ISP,JSP,IFL
      COMMON /COLOR/ CL,CLB,CLA,CLG
      COMMON /DPRC/ IDPRC,IBKGR,ISCH,INRM,ISTD,NDER,MF,MB,IK2,ISM,IPF,NT
     1,SENS,INSTD,EXSTD,E2T
C
      BYTE IBKGR,IK2,ISCH,INRM,IDPRC,ISTD,NDER,MF,MB,ISM,INSTD(30)
     1,EXSTD(30)
      BYTE CL,CLB,CLA,CLG(5),DLT(5)
      BYTE ISP,JSP,DSP,IG,ITERM,IX,IFL,JIN,TYP
      BYTE FN(9,30),ANS
      BYTE D1(13),D2(13),D3(13),D4(13),LOGO(12),VER(72)
C
C
C  LU-1 DEFAULT FILE ON SY0:
C
C  TYP IS FILE TYPE SPECPLOT OR RIGAKU
C  TYP=0 SPECPLOT BINARY FILE
C
C  D1 IS DISK VOL WITH DATA FILES
C  D2 IS DISK VOL WITH JCPDS DATA BASE
C  D3 IS DISK VOL WITH ELEMENTAL DATA BASE
C  D4 IS DISK VOL OF HELP FILES (D4:CHART.HLP)
C
C  IDPRC  ONLINE DATA PROCESSING (0-NO  1-YES)
C  IBKGR=0 NONE
C  IBKGR=1 LINEAR BKGR
C  IBKGR=2 PARABOLIC BKGR
C  MB NUMBER BACK  AND MF NUMBER FORWARD  FOR BKGR SUBTRACTION
C  ISCH=0 NONE
C  ISCH>0 NUMBER OF PTS TO CALCULATE 2ND DERIVATIVE OVER (SMOOTH)
C  NT NUMBER OF PTS FOR PEAK TOP SEARCH
C  INRM=0 NONE
C  INRM=1 NORMALIZE DATA
C  ISTD=0 NONE
C  ISTD=1 EXTERNAL STD
C  ISTD=2 INTERNAL STD (INTERNAL.STD)
C  ISTD=3 EXTERNAL & INTERNAL STD (EXTERNAL.STD & INTERNAL.STD)
C
C  ISM=0 NO REAL DATA SMOOTH
C  ISM>0 NUMBER OF PTS TO SMOOTH OVER
C  NDER  NUMBER OF PTS TO TAKE DERIVATIVE OVER 5,7,9,11,15,19,25
C  IK2=0 NO K ALPHA ELIMINATION
C  IK2=1 RACINGER
C  IK2=2 LADELL
C
C  DLT(I) = 0 KEEP FILE     =1 DELETE FILE
C  DLT(1)   *.MAT
C  DLT(2)  *.SPC
C  DLT(3)   *.DIF
C  DLT(4)   *.DSP
C  DLT(5)   *.BKG
C
      OPEN(UNIT=1,NAME='POWD:[public.exe.SPECPLOT.SIEMENS]SPECPLOT.DFT',
     1FORM='FORMATTED',READONLY,TYPE='OLD')
C
      READ(1,90,END=999) VER  ! VERSION OF SPECPLOT CURRENTLY BEING USED
   90 FORMAT(72A1)
      READ(1,91,END=999) INST  ! SPECPLOT INSTRUMENT TYPE
91    FORMAT(2A2)
      READ(1,101,END=999) LOGO
  101 FORMAT(12A1)
      READ(1,100,END=999) D1,D2,D3,D4
  100 FORMAT(13A1,1X,13A1,1X,13A1,1X,13A1)
      READ(1,102) CLB,CLA,CLG
  102 FORMAT(7I2)
      READ(1,*) TYP   ! FILE TYPE
      READ(1,*) ITERM! TERMINAL TYPE
      READ(1,*) DSP ! DISPLAY OPTION LINEAR-0, INTEGRAL-1, LOG-2, SQRT-3
C NORMALIZE -4, 1ST DERIVATIVE -5, 2ND DERIVATIVE -6
      READ(1,*) IG ! GRID LINES IG=1
      READ(1,*) ISP ! FULL-SCREEN, SPLIT-SCREEN, OVERLAY, ADD, SUBSTRACT
      READ(1,*) JSP ! NUMBER OF SPECTRUM BEING DISPLAYED
      READ(1,*) IX ! 2THETA OR DSPACING
      READ(1,*) YD ! DISPLACEMENT AS FRACTION OF SCREEN
      READ(1,*) IDPRC  ! DATA PROCESSING
      READ(1,*) IPF  ! NUMBER OF PTS FOR CENTROID TYPE FIT ALSO USED FOR P
      READ(1,*) IBKGR  ! BKGR SUBTRACT
      READ(1,*) MF,MB  ! NUMBER FORWARD,NUMBER BACK FOR BKGR
      READ(1,*) ISCH   ! PEAK SEARCH
      READ(1,*) SENS   ! 2ND DER PEAK SEARCH SENSITIVITY
      READ(1,*) NT    ! NUMBER OF PTS FOR PEAK TOP SEARCH
      READ(1,*) INRM   ! NORMALIZE XRD ONLY
      READ(1,*) ISTD   ! INTERNAL AND/OR EXTERNAL CORRECTION
      READ(1,*) NDER   ! NUMBER OF PTS FOR DERIVATIVE
      READ(1,*) ISM    ! NUMBER OF PTS FOR SMOOTH
      READ(1,*) E2T    ! MATCH ERROR FOR INTERNAL STD CORRECTION
      READ(1,210,END=900) DLT   ! DELETE FILES ON CLOSING
  210 FORMAT(I1,1X,I1,1X,I1,1X,I1,1X,I1)
      READ(1,200,END=900) IQ,INSTD   ! INTERNAL STD FILENAME, OR PDF#
  200 FORMAT(Q,30A1)
      DO 201 I=1,IQ
      IF(INSTD(I).EQ.' ') J=I
  201 CONTINUE
      IF(J.GT.0) IQ=J
      J=0
      INSTD(IQ+1)=0
      READ(1,200,END=900) IQ,EXSTD   ! EXTERNAL STD FILENAME IE POLY COEFF.
      DO 202 I=1,IQ
  202 IF(EXSTD(I).EQ.' ') J=I
      IF(J.GT.0) IQ=J
      EXSTD(IQ+1)=0
  900 CLOSE(UNIT=1)
      FR=1.0  ! FRACTION FOR ADDITION AND SUBTRACTION
      RETURN
C
999   STOP
C9000  WRITE(6,2000)
C2000  FORMAT(1X,'SY0:SPECPLOT.DFT WAS NOT OPENED'/
C     1 ' DOES IT EXIST UNDER THIS UIC')
99    STOP
      END
