C--electron or positron scattering
C   nd (110)- number of diagrams
C   nes (25)- number of group of wave functions
C   nw1 (60)-number of wave functions
C   S (18)- number of core functions
C   KK=10(max7)- number of core functions with li=lk
C---LAMK(nw1+s) , IT=no of holes NI
C  kk=0(positron), kk=3 for s-wave in Ar
C  kk=2 for p-wave in Ar, kk=0 for d-wave in Ar....
C==== MAIN PROGRAM FOR SCAT========
      INTEGER NES,ND,NE,NI,S,NW1,KK,
     * K,KZ,F,F1,FZ(110),M,M1,MZ(110),
     * IT(25),IL(110),LV(110),EXPI,
     * M3(100),M4(100),LI(25),KK1(100)
      REAL*8 IPOS,EMIN,EMAX,MU,
     * SIGM1(100),SIGM2(100),SIGM3(100),SIGM4(100),SIGM5(100),
     * CC(100),QQ(100),DD1(100),RP(100),RM(100),
     * LAMM(100),LAMF(100),LAMK(100),PHASE(100),LAM(25),
     * PHRESH(100),PHIMSH(100),PHRESC(100),PHIMSC(100),
     * ME4(100),ME5(100),ME6(100),ME7(100),
     * RE(100),IM(100),
     * ME(3600),ME1(3600),ME2(3600),ME3(3600),
     * RRR(5000),RRM(5000),SR(20000),
     * MME1(252000),MME2(252000),MME4(252000),MME5(252000),
     * R1(2015),R2(2015),R5(2015),R6(2015),
     * R7(2015),R8(4000000)

      NAMELIST/SCTR/ NES,ND,MU,EXPI,IPOS,NI,IT,K,KK,KZ,
     *               F,F1,FZ,M,M1,MZ,IL,LV,
     *               NE,S,NW1,EMIN,EMAX

      OPEN(5,FILE='SYS$INPU',STATUS='OLD')
      READ(5,SCTR)
      OPEN(6,FILE='SYS$OUTP',STATUS='NEW')
      OPEN(9,FILE='OLD$DB1',STATUS='OLD',FORM='UNFORMATTED')
      OPEN(11,FILE='OLD$DB2',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.1)
     * OPEN(12,FILE='OLD$DB3',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.2)
     * OPEN(13,FILE='OLD$DB4',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.3)
     * OPEN(14,FILE='OLD$DB5',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.4)
     * OPEN(15,FILE='OLD$DB6',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.5)
     * OPEN(16,FILE='OLD$DB7',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.6)
     * OPEN(17,FILE='OLD$DB8',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.7)
     * OPEN(18,FILE='OLD$DB9',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.8)
     * OPEN(19,FILE='OLD$DB10',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.9)
     * OPEN(20,FILE='OLD$DB11',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.10)
     * OPEN(21,FILE='OLD$DB12',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.11)
     * OPEN(22,FILE='OLD$DB13',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.12)
     * OPEN(23,FILE='OLD$DB14',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.13)
     * OPEN(24,FILE='OLD$DB15',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.14)
     * OPEN(25,FILE='OLD$DB16',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.15)
     * OPEN(26,FILE='OLD$DB17',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.16)
     * OPEN(27,FILE='OLD$DB18',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.17)
     * OPEN(28,FILE='OLD$DB19',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.18)
     * OPEN(29,FILE='OLD$DB20',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.19)
     * OPEN(30,FILE='OLD$DB21',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.20)
     * OPEN(31,FILE='OLD$DB22',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.21)
     * OPEN(32,FILE='OLD$DB23',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.22)
     * OPEN(33,FILE='OLD$DB24',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.23)
     * OPEN(34,FILE='OLD$DB25',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.24)
     * OPEN(35,FILE='OLD$DB26',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.25)
     * OPEN(36,FILE='OLD$DB27',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.26)
     * OPEN(37,FILE='OLD$DB28',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.27)
     * OPEN(38,FILE='OLD$DB29',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.28)
     * OPEN(39,FILE='OLD$DB30',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.29)
     * OPEN(40,FILE='OLD$DB31',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.30)
     * OPEN(41,FILE='OLD$DB32',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.31)
     * OPEN(42,FILE='OLD$DB33',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.32)
     * OPEN(43,FILE='OLD$DB34',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.33)
     * OPEN(44,FILE='OLD$DB35',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.34)
     * OPEN(45,FILE='OLD$DB36',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.35)
     * OPEN(46,FILE='OLD$DB37',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.36)
     * OPEN(47,FILE='OLD$DB38',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.37)
     * OPEN(48,FILE='OLD$DB39',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.38)
     * OPEN(49,FILE='OLD$DB40',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.39)
     * OPEN(50,FILE='OLD$DB41',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.40)
     * OPEN(51,FILE='OLD$DB42',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.41)
     * OPEN(52,FILE='OLD$DB43',STATUS='OLD',FORM='UNFORMATTED')
      IF(NES.GT.42)
     * OPEN(53,FILE='OLD$DB44',STATUS='OLD',FORM='UNFORMATTED')

C----------------------------------
      IF((NES.GT.43).OR.(NE.GT.2000).OR.
     * (ND.GT.110).OR.
     *(S.GT.25).OR.(NW1.GT.100)) WRITE(6,10)
 10   FORMAT('CHECK ARRAYS" DIMENSIONS')
       CALL SCATSP(NES,ND,NI,MU,K,KK,KZ,F,F1,FZ,M,M1,MZ,
     *           IT,IL,LV,EXPI,IPOS,NE,S,NW1,EMIN,EMAX,
     *           M3,M4,LI,LAMM,LAMF,LAMK,PHASE,PHRESH,PHIMSH,
     *           PHRESC,PHIMSC,LAM,ME,ME1,ME2,ME3,ME4,
     *           ME5,ME6,ME7,RP,RM,RE,IM,MME1,MME2,MME4,
     *           MME5,KK1,RRR,RRM,SR,SIGM1,SIGM2,SIGM3,
     *           SIGM4,SIGM5,CC,QQ,DD1,R1,R2,R5,R6,R7,R8)
      STOP
      END