      SUBROUTINE PASSB3(IDO,L1,CC,CH,WA1,WA2)
      DOUBLE PRECISION CC
      DOUBLE PRECISION CH
      DOUBLE PRECISION WA1
      DOUBLE PRECISION WA2
      DOUBLE PRECISION TAUR
      DOUBLE PRECISION TAUI
      DOUBLE PRECISION TR2
      DOUBLE PRECISION CR2
      DOUBLE PRECISION TI2
      DOUBLE PRECISION CI2
      DOUBLE PRECISION CR3
      DOUBLE PRECISION CI3
      DOUBLE PRECISION DR2
      DOUBLE PRECISION DR3
      DOUBLE PRECISION DI2
      DOUBLE PRECISION DI3
      DIMENSION CC(IDO,3,L1),CH(IDO,L1,3),WA1(*),WA2(*)
      DATA TAUR,TAUI/-.5D0,.866025403784439D0/

      IF (IDO.NE.2) GO TO 102
      DO 101 K = 1,L1
          TR2 = CC(1,2,K) + CC(1,3,K)
          CR2 = CC(1,1,K) + TAUR*TR2
          CH(1,K,1) = CC(1,1,K) + TR2
          TI2 = CC(2,2,K) + CC(2,3,K)
          CI2 = CC(2,1,K) + TAUR*TI2
          CH(2,K,1) = CC(2,1,K) + TI2
          CR3 = TAUI* (CC(1,2,K)-CC(1,3,K))
          CI3 = TAUI* (CC(2,2,K)-CC(2,3,K))
          CH(1,K,2) = CR2 - CI3
          CH(1,K,3) = CR2 + CI3
          CH(2,K,2) = CI2 + CR3
          CH(2,K,3) = CI2 - CR3
  101 CONTINUE
      RETURN
  102 DO 104 K = 1,L1
          DO 103 I = 2,IDO,2
              TR2 = CC(I-1,2,K) + CC(I-1,3,K)
              CR2 = CC(I-1,1,K) + TAUR*TR2
              CH(I-1,K,1) = CC(I-1,1,K) + TR2
              TI2 = CC(I,2,K) + CC(I,3,K)
              CI2 = CC(I,1,K) + TAUR*TI2
              CH(I,K,1) = CC(I,1,K) + TI2
              CR3 = TAUI* (CC(I-1,2,K)-CC(I-1,3,K))
              CI3 = TAUI* (CC(I,2,K)-CC(I,3,K))
              DR2 = CR2 - CI3
              DR3 = CR2 + CI3
              DI2 = CI2 + CR3
              DI3 = CI2 - CR3
              CH(I,K,2) = WA1(I-1)*DI2 + WA1(I)*DR2
              CH(I-1,K,2) = WA1(I-1)*DR2 - WA1(I)*DI2
              CH(I,K,3) = WA2(I-1)*DI3 + WA2(I)*DR3
              CH(I-1,K,3) = WA2(I-1)*DR3 - WA2(I)*DI3
  103     CONTINUE
  104 CONTINUE
      RETURN
      END
