      SUBROUTINE PIVOT(X,REF,DX,N,IS,NEXT,DELP,NP,LOOP)                 00000100
      INTEGER X(1),REF(1),DX(1),NEXT,DELP,NP*2                          00000110
C                                            =W82JS.PIVOT               00000120
C        ONLY CR-6,                                                     00000130
C     PIVOT CORRECTION IS NOT MADE ON THE LAST                          00000140
C     VALUES IN EACH STATUS BLOCK (288 SEC) OF 150 PRIME                00000150
C     AND 75 SECONDARY VALUES                                           00000160
C                                                                       00000170
C     UNCORRECTED     P      S                                          00000180
C          X         30     15                                          00000190
C          Y         20     10                                          00000200
C          Z         10      5                                          00000210
C                                                                       00000220
C        ONLY CR-5,                                                     00000230
C     PIVOT CORRECTION IS NOT MADE ON THE LAST                          00000240
C     VALUES IN EACH STATUS BLOCK ( 48 SEC) OF 200 PRIME                00000250
C     AND 50 SECONDARY VALUES                                           00000260
C                                                                       00000270
C     UNCORRECTED     P      S                                          00000280
C          X         20     10                                          00000290
C          Y         20     10                                          00000300
C          Z         20     10                                          00000310
C                                                                       00000320
      L = 1                                                             00000330
      I2 = IS - 1                                                       00000340
      K = N - IS                                                        00000350
      J1 = 1                                                            00000360
      IF(IS .EQ. N) J1 = 2                                              00000370
      DO 30 J=J1,LOOP                                                   00000380
      IF((REF(J).LE.0) .OR. (X(I2).LE.0) .OR. (DX(J).EQ.99999)) GO TO 2500000390
      DEL = (REF(J) - (X(I2)-DX(J)))/FLOAT(N)                           00000400
      DO 20 I=L,I2                                                      00000410
      K = K + 1                                                         00000420
      IF(X(I) .LE. 0) GO TO 20                                          00000430
      X(I) = X(I) + IFIX(DEL*K + SIGN(0.5,DEL))                         00000440
  20  CONTINUE                                                          00000450
  25  L = I2 + 2                                                        00000460
      I2 = L + N - 2                                                    00000470
      K = 0                                                             00000480
  30  CONTINUE                                                          00000490
C                       FINISH REMAINDER OF PIVOT                       00000500
      IF((NEXT .EQ. 0) .OR. (DELP .EQ. 99999)) RETURN                   00000510
      DEL = (NEXT - DELP)/FLOAT(N)                                      00000520
      DO 40 I=L,NP                                                      00000530
      K = K + 1                                                         00000540
      IF(X(I) .LE. 0) GO TO 40                                          00000550
      X(I) = X(I) + IFIX(DEL*K + SIGN(0.5,DEL))                         00000560
  40  CONTINUE                                                          00000570
      RETURN                                                            00000580
      END                                                               00000590
