CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C   FFTPACK 5.0
C   Copyright (C) 1995-2004, Scientific Computing Division,
C   University Corporation for Atmospheric Research
C   Licensed under the GNU General Public License (GPL)
C
C   Authors:  Paul N. Swarztrauber and Richard A. Valent
C
C   $Id: cfftmb.f,v 1.2 2006-11-21 01:10:16 haley Exp $
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

      SUBROUTINE DCFFTMB(LOT,JUMP,N,INC,C,LENC,WSAVE,LENSAV,WORK,
     +                   LENWRK,IER)
      INTEGER LOT,JUMP,N,INC,LENC,LENSAV,LENWRK,IER
      DOUBLE COMPLEX C(LENC)
      DOUBLE PRECISION WSAVE(LENSAV),WORK(LENWRK)
      LOGICAL DXERCON
C
      IER = 0
C
      IF (LENC.LT. (LOT-1)*JUMP+INC* (N-1)+1) THEN
          IER = 1
          CALL DXERFFT('CFFTMB ',6)
      ELSE IF (LENSAV.LT.2*N+INT(LOG(DBLE(N)))+4) THEN
          IER = 2
          CALL DXERFFT('CFFTMB ',8)
      ELSE IF (LENWRK.LT.2*LOT*N) THEN
          IER = 3
          CALL DXERFFT('CFFTMB ',10)
      ELSE IF (.NOT.DXERCON(INC,JUMP,N,LOT)) THEN
          IER = 4
          CALL DXERFFT('CFFTMB ',-1)
      END IF
C
      IF (N.EQ.1) RETURN
C
      IW1 = N + N + 1
      CALL DCMFM1B(LOT,JUMP,N,INC,C,WORK,WSAVE,WSAVE(IW1),WSAVE(IW1+1))
      RETURN
      END
