      SUBROUTINE PASSF4(IDO,L1,CC,CH,WA1,WA2,WA3)
      DOUBLE PRECISION CC
      DOUBLE PRECISION CH
      DOUBLE PRECISION WA1
      DOUBLE PRECISION WA2
      DOUBLE PRECISION WA3
      DOUBLE PRECISION TI1
      DOUBLE PRECISION TI2
      DOUBLE PRECISION TR4
      DOUBLE PRECISION TI3
      DOUBLE PRECISION TR1
      DOUBLE PRECISION TR2
      DOUBLE PRECISION TI4
      DOUBLE PRECISION TR3
      DOUBLE PRECISION CR3
      DOUBLE PRECISION CI3
      DOUBLE PRECISION CR2
      DOUBLE PRECISION CR4
      DOUBLE PRECISION CI2
      DOUBLE PRECISION CI4
      DIMENSION CC(IDO,4,L1),CH(IDO,L1,4),WA1(*),WA2(*),WA3(*)

      IF (IDO.NE.2) GO TO 102
      DO 101 K = 1,L1
          TI1 = CC(2,1,K) - CC(2,3,K)
          TI2 = CC(2,1,K) + CC(2,3,K)
          TR4 = CC(2,2,K) - CC(2,4,K)
          TI3 = CC(2,2,K) + CC(2,4,K)
          TR1 = CC(1,1,K) - CC(1,3,K)
          TR2 = CC(1,1,K) + CC(1,3,K)
          TI4 = CC(1,4,K) - CC(1,2,K)
          TR3 = CC(1,2,K) + CC(1,4,K)
          CH(1,K,1) = TR2 + TR3
          CH(1,K,3) = TR2 - TR3
          CH(2,K,1) = TI2 + TI3
          CH(2,K,3) = TI2 - TI3
          CH(1,K,2) = TR1 + TR4
          CH(1,K,4) = TR1 - TR4
          CH(2,K,2) = TI1 + TI4
          CH(2,K,4) = TI1 - TI4
  101 CONTINUE
      RETURN
  102 DO 104 K = 1,L1
          DO 103 I = 2,IDO,2
              TI1 = CC(I,1,K) - CC(I,3,K)
              TI2 = CC(I,1,K) + CC(I,3,K)
              TI3 = CC(I,2,K) + CC(I,4,K)
              TR4 = CC(I,2,K) - CC(I,4,K)
              TR1 = CC(I-1,1,K) - CC(I-1,3,K)
              TR2 = CC(I-1,1,K) + CC(I-1,3,K)
              TI4 = CC(I-1,4,K) - CC(I-1,2,K)
              TR3 = CC(I-1,2,K) + CC(I-1,4,K)
              CH(I-1,K,1) = TR2 + TR3
              CR3 = TR2 - TR3
              CH(I,K,1) = TI2 + TI3
              CI3 = TI2 - TI3
              CR2 = TR1 + TR4
              CR4 = TR1 - TR4
              CI2 = TI1 + TI4
              CI4 = TI1 - TI4
              CH(I-1,K,2) = WA1(I-1)*CR2 + WA1(I)*CI2
              CH(I,K,2) = WA1(I-1)*CI2 - WA1(I)*CR2
              CH(I-1,K,3) = WA2(I-1)*CR3 + WA2(I)*CI3
              CH(I,K,3) = WA2(I-1)*CI3 - WA2(I)*CR3
              CH(I-1,K,4) = WA3(I-1)*CR4 + WA3(I)*CI4
              CH(I,K,4) = WA3(I-1)*CI4 - WA3(I)*CR4
  103     CONTINUE
  104 CONTINUE
      RETURN
      END
