C     SUBROUTINE  **TAPIN**                                                     
C          DATA INPUT                                                           
      SUBROUTINE TAPIN (ISTART,NSTART)                                          
      INTEGER NY1(3000),NY2(1000),NZA(1000),INXP(1000),INWP(1000)               
      INTEGER NXP(1000),KEY(1000),IZ(1000),IPR(500),IPH(100)                    
      INTEGER NTHEAD(100),NTTAIL(100),NFLAG(1000)                               
      DIMENSION  ZZ(16000),DYTCQ(11030),Y(3000),T(1000)                         
     X,GAIN(1000)                                                               
     X ,PHT1(100),PHH1(100),PHT2(100),PHH2(100),QCH1(100)                       
     X,QCH2(100),CON(20),PRTIM(10),DELTIM(10),TITLE(17,10),TABL(1000)           
     X,CL(12,30),TL(6,10),BB(12),AL(2),AB(2),I(3),E(2),K(2),J(2),F(2)           
       COMMON/I2BYT/NY1,NY2,NZA,NXP,INXP,INWP,KEY,IPR,IPH                       
     X,NTHEAD,NTTAIL,NFLAG,IZ                                                   
        REAL*8 FILE                                                             
      COMMON /LAB1/ PLOT(100,10),IPLOT(10),TMAX(1000)                           
      COMMON/LAB5/TITLE                                                         
      COMMON /LAB7/LABX(5),LABY(5),LCURVE(3,5),XALIM(2),YALIM(2)                
      COMMON ZZ                                                                 
        EQUIVALENCE(FILE,F(1))                                                  
      EQUIVALENCE(I(1),I1),(I(2),I2),(I(3),I3),(E(1),E1),(E(2),E2)              
     X,          (J(1),JA),(J(2),JB),(K(1),KA),(K(2),KB)                        
      EQUIVALENCE(ZZ(001),TIME),             (ZZ(002),Y(1),DYTCQ(1))            
     X,       (ZZ(3002),T(1)),     (ZZ(11018),NSAP),                            
     X         (ZZ(11002),CON(1) ),             (ZZ(11010),CON9,SIGMA),         
     X     (ZZ(10001),LYMIN)    , (ZZ(10501),LYMAX),                            
     X           (ZZ(10002),GAIN(1)),                                           
     X         (ZZ(11011),CON10,TZERO),         (ZZ(11032),PRTIM(1))  ,         
     X         (ZZ(11042),DELTIM(1)),           (ZZ(11053),I(1) )     ,         
     X         (ZZ(11056),E(1)),                (ZZ(11058),J(1))      ,         
     X         (ZZ(11060),K(1)),                (ZZ(11062),AA(1))               
      EQUIVALENCE(ZZ(11069), LFLAG),              (ZZ(11070), IERFL)            
     X,          (ZZ(11071),PRTMX),               (ZZ(11072),DTHETA)            
     X,          (ZZ(11073),RCMIN),               (ZZ(11074), JSAVE)            
     X,          (ZZ(11075),DELTAT),              (ZZ(11076),DTMAX )            
     X,          (ZZ(11077), IMIN),               (ZZ(11078), IMAX )            
     X,          (ZZ(11079), IXMIN),              (ZZ(11080), IXMAX)            
     X,          (ZZ(11081),IPHMAX),              (ZZ(11082),IPRMAX)            
     X,          (ZZ(11083),IPFLAG),              (ZZ(11084),ISFLAG)            
     X,          (ZZ(11085),MAXNOT),              (ZZ(11086),MAXNOY)            
     X,          (ZZ(11087),NARITH),              (ZZ(11088),NCRIT )            
      EQUIVALENCE(ZZ(11089),NTIME),               (ZZ(11090),IXX)               
     X,          (ZZ(11091),NTLAST),              (ZZ(11092),NWW)               
     X,          (ZZ(11093),NXX),                 (ZZ(11094),NZZ)               
     X,          (ZZ(11095), W ),                 (ZZ(11096), X )               
     X,          (ZZ(11097), Z ) ,                (ZZ(11098), NTAB)             
     X,          (ZZ(11099),INZ),                 (ZZ(11100),ODTIME)            
     X,          (ZZ(11101),DTIME ),              (ZZ(11102),PHT1(1) )          
     X,          (ZZ(11202),PHH1(1) ),            (ZZ(11302),PHT2(1) )          
     X,          (ZZ(11402),PHH2(1) ),            (ZZ(11502),QCH1(1) )          
     X,          (ZZ(11602),QCH2(1) )                                           
      EQUIVALENCE(ZZ(15002),TABL(1))                                            
      INTEGER    AA(7),XLAB,YLAB                                                
      DATA  CL(1,30),CL(2,30),CL(3,30),CL(4,30),CL(5,30),CL(6,30)               
     X,CL(7,30),CL(8,30),CL(9,30),CL(10,30),CL(11,30),CL(12,30)/12*1H /         
C                                                                               
      DATA  CL(1,1),CL(2,1),CL(3,1),CL(4,1)/4HSPEC,4HIFIE,4HD DE,4HLTA-/
     X,     CL(5,1)                        /4HTIME/
     X,     CL(1,2),CL(2,2),CL(3,2),CL(4,2)/4HMINI,4HMUM ,4HALLO,4HWABL/        
     X,     CL(5,2),CL(6,2),CL(7,2)        /4HE DE,4HLTA-,4HTIME/               
     X,     CL(1,3),CL(2,3),CL(3,3),CL(4,3)/4HDELT,4HA-TI,4HME M,4HULTI/        
     X,     CL(5,3),CL(6,3)                /4HPLIE,4HR   /
     X,     CL(1,4),CL(2,4),CL(3,4),CL(4,4)/4HCONV,4HERGE,4HNCE ,4HTEST/        
     X,     CL(5,4),CL(6,4),CL(7,4),CL(8,4)/4H DEL,4HTA-T,4HEMRT,4HRATU/
     X,     CL(9,4)                        /4HRE  /
     X,     CL(1,5),CL(2,5),CL(3,5),CL(4,5)/4H+1.0,4H = S,4HTEAD,4HY-ST/
     X,     CL(5,5)                        /4HATE /   
     X,     CL(1,6),CL(2,6),CL(3,6),CL(4,6)/4H+1.0,4H = D,4HYDCQ,4H DUM/        
     X,     CL(5,6),CL(6,6),CL(7,6),CL(8,6)/4HP AT,4H END,4H OF ,4HRUN /        
      DATA  CL(1,8),CL(2,8),CL(3,8),CL(4,8)/4HMAXI,4HMUM ,4HERRO,4HR AL/        
     X,     CL(5,8),CL(6,8),CL(7,8),CL(8,8)/4HLOWE,4HD IN,4H TEM,4HP.  /        
     X,     CL(1,9),CL(2,9),CL(3,9),CL(4,9)/4HSTEF,4HAN-B,4HOLTZ,4HMANN/        
     X,     CL(5,9),CL(6,9),CL(7,9)        /4H CON,4HSTAN,4HT   /
     X, CL(1,10),CL(2,10),CL(3,10),CL(4,10)/4HABSO,4HLUTE,4H ZER,4HO TE/
     X, CL(5,10),CL(6,10),CL(7,10) /4HMPER,4HATUR,4HE   /
     X, CL(1,11),CL(2,11),CL(3,11),CL(4,11)/4HSUPP,4HRESS,4HION-,4HNODE/
     X, CL(5,11),CL(6,11),CL(7,11),CL(8,11)/4H SUM,4HMARY,4H(+1.,4H0), /        
      DATA  TL(1,1),TL(2,1),TL(3,1),TL(4,1)/4HTITL,4HES  ,4H    ,4H    /
     X,     TL(1,2),TL(2,2),TL(3,2),TL(4,2)/4HNETW,4HORK ,4HDESC,4HRIPT/
     X,     TL(5,2),TL(6,2)                /4HION ,4H    /
     X,     TL(1,3),TL(2,3),TL(3,3),TL(4,3)/4HINIT,4HIAL ,4HVALU,4HES  /
     X,     TL(1,4),TL(2,4),TL(3,4),TL(4,4)/4HFUNC,4HTION,4HS   ,4H    /
     X,     TL(1,5),TL(2,5),TL(3,5),TL(4,5)/4HTABL,4HES  ,4H    ,4H    /
     X,     TL(1,6),TL(2,6),TL(3,6),TL(4,6)/4HCRT ,4HPLOT,4HTING,4H    /
     X,     TL(1,8),TL(2,8),TL(3,8),TL(4,8)/4HSPEC,4HIAL ,4HCONS,4HTANT/
     X,     TL(1,7),TL(2,7),TL(3,7),TL(4,7)/4HLATE,4HNT H,4HEAT ,4HDATA/
     X,     TL(5,8),TL(6,8)                /4H VAL,4HUES /
     X,     TL(1,9),TL(2,9),TL(3,9),TL(4,9)/4HPRIN,4HT SP,4HECIF,4HICAT/
     X,     TL(5,9),TL(6,9)                /4HIONS,4H    /
     X,     TL(1,10),TL(2,10),TL(3,10)     /4HRUN ,4HCONT,4HROL /
      DATA CL(1,12),CL(2,12),CL(3,12),CL(4,12),CL(5,12),CL(6,12),               
     XCL(7,12),CL(8,12)/4H+0=N,4HEWTO,4HN SO,4HL.,+,4H    ,4H    ,4H    
     X,4HN   /,CL(1,13),CL(2,13),CL(3,13),                                      
     XCL(4,13),CL(5,13),CL(6,13),CL(7,13),CL(8,13),CL(9,13),CL(10,13),          
     XCL(11,13)/4HCONS,4HTANT,4H TO ,4HVARY,4H THE,4H NO.,4H OF ,4H*030,
     X4H EVA,4HLUAT,4HIONS/,CL(1,14),CL(2,14),CL(3,14),CL(4,14),CL(5,14)        
     X,CL(6,14),CL(7,14),CL(8,14)/4HCONS,4HTANT,4H TO ,4HVARY,4H THE,
     X4H ERR,4HOR T,4HEST /,CL(1,15),CL(2,15),CL(3,15),CL(4,15),CL(5,15)        
     X,CL(6,15),CL(7,15),CL(8,15)/4H+1 F,4HOR 1,4H00 S,4HERIE,4HS EV,
     X4HAL *,4H097 ,4HRUN /
      DATA CL(1,16),CL(2,16),CL(3,16),CL(4,16),CL(5,16),CL(6,16)/4H+1.0,
     X4H = R,4HADIO,4HSITY,4H ANA,4HLOG /
        DATA CL(1,17),CL(2,17),CL(3,17),CL(4,17),CL(5,17),CL(6,17),             
     XCL(7,17),CL(8,17),CL(9,17)/                                               
     X4H+1.0,4H= WR,4HITE ,4HDATA,4HFOR ,4HSAP-,4H6 PR,4HOGRA,4HM   /
      LFLAG = 0                                                                 
        MEGA=1000000                                                            
      INPT= 0                                                                   
      MAXNT= MAXNOT + 3000                                                      
      IF(NSTART.NE.-98) GO TO 1                                                 
      DO 1001 IC=1,1000                                                         
 1001 IZ(IC)= 1                                                                 
      YALIM(1) =0.                                                              
      YALIM(2)= 0.                                                              
      XALIM(1) = 0.                                                             
      XALIM(2) = 0.                                                             
    1 CALL READ                                                                 
      IF (I1) 2,1,12                                                            
    2 IF (I1 .GE. -90) GO TO 5                                                  
    3 IF (I1 .LE. -100) GO TO 14                                                
      GO TO 9                                                                   
C     IT = 1+C0L 3 OF FIELD I1 = DIRECTION FOR TYPE OF INPUT                    
    5 IT=1-(I1/10)                                                              
C     ITT = 1+C0L 4 OF FIELD I1 = DIRECTION FOR REPLACEMENT OF INPUT            
      ITT = (10*(I1/10))-I1+1                                                   
      LFLAG = 0                                                                 
                                                                                
      WRITE (6,13) (TL(M,IT),M=1,6)                                             
   13 FORMAT(22X,6A4)  
      GOTO(50,100,200,300,400,500,600,700,810,910),IT                           
C          TITLES                                                               
   50 N=10                                                                      
      READ (5,51) AI1,II1, (TITLE(M,N),M=1,17),C,D                              
   51 FORMAT (A1,I3,19A4)                                                       
      I1 = LINK(AI1,II1)                                                        
   57 WRITE (6,58) AI1,II1, (TITLE(M,N),M=1,17),C,D                             
   58 FORMAT (6X,A1,I3,17A4,16X,2A4)                                            
      IF (I1) 2,50,52                                                           
   52 N = MOD(II1,10)                                                           
      DO 53 M=1,17                                                              
   53 TITLE(M,N) = TITLE(M,10)                                                  
      GO TO 50                                                                  
C          NETWORK DESCRIPTION                                                  
  100 IF(ITT.GT.1) GO TO 150                                                    
      WRITE(6,101)                                                              
  101 FORMAT(23X,16HSTAR TEN SECTION/  '      YMIN YMAX YINC     INT.VAL        
     1UE                 T(1) T(2) TINC TINC      COMMENTS ')                   
      LFLAG=-1                                                                  
  102 CALL READ                                                                 
      IF (I1) 2,102,103                                                         
  103 CONTINUE                                                                  
      IF(I1.GT.3000) GO TO 10                                                   
  104 NY1(I1)= 1000*JA+JB                                                       
  107 IF(E1.GT.0.)Y(I1)= E1                                                     
      IF(I1.LT.I2) GO TO 110                                                    
      MAXNOY = MAX0(MAXNOY,I1)                                                  
      GO TO 102                                                                 
  110 JA= JA+KA                                                                 
      JB= JB+KB                                                                 
      INC= MAX0(I3,1)                                                           
      I1= I1+ INC                                                               
      GO TO 103                                                                 
C                FLOW NETWORK DESCRIPTION                                       
150     IF(ITT.GT.6)GO TO 160                                                   
        WRITE(6,151)                                                            
  151 FORMAT(19X,'STAR FIFTEEN SECTION'/19X,'CIRCUIT FOR FLOW NODES')           
      LFLAG= -1                                                                 
  153 CONTINUE                                                                  
  152 CALL READ                                                                 
      IF(I1)2,152,154                                                           
  154 IF(I1.GT.3000) GO TO 10                                                   
      NY1(I1)= MEGA+1000*JA + JB                                                
      LYMAX=LYMAX+1                                                             
      NY2(LYMAX)= I1                                                            
      IF(E1.GT.0.)Y(I1)= E1                                                     
      IF(I1.GE.I2) GO TO 152                                                    
      JA= JA+KA                                                                 
      JB= JB+KB                                                                 
      INC= MAX0(I3,1)                                                           
      I1= I1 + INC                                                              
      GO TO 154                                                                 
 160   CALL CONY                                                                
       NSAP=1                                                                   
       GO TO 1                                                                  
C    INITIAL AND CONSTANT VALUES                                                
 200   WRITE(6,201)                                                             
       LFLAG=0                                                                  
 201   FORMAT(20X,19HSTAR TWENTY SECTION)                                        
 202   CALL READ                                                                
      IF(I1)210,202,203                                                         
  210 MAXNOT= MAXNT -3000                                                       
      GO TO 2                                                                   
  203 IA = I1                                                                   
      IB = I2                                                                   
       INC=MAX0(I3,1)                                                           
      DYTCQ(IA)= E1                                                             
       IA2=IA+INC                                                               
      IF(IA2.GT.IB) GO TO 205                                                   
      DO 204 IX= IA2,IB,INC                                                     
  204 DYTCQ(IX)= DYTCQ(IX-INC)+E2                                               
  205 CONTINUE                                                                  
      IF(IA/1000.NE.3) GO TO 202                                                
        I4=I3                                                                   
        IF(I3.EQ.0) I4=1                                                        
       NFLAG(IA-3000)=I4                                                        
  208 DO 209 IX=IA,IB                                                           
      IF(I3.GE.0)I4=MAX0(1,NFLAG(IX-3000))                                      
  209 NFLAG(IX-3000)= I4                                                        
      IF(I3.NE.-1) MAXNT= MAX0(IA,IB,MAXNT)                                     
      GOTO202                                                                   
C          FUNCTIONS                                                            
  300 IX = ISTART                                                               
      WRITE(6,301)                                                              
  301 FORMAT(19X,19HSTAR THIRTY SECTION/'  NO. ZMIN ZMAX  KEY INC  INT.         
     1VALUE(E1) GAIN(E2)    X    W  XINC WINC     COMMENTS ')                   
      LFLAG = 1                                                                 
  302 IXX= IX                                                                   
      CALL READ                                                                 
  303 IF(I1)311,302,304                                                         
  304 GO TO (314,316,316,316,316,316,316,316,316,327),ITT                       
C     REPLACEMENT OF SPECIFIC FUNCTIONS                                         
  316 NAB = 1                                                                   
  317 DO 322 IX=1,IMAX                                                          
  319 IF (NZA(IX) .NE. I1) GO TO 322                                            
  320 NAB = NAB+1                                                               
  321 IF (ITT .EQ. NAB) GO TO 315                                               
  322 CONTINUE                                                                  
  324  IFTAG=I1                                                                 
      WRITE (6,325) IFTAG,ITT                                                   
  325 FORMAT (1H0,6X,A4,14H, ENTRY NUMBER, I3, 29H, NOT LOCATED AMONG FU        
     1NCTIONS)                                                                  
  309 I1 = -99                                                                  
      GO TO 9                                                                   
  327 ITT = 1                                                                   
  331 IX = 0                                                                    
  332 IMAX = 0                                                                  
      IMIN = 1                                                                  
C     STANDARD INPUT FOR FUNCTIONS                                              
  314 IX = IX+1                                                                 
      IF(IX.GT.1000)GO TO 10                                                    
  315 NZA(IX)= 10000*I1+I2                                                      
      IMAX= MAX0(IMAX,IX)                                                       
      NXP(IX)= 10000*JA+JB                                                      
      INXP(IX) = KA                                                             
      INWP(IX) = KB                                                             
      IZ(IX)= MAX0(INZ,1)                                                       
      GAIN(IX) = E2                                                             
      KEY(IX) = I3                                                              
  307 IF (E1 .EQ. 0.0) GO TO 302                                                
  310 DO 328 IC=I1,I2                                                           
  328 DYTCQ(IC) = E1                                                            
      GO TO 302                                                                 
  311 IF (ITT .GT. 1) GO TO 330                                                 
  329 ISTART = IX                                                               
  330 IMAX = MAX0(IMAX,IX)                                                      
      LFLAG = 0                                                                 
      GO TO 2                                                                   
C          TABLES                                                               
  400 NT = NTLAST                                                               
      WRITE(6,401)                                                              
      LFLAG = 0                                                                 
  401 FORMAT(15X,19HSTAR FOURTY SECTION//7X,5HTABLE,16X,1HX,14X,1HZ)
      NTAB=0                                                                    
  402 CALL READ                                                                 
      IF (I1 .NE. 0) GO TO 405                                                  
  403 NT = NT+2                                                                 
      IF(NT.GT.999) GO TO 10                                                    
      TABL( NT )=E1                                                             
      ITAB = I1+NTABP                                                           
      IF(ITAB.EQ.0.AND.TABL(NT).LE.TABL(NT-2)) GO TO 14                         
      TABL(NT+1)=E2                                                             
      GO TO N4,(402,404)                                                        
  404 NTP = NTP+2                                                               
      TABL(NT) = TABL(NTP)                                                      
      GO TO 402                                                                 
  405 ASSIGN 402 TO N4                                                          
                                                                                
  406 NTTAIL(NTAB) = NT+1                                                       
      IF (I1 .LE. 0) GO TO 419                                                  
  410 NTAB = I1                                                                 
      NTABP = 0                                                                 
      IF (NTAB .GE. 100) GO TO 414                                              
  411 NTHEAD(NTAB) = NT+2                                                       
      IF (I2 .LE. 0) GO TO 403                                                  
  407 ASSIGN 404 TO N4                                                          
      NTABP = I2                                                                
      IF (NTHEAD(NTABP) .LE. 0) GO TO 412                                       
  408 NTP =(NTHEAD(NTABP)) - 2                                                  
      GO TO 403                                                                 
  412 WRITE (6,413)                                                             
  413 FORMAT (49H0 ERROR, COPYING OF A NONEXISTENT TABLE REQUESTED)             
      GO TO 12                                                                  
  414 WRITE (6,415)                                                             
  415 FORMAT (48H0 ERROR, TABLE NUMBER IS EQUAL TO OR EXCEEDS 100)              
      GO TO 12                                                                  
  419 NTLAST = NT                                                               
      GO TO 2                                                                   
C     PLOT DATA                                                                 
  500 CONTINUE                                                                  
      LFLAG = 7                                                                 
      WRITE(6,501)                                                              
  501 FORMAT(19X,18HSTAR FIFTY SECTION)
  502 CALL READ                                                                 
      JPLOT=0                                                                   
      IF(I1.LT.0) GO TO 2                                                       
      LT= I1                                                                    
  503 IF(I1.GT.0.OR.I3.LE.0)GO TO 520                                           
      IF(I3.GT.1)GO TO 510                                                      
      YALIM(1)= E1                                                              
      YALIM(2)= E2                                                              
      DO505 M=1,5                                                               
  505 LABY(M)=AA(M)                                                             
      WRITE(6,551)LABY,(AA(IC),IC=6,7)                                          
  551 FORMAT(8X,'Y AXIS LABEL IS  ',5A4, 49X,2A4)                               
      GOTO502                                                                   
  510 IF(I3.GT.2) GO TO 590                                                     
      XALIM(1) = E1                                                             
      XALIM(2) = E2                                                             
      DO 515 M=1,5                                                              
  515 LABX(M)= AA(M)                                                            
      WRITE(6,552) LABX,(AA(IC),IC=6,7)                                         
  552 FORMAT(8X,'X AXIS LABEL IS  ',5A4,49X,2A4)                                
      GOTO502                                                                   
  520 IF(I1.GT.0)JZ=2*I1                                                        
      IF(I1.LE.5) GO TO 521                                                     
      LT1= I1                                                                   
      GOTO590                                                                   
  521 M3= 3*I1                                                                  
      M2=M3-1                                                                   
      M1=M2-1                                                                   
      IF(I1.LE.0) GO TO 525                                                     
      JPLOT1=0                                                                  
      LCURVE(1,I1)= AA(1)                                                       
      LCURVE(2,I1)= AA(2)                                                       
      LCURVE(3,I1)= AA(3)                                                       
      IF(I3.GT.0) GO TO 530                                                     
  525 JPLOT=JPLOT1+1                                                            
      IF(JPLOT.GT.100)GOTO502                                                   
      JPLOT1=JPLOT                                                              
      PLOT(JPLOT,JZ-1)=E(1)                                                     
      PLOT(JPLOT,JZ)=E(2)                                                       
      IPLOT(JZ-1)=JPLOT                                                         
      IF(I1.EQ.0) GO TO 554                                                     
      WRITE(6,553) I1,(LCURVE(M,I1),M=1,3),(AA(IC),IC=6,7)                      
  553 FORMAT(8X,'CURVE NO.',I3,' LABEL IS  ',3A4,51X,2A4)                       
      WRITE(6,555)LABX,LABY                                                     
     1,(AA(IC),IC=6,7)                                                          
  554 CONTINUE                                                                  
  555 FORMAT(13X,'PT.NO.',6X,5A4,6X,5A4, 23X,2A4)                               
      WRITE(6,556)JPLOT,E,(AA(IC),IC=6,7)                                       
  556 FORMAT(16X,I3,2E26.4,23X,2A4)    
      GOTO502                                                                   
  530 IF(I1.GT.0)WRITE(6,553)I1,(LCURVE(M,I1),M=1,3),(AA(IC),IC=6,7)            
      GOTO502                                                                   
  590 WRITE(6,591)LT1                                                           
  591 FORMAT(20H  CRT INPUT CONSTANT,I4,13H IS TOO LARGE) 
      GO TO 12                                                                  
C                LATENT HEAT DATA                                               
  600 IPP= IPHMAX+1                                                             
      WRITE(6,601)                                                              
  601 FORMAT(19X,'STAR SIXTY SECTION')                                          
  602 CALL READ                                                                 
      IF(I1)613,609,603                                                         
  603 GOTO(604,615,615,615,615,615,615,615,622),ITT                             
C     REPLACEMENT OF SPECIFIC INPUT ITEMS                                       
  615 NAB=1                                                                     
      DO 618 IX=1,IPHMAX                                                        
      IF(I1.NE.0)GOTO618                                                        
  616 NAB=NAB+1                                                                 
      IF(NAB-ITT)618,621,619                                                    
  618 CONTINUE                                                                  
  619 WRITE(6,620)I1,ITT                                                        
  620 FORMAT(1H0,6X,5H NODE,I4,'ENTRY NUMBER',I3,'NOT LOCATED IN LATEN'
     X,'TEAT INPUT')
      GOTO309                                                                   
  621 IPP=IX                                                                    
      GOTO604                                                                   
C     REMOVAL OF ALL PREVIOUS INPUT OF THIS TYPE                                
  622 ITT=1                                                                     
      IPHMAX=0                                                                  
      IPP=1                                                                     
  604 IA=MOD(I1,1000)                                                           
      IB=MOD(I2,1000)                                                           
      IPX=IPP                                                                   
  605 IF(IPP.GT.100)GOTO10                                                      
  606 IPH(IPP)=IA                                                               
      PHH1(IPP)=E2                                                              
      PHT1(IPP)=E1                                                              
      PHT2(IPP)=1.E15                                                           
      PHH2(IPP)=0.0                                                             
      IPP=1+IPP                                                                 
      IF(IB.GT.IA)GOTO608                                                       
  607 IPZ=IPP-1                                                                 
      GOTO602                                                                   
  608 IA=1+IA                                                                   
      GOTO605                                                                   
  609 DO610IP=IPX,IPZ                                                           
      PHT2(IP)=E1                                                               
  610 PHH2(IP)=E2                                                               
      GOTO602                                                                   
  613 IF(IPP.GT.100)GOTO10                                                      
      IPHMAX=IPP-1                                                              
      GOTO2                                                                     
C          RUN CONTROL CONSTANTS                                                
  700 WRITE(6,751)                                                              
  751 FORMAT(23X,20HSTAR SEVENTY SECTION) 
      LFLAG = 7                                                                 
  752 CALL READ                                                                 
      IF(I1.LT.0) GO TO 2                                                       
      IF(I1.GT.30) I1=30                                                        
      CON(I1) = E1                                                              
      LT= I1                                                                    
      WRITE(6,701) I1,E1,(CL(M,LT),M=1,12),(AA(IC),IC=6,7)                      
  701 FORMAT(6X,I4,10X,E15.6,2X,12A4,9X,2A4)                                    
      GO TO 752                                                                 
C          PRINT-OUT SPECIFICATIONS                                             
  810 WRITE(6,811)                                                              
  811 FORMAT(23X,19HSTAR EIGHTY SECTION)  
  800 IP = IPRMAX                                                               
  802 CALL READ                                                                 
  803 IF (I1) 808,802,804                                                       
  804 IP = IP+1                                                                 
      IF(IP.GT.99) GO TO 10                                                     
      IPR(IP) = I1                                                              
       IPR(IP+100)=I2                                                           
       IPR(IP+200)=MAX0(I3,1)                                                   
       GO TO 802                                                                
  808 IPRMAX = IP                                                               
      GO TO 2                                                                   
C          RUN CONTROL                                                          
  910 WRITE(6,911)                                                              
  911 FORMAT(18X,19HSTAR NINETY SECTION)    
  900 LL=0                                                                      
  902 CALL READ                                                                 
      IF (I1 .LT. 0) GO TO 905                                                  
  903 LL=LL+1                                                                   
      IF(LL.GT.10) GO TO 10                                                     
      IF(I1.LT.0) GO TO 905                                                     
      PRTIM(LL) = E1                                                            
      DELTIM(LL)= E2                                                            
      IF((E1.GT.0.).AND.(E2.EQ.0.)) PRTMX= PRTIM(LL)                            
      GO TO 902                                                                 
  905 IF(PRTMX.LE.0.)PRTMX= PRTIM(LL)                                           
      GO TO 2                                                                   
   10 WRITE (6,11)                                                              
   11 FORMAT(55H0 ERROR-STORAGE CAPACITY FOR THIS TYPE OF DATA EXCEEDED)        
      GO TO 12                                                                  
   14 WRITE (6,15)                                                              
   15 FORMAT (33H    THIS TYPE OF INPUT IS ILLEGAL)                             
   12 CALL ERROR                                                                
    9 NSTART = I1                                                               
      RETURN                                                                    
      END                                                                       
C     SUBROUTINE  **ERROR**                                                     
      SUBROUTINE ERROR                                                          
      DIMENSION  ZZ(16000),A(19)                                                
      EQUIVALENCE(ZZ(11070),IERFL)                                              
     X,          (ZZ(11053),I1)                                                 
      COMMON  ZZ                                                                
      DATA TEST/1H*/
      WRITE (6,7)                                                               
    7 FORMAT (108H- AN ERROR HAS OCCURRED, THE FOLLOWING IS A LISTING OF        
     1 THE REMAINING INPUT DATA UNTIL A *98 OR *99 IS FOUND,/2X,70H AT W        
     2HICH POINT THE PROGRAM WILL START A NEW RUN OR QUIT, RESPECTIVELY)        
    1 READ (5,2) AI1,II1,A                                                      
    2 FORMAT (A1,I3,19A4)                                                       
      WRITE(6,3)AI1,II1,A                                                       
    3 FORMAT (5X,A1,I3,17A4,2X,2A4)                                             
C     SEE IF CARD HAS A *                                                       
      IF(AI1.NE.TEST)GOTO1                                                      
C     SEE IF CARD HAS A 99 OR 98                                                
    4 IF(II1.LT.98) GO TO 1                                                     
    5 IERFL = 2                                                                 
      IF(II1.EQ.99)IERFL= 3                                                     
      I1= -II1                                                                  
    6 RETURN                                                                    
      END                                                                       
C     SUBROUTINE  **ARITH**                                                     
C                                                                               
C                                                                               
      SUBROUTINE ARITH                                                          
      INTEGER NY1(3000),NY2(1000),NZA(1000),INXP(1000),INWP(1000)               
      INTEGER NXP(1000),KEY(1000),NFLAG(1000),IZ(1000),IPR(500),IPH(100)        
     X,NTHEAD(100),NTTAIL(100)                                                  
      DIMENSION  ZZ(16000),DYTCQ(11030),Y(3000),T(1000),CON(20)                 
     X,C(1000)        ,Q(1000)        ,GAIN(1000) ,A(1000),B(1000)              
     X,D(1000),SUMY(1000),SUMYT(1000), TOLD(1000),L(1000)                       
     X,TITLE(17,10),TABL(1000),PHH1(100)                                        
     X,          PHT1(100),PRTIM(10)                                            
       COMMON/I2BYT/NY1,NY2,NZA,NXP,INXP,INWP,KEY,IPR,IPH                       
     X,NTHEAD,NTTAIL,NFLAG,IZ                                                   
      COMMON /LAB1/ PLOT(100,10),IPLOT(10),TMAX(1000)                           
      COMMON /LAB2/DATE(2)                                                      
      COMMON /LAB5/TITLE                                                        
      COMMON  ZZ                                                                
      EQUIVALENCE(ZZ(001),TIME),              (ZZ(002),Y(1),DYTCQ(1))           
     X,          (ZZ(3002),T(1)),                 (ZZ(4002),C(1))               
     X,          (ZZ(5002),Q(1)),                 (ZZ(6002),D(1))               
     X,          (ZZ(7002),A(1)),                 (ZZ(8002),B(1))               
     X,          (ZZ(9002),L(1)),                 (ZZ(10002),GAIN(1))           
     X,       (ZZ(11002),CON(1)),       (ZZ(11010),CON9,SIGMA),                 
     X         (ZZ(11011),CON10,TZERO),         (ZZ(11032),PRTIM(1))  ,         
     X         (ZZ(11070),IERFL)                                                
      EQUIVALENCE(ZZ(11072),DTHETA),              (ZZ(11090),IXX)               
     X,          (ZZ(11081),IPHMAX),              (ZZ(11202),PHH1(1) )          
     X,          (ZZ(11077), IMIN),               (ZZ(11078), IMAX )            
     X,          (ZZ(11079), IXMIN),              (ZZ(11080), IXMAX)            
     X,          (ZZ(11083),IPFLAG),              (ZZ(11084),ISFLAG)            
     X,          (ZZ(11085),MAXNOT),              (ZZ(11086),MAXNOY)            
     X,          (ZZ(11087),NARITH),              (ZZ(11088),NCRIT )            
      EQUIVALENCE(ZZ(11091),NTLAST),              (ZZ(11092),NWW)               
     X,          (ZZ(11093),NXX),                 (ZZ(11094),NZZ)               
     X,          (ZZ(11095), W ),                 (ZZ(11096), X )               
     X,          (ZZ(11097), Z ) ,                (ZZ(11098), NTAB)             
     X,          (ZZ(11101),DTIME ),              (ZZ(11102),PHT1(1) )          
     X,          (ZZ(11099),CFLAG),               (ZZ(11100),ODTIME)            
     X,          (ZZ(15002),TABL(1) )                                           
      IF(NARITH.GT.0)TIME2= PRTIM(1)                                            
      DTIME2= TIME-TIME2                                                        
        RAD=57.296                                                              
        MEGA=1000000                                                            
      DO 304 IX = IMIN,IMAX                                                     
      KEYP = KEY(IX)                                                            
      KH = KEYP/100                                                             
                                                                                
      IF (NARITH .EQ. 0) IF(KH) 304,303,304                                     
  302 IF (KH) 321,307,303                                                       
  321 KEYP = KEYP+100                                                           
      GO TO 306                                                                 
  307 IXMIN = MIN0(IXMIN,IX)                                                    
      JPLT=0                                                                    
      JPCH=0                                                                    
      IXMAX = MAX0(IXMAX,IX)                                                    
  303 IF(KEYP) 306,304,305                                                      
  305 KEYM = KEYP - (100*KH)                                                    
      KT = (KEYM/10)+1                                                          
      KU = KEYM+11-(10*KT)                                                      
  306 NZZ= NZA(IX)/10000                                                        
      NZB1= MOD(NZA(IX),10000)                                                  
      NXX= NXP(IX)/10000                                                        
      NWW= MOD(NXP(IX),10000)                                                   
      NXD  = INXP(IX)                                                           
      NWD  = INWP(IX)                                                           
  311 X = DYTCQ(NXX)                                                            
      W = DYTCQ(NWW)                                                            
      IF (KEYP) 330,304,331                                                     
  330 NTAB = -KEYP                                                              
      IXX = IX                                                                  
      IF (NTAB .LT. 50) GO TO 350                                               
  352 CALL BIVAR                                                                
      GO TO 351                                                                 
  350 NPRE= NTHEAD(NTAB)                                                        
      XXX=  X                                                                   
      KXX= NXX                                                                  
      CALL TABXX(ZXX,XXX,NTAB,NPRE,KXX)                                         
      Z= ZXX                                                                    
      IF(NWW.GT.0)Z=Z*W                                                         
  351 IF (IERFL .EQ. 1) GO TO 312                                               
      GO TO 320                                                                 
  331 GO TO (101,110,120,130,140,150,160,170,180,190),KT                        
  101 KV = KU-1                                                                 
      GO TO (1,2,3,4,5,6,7,8,9,201)  ,KV                                        
    1 Z = X                                                                     
      GO TO 312                                                                 
    2 Z = 1.0/X                                                                 
      GO TO 312                                                                 
    3 Z = X * X                                                                 
      GO TO 312                                                                 
    4 Z = SQRT(ABS(X))                                                          
      GO TO 312                                                                 
    5 Z = X**3                                                                  
      GO TO 312                                                                 
    6 Z = X**4                                                                  
      GO TO 312                                                                 
    7 Z=ABS(X)                                                                  
      GOTO 312                                                                   
    8 Z= ERF(X)                                                                 
      GO TO 312                                                                 
    9 Z= ERFC(X)                                                                
      GO TO 312                                                                 
  110 GO TO (10,11,12,13,201,15,16,201,201,201)KU                              
   10 Z = EXP(X)                                                                
      GO TO 312                                                                 
   11 Z = EXP(2.30259*X)                                                        
      GO TO 312                                                                 
   12 Z = ALOG(X)                                                               
      GO TO 312                                                                 
   13 Z = ALOG10(X)                                                             
      GO TO 312                                                                 
   15 Z= X*DTIME2                                                               
      GO TO 312                                                                 
   16 Z=0.                                                                      
      IF(DTIME2.GT.0.)Z= X/DTIME2                                               
      GO TO 312                                                                 
  120 GO TO (20,21,22,23,24,25,26,201,201,201) , KU                             
 20    Z=SIN(X/RAD)                                                             
      GO TO 312                                                                 
 21    Z=COS(X/RAD)                                                             
      GO TO 312                                                                 
 22       Z=SIN(X/RAD)/COS(X/RAD)                                               
      GO TO 312                                                                 
23      Z=RAD*ATAN(SQRT(X**2/(1.-X**2)))                                        
        GOTO 312                                                                
24      Z=RAD*ATAN(SQRT((1.-X**2)/X**2))                                        
        GOTO 312                                                                
25      Z=RAD*ATAN(X)                                                           
        GOTO 312                                                                
   26 GO TO 201                                                                 
  130 GO TO (131,131,131,133,201,135,136,201,201,201)KU                        
  131 XE = EXP(X)                                                               
      GO TO (30,31,32)KU                                                       
   30 Z = (XE-(1.0/XE))/2.0                                                     
      GO TO 312                                                                 
   31 Z = (XE+(1.0/XE))/2.0                                                     
      GO TO 312                                                                 
   32 Z = (XE-(1.0/XE))/(XE+(1.0/XE))                                           
      GO TO 312                                                                 
  133 GO TO 201                                                                 
  135 Z= X/(1.-X)                                                               
      GO TO 312                                                                 
  136  NFLAG(NZZ-3000)=GAIN(IX)                                                 
       KEY(IX)=136                                                              
       GO TO 340                                                                
  140  GO TO(40,40,40,40,44,40,47,40,44,44)KU                                  
C                CALCULATE HEAT FLOW THROUGH PATH SPECIFIED                     
   40 NXXX=NXX                                                                  
      NA=  MOD(NY1(NXXX),MEGA)/1000                                             
      NB= MOD(NY1(NXXX),1000)                                                   
      IF(KU.EQ.6.OR.KU.EQ.8)GO TO 450                                           
      Z=Y(NXXX)*(T(NA)-T(NB))                                                   
      IF(CON(16).LE.0.) GO TO 141                                               
        IF(NFLAG(NA).NE.-4.AND.NFLAG(NB).NE.-4)GO TO 141                        
      TA=(T(NA)+TZERO)**4                                                       
      TB=(T(NB)+TZERO)**4                                                       
      Z= SIGMA*Y(NXXX)*(TA-TB)                                                  
  141 CONTINUE                                                                  
       IF(KU.EQ.2)Z=Z*DTIME2                                                    
       IF(KU.EQ.3)Z=AMAX1(ABS(T(NA)-T(NB)),1.)**.25                             
       IF(KU.EQ.4)Z=AMAX1(ABS(T(NA)-T(NB)),1.)**.33333                          
      GOTO 312                                                                   
   44 NA= MOD(NY1(NZZ),MEGA)/1000                                               
      NB= MOD(NY1(NZZ),1000)                                                    
      KXX= NZZ                                                                  
      IF(KU.EQ.10) GO TO 450                                                    
   45 X= 0.5*(T(NA)+T(NB))                                                      
      CALL TABXX(ZXX,XXX,NTAB,NPRE,KXX)                                         
      Z = ZXX                                                                   
      IXX=IX                                                                    
      NTAB=NXX                                                                  
      NPRE= NTHEAD(NTAB)                                                        
      XXX= X                                                                    
      IF(KU.EQ.5) Z= Z*W                                                        
      IF(IERFL-1)320,312,320                                                    
   47 NA= MOD(NY1(NWW),MEGA)/1000                                               
      NB= MOD(NY1(NWW),1000)                                                    
      KXX= NWW                                                                  
      GO TO 45                                                                  
  450 TA= T(NA)+ TZERO                                                          
      TB = T(NB)+TZERO                                                          
      Z = SIGMA*(TA**2+TB**2)*(TA+TB)                                           
      IF(KU.EQ.6) Z= Z*W                                                        
      GO TO 312                                                                 
  150 GO TO (50,51,52,53,54,55,56,57,58,59)KU                                  
   50 Z = X+W                                                                   
      GO TO 312                                                                 
   51 Z = X-W                                                                   
      GO TO 312                                                                 
   52 Z = X*W                                                                   
      GO TO 312                                                                 
   53 IF(W.NE.0.)GO TO 532                                                      
      WRITE(6,531) IX,NWW                                                       
  531 FORMAT(1H0,31X,'IN OPERATION',I5,'THE VALUE IN ',I5,                      
     1' WAS INVALID'/)                                                          
      Z= X                                                                      
      GO TO 312                                                                 
  532 Z= X/W                                                                    
                                                                                
      GO TO 312                                                                 
   54 Z=SQRT(ABS(X*W))                                                          
      GO TO 312                                                                 
   55 Z = (X+W)/2.0                                                             
      GO TO 312                                                                 
   56 IF (X .NE. W) GO TO 562                                                   
  561 Z = X                                                                     
      WRITE(6,531) IX,NWW                                                       
      GO TO 312                                                                 
  562 Z = (X-W)/(ALOG(X/W))                                                     
      GO TO 312                                                                 
   57 Z = SQRT(X*X + W*W)                                                       
      GO TO 312                                                                 
   58 Z = 0.0                                                                   
      DENOM = 0.0                                                               
      DO 581 J=NXX,NWW                                                          
      Z = Z + DYTCQ(J)                                                          
  581 DENOM = DENOM + 1.0                                                       
      Z = Z/DENOM                                                               
      GO TO 312                                                                 
   59 JX = MOD(NXX,1000)                                                        
      JW = MOD(NWW,1000)                                                        
      SUMCT = 0.0                                                               
      SUMC = 0.0                                                                
      DO 591 J=JX,JW                                                            
      SUMCT = SUMCT + C(J)*T(J)                                                 
  591 SUMC = SUMC + C(J)                                                        
      IF (SUMC .GT. 0.0) GO TO 594                                              
  592 KEY(IX) = 159                                                             
      WRITE (6,593) JX,JW                                                       
  593 FORMAT (59H IMPOSSIBLE TO TAKE WEIGHTED AVERAGE OF ZERO CAPACITY N
     1ODES,I6, 8H THROUGH,I6)
      GO TO 304                                                                 
  594 Z = SUMCT/SUMC                                                            
      GO TO 312                                                                 
  160 GOTO(60,61,62,63,64,65,66,67,68,69)KU                                    
   60 IF(X.EQ.0..AND.W.EQ.0.)GO TO 561                                          
      Z= X**W                                                                   
      GO TO 312                                                                 
   61 IF(X.EQ.W)GOTO561                                                         
      Z=1./ALOG(X/W)                                                            
      GOTO 312                                                                   
   62 Z = 0.0                                                                   
      DO 620 J=NXX,NWW                                                          
  620 Z=Z+DYTCQ(J)                                                              
      GO TO 312                                                                 
   63 IXX=IX                                                                    
      GO TO 304                                                                 
   64 Z=EXP(X/(W+459.69))                                                       
      GOTO 312                                                                   
   65 Z=.5*(X-W)/GAIN(IX)**2                                                    
      GOTO 312                                                                   
   66 Z=W+X/GAIN(IX)                                                            
      GOTO 312                                                                   
   67 Z=.5*W*(W+2.*X)                                                           
      GOTO 312                                                                   
   68 Z=.5*(X+W)*(X-W)                                                          
      GOTO 312                                                                   
   69 IF(TIME.GT.PRTIM(1)) GO TO 1002                                           
      NCUT=1                                                                    
      TT=X                                                                      
 1002 IF(TT.GT.TIME)GOTO 340                                                     
      GOTO(1004,1005),NCUT                                                      
 1004 TT=TT+W                                                                   
      NCUT=2                                                                    
      Z=0.                                                                      
      GOTO 312                                                                   
 1005 TT=TT+X                                                                   
      NCUT=1                                                                    
      Z=1.                                                                      
      GOTO 312                                                                   
  170 GO TO (70,71,72,73,74,75,76,77,78,201),KU                                 
   70 Z = AMOD(X,W)                                                             
      GO TO 312                                                                 
   71 Z = AMAX1(X,W)                                                            
      GO TO 312                                                                 
   72 Z = AMIN1(X,W)                                                            
      GO TO 312                                                                 
   73 IF (W) 171,340,340                                                        
   74 IF (W) 340,171,340                                                        
   75 IF (W) 340,340,171                                                        
  171 Z = X                                                                     
      GO TO 312                                                                 
   76 IF (TIME .LT. W) GO TO 340                                                
  761 Z = X                                                                     
      GO TO 312                                                                 
   77 IF (X .GE. W) GO TO 772                                                   
  771 Z = 0.0                                                                   
      GO TO 312                                                                 
  772 Z = 1.0                                                                   
      GO TO 312                                                                 
   78 IF (X-W) 772,771,771                                                      
  180 GO TO (80,81,82,83,84,85,86,87,88,89),KU                                  
   80 IF(X.LT.W)GOTO 340                                                         
  801 KEY(IX) = KEY(IX)+100                                                     
  802 NZZZ = MOD(NZZ,1000)                                                      
      NFLAG(NZZZ)=-1                                                            
      GO TO 340                                                                 
   81 IF(X.LT.W)GOTO 340                                                         
  803 KEY(IX)=KEY(IX)+100                                                       
      NZZZ=MOD(NZZ,1000)                                                        
      NFLAG(NZZZ)=1                                                             
      GOTO 340                                                                   
   82 Z=0.                                                                      
      IF(DTIME2.GT.0.)Z=(X-W)/DTIME2                                            
      GOTO 312                                                                   
   83 Z=X*W/(W+X)                                                               
      GO TO 312                                                                 
   84 Z= DYTCQ(NZZ)*X*W                                                         
      GO TO 312                                                                 
   85 IF(X.LE.W) GO TO 340                                                      
      IPFLAG = 1                                                                
      KEY(IX) = 185                                                             
      GO TO 340                                                                 
   86 IF(X-W) 304,831,831                                                       
   87 IF(X-W) 304,832,832                                                       
  831 KEY(IX)=KEY(IX)+100                                                       
  832 DYTCQ(NZZ)=DYTCQ(NZZ)+GAIN(IX)                                            
      GO TO 304                                                                 
   88 NZZZ= MOD(NZZ,1000)                                                       
      KEY(IX)= KEY(IX)+100                                                      
      DO 880 J1= 1,IPHMAX                                                       
      IF(NZZZ.EQ.IPH(J1)) GO TO 882                                             
  880 CONTINUE                                                                  
      WRITE(6,531) IX,NZZZ                                                      
      GO TO 340                                                                 
  882 PHH1(J1)= PHH1(J1)*X                                                      
      GO TO 340                                                                 
   89 GO TO 201                                                                 
  190 GOTO(90,91,92,92,94,95,96,97,98,99),KU                                    
   90 IF(X.LE.W) GO TO 340                                                      
  901 NZZZ=MOD(NZZ,10)                                                          
      WRITE(6,902)(TITLE(M,NZZZ),M=1,17)                                        
  902 FORMAT(11X,17A4)                                                          
      KEY(IX)=100+KEY(IX)                                                       
      GOTO 340                                                                   
   91 NZZZ=MOD(NZZ,100)                                                         
      IF(NZZ.LE.30)CON(NZZZ)=GAIN(IX)*X                                         
      GOTO304                                                                   
   92 JZ=2*MOD(NZZ,1000)                                                        
      IF(IABS(JZ-6).GE.5)GOTO928                                                
      IF(NARITH.GT.0)IPLOT(JZ)=0                                                
      IF(IPLOT(JZ).GE.100) GO TO 340                                            
      IF(KU.EQ.4)GOTO93                                                         
                                                                                
      IF(IPFLAG.LE.0)GOTO 340                                                    
      IPLOT(JZ)=IPLOT(JZ)+1                                                     
      JPLOT=IPLOT(JZ)                                                           
      PLOT(JPLOT,JZ)=X                                                          
      PLOT(JPLOT,JZ-1)=W                                                        
      GOTO 340                                                                   
  928 WRITE(6,929)JZ                                                            
  929 FORMAT(15H  PLOT VARIABLE,I6,26H IS OUTSIDE RANGE OF ARRAY)               
      KEY(IX)=192                                                               
      GOTO 340                                                                   
   93 IF(ISFLAG.LE.0)GOTO 340                                                    
      IF(IABS(JZ-6).GE.5)GOTO928                                                
      ILOOP =GAIN(IX)+.01                                                       
      DO 934 M=1,ILOOP                                                          
      IF(IPLOT(JZ).GE.100) GO TO 340                                            
      IPLOT(JZ)=1+IPLOT(JZ)                                                     
      JPLOT=IPLOT(JZ)                                                           
      INXX=NXX+M-1                                                              
      INWW=NWW+M-1                                                              
      PLOT(JPLOT,JZ)=DYTCQ(INXX)                                                
  934 PLOT(JPLOT,JZ-1)=DYTCQ(INWW)                                              
      GOTO 340                                                                   
  94   CALL USER1                                                               
       GO TO 312                                                                
  95   CALL USER2                                                               
       GO TO 312                                                                
   96 ABJ=GAIN(IX)                                                              
      IXX= IX                                                                   
      JBA=ABJ+.01                                                               
      NDXX=MOD(JBA,100)                                                         
      NTABXX=JBA/100                                                            
      CALL INTGRT(X,W,NDXX,NTABXX,Z)                                            
      DYTCQ(NZZ)=Z                                                              
      GOTO 340                                                                   
   97 NXXX=MOD(NXX,100)                                                         
      IF(NXXX.LE.30) Z= CON(NXXX)                                               
      GO TO 312                                                                 
   98 IXX= IX                                                                   
       IF(X.GE.W)CALL SUB98                                                     
      GO TO 304                                                                 
   99 IF(X.LE.W) GO TO 340                                                      
  991 IPFLAG = 1.0                                                              
      ISFLAG = 1.0                                                              
      GO TO 340                                                                 
  312 DYTCQ(NZZ) = Z*GAIN(IX)                                                   
       IF(KT.LE.4.AND.NWW.GT.0)DYTCQ(NZZ)=W*DYTCQ(NZZ)                          
  340 IF(NZB1.LE.NZZ) GO TO 304                                                 
  332 NZZ= NZZ + IZ(IX)                                                         
      IF (NZZ .GT. NZB1) GO TO 304                                              
  333 NXX = NXX+NXD                                                             
      NWW = NWW+NWD                                                             
      GO TO 311                                                                 
  304 CONTINUE                                                                  
      TIME2=TIME                                                                
      IF (NARITH .NE. 1) GO TO 309                                              
  308 IMIN = IXMIN                                                              
      IMAX = IXMAX                                                              
      NARITH = 0                                                                
  309 RETURN                                                                    
  201 WRITE (6,202)IX                                                           
  202 FORMAT (1H0,43H NONEXISTENT ARITHMETIC OPERATION INDICATED,I5)  
  320 IERFL = 2                                                                 
      GO TO 309                                                                 
      END                                                                       
