C ====== MAIN PROGRAM FOR PHODEC=======                            
      INTEGER ND,NES,AA(11,10),NE,S,NW1,                           
     *  ORI,ORF,SP,EXPI,KK,IND(125),LI(18)                               
      REAL*8 NORM,EK,Y(3,10),                                       
     * LAMM(25),LAMI(18),ME(1,25),                          
     *ME11(25),ME12(25),ME13(25),ME14(25),ME15(25),                
     *ME16(25),ME17(25),ME18(25),ME19(25),                         
     * CC(25),QQ(25),DD1(25),RR(25),                                
     *  DLAM(125),GAM(125),DLAM1(250),GAM1(250),
     * R1(1015),R2(1015),R5(1015),R6(1015),                         
     * R7(1015),R8(100000)                                          
      NAMELIST/PHOD/ND,NES,AA,ORI,ORF,SP,NORM,EK,                   
     *        Y,EXPI,KK,IND,DLAM,GAM,NE,S,NW1                                
      OPEN(5,FILE='SYS$INPUT',STATUS='OLD')
      READ(5,PHOD)                         
      OPEN(6,FILE='SYS$OUTPUT',STATUS='NEW')
      OPEN(9,FILE='OLD$DBASE1',STATUS='OLD',FORM='UNFORMATTED')                
      OPEN(11,FILE='OLD$DBASE2',STATUS='OLD',FORM='UNFORMATTED')               
       IF(NES.GT.1) 
     * OPEN(12,FILE='OLD$DBASE3',STATUS='OLD',FORM='UNFORMATTED')
       IF (NES.GT.2)
     * OPEN(13,FILE='OLD$DBASE4',STATUS='OLD',FORM='UNFORMATTED')               
       IF(NES.GT.3)
     * OPEN(14,FILE='OLD$DBASE5',STATUS='OLD',FORM='UNFORMATTED')
       IF (NES.GT.4)
     * OPEN(15,FILE='OLD$DBASE6',STATUS='OLD',FORM='UNFORMATTED')
       IF (NES.GT.5)
     * OPEN(16,FILE='OLD$DBASE7',STATUS='OLD',FORM='UNFORMATTED')
       IF (NES.GT.6)
     * OPEN(17,FILE='OLD$DBASE8',STATUS='OLD',FORM='UNFORMATTED')
       IF (NES.GT.7)
     * OPEN(18,FILE='OLD$DBASE9',STATUS='OLD',FORM='UNFORMATTED')
       IF (NES.GT.8)
     * OPEN(19,FILE='OLD$DBASE10',STATUS='OLD',FORM='UNFORMATTED')
       IF (NES.GT.9)
     * OPEN(20,FILE='OLD$DBASE11',STATUS='OLD',FORM='UNFORMATTED')
      IF((ND.GT.10).OR.(NE.GT.1000).OR.(NES.GT.10).OR.                       
     *(S.GT.18).OR.(NW1.GT.25)) WRITE(6,10)                        
 10   FORMAT('CHECK ARRAYS" DIMENSIONS')                           
       CALL PHODEC(ND,NES,AA,ORI,ORF,SP,NORM,EK,                    
     *    Y,EXPI,KK,IND,DLAM,GAM,NE,S,NW1,LI,
     *    ME,ME11,ME12,ME13,ME14,ME15,                                
     *    ME16,ME17,ME18,ME19,                                     
     *    LAMI,LAMM,                                           
     *    CC,QQ,DD1,RR,DLAM1,GAM1,                                            
     *    R1,R2,R5,R6,R7,R8)                                       
      STOP                                                       
      END                                                          
