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: rfft1b.f,v 1.2 2006-11-21 01:10:19 haley Exp $
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

      SUBROUTINE DRFFT1B(N,INC,R,LENR,WSAVE,LENSAV,WORK,LENWRK,IER)
      INTEGER N,INC,LENR,LENSAV,LENWRK,IER
      DOUBLE PRECISION R(LENR),WSAVE(LENSAV),WORK(LENWRK)
C
      IER = 0
C
      IF (LENR.LT.INC* (N-1)+1) THEN
          IER = 1
          CALL DXERFFT('RFFT1B ',6)
      ELSE IF (LENSAV.LT.N+INT(LOG(DBLE(N)))+4) THEN
          IER = 2
          CALL DXERFFT('RFFT1B ',8)
      ELSE IF (LENWRK.LT.N) THEN
          IER = 3
          CALL DXERFFT('RFFT1B ',10)
      END IF
C
      IF (N.EQ.1) RETURN
C
      CALL DRFFTB1(N,INC,R,WORK,WSAVE,WSAVE(N+1))
      RETURN
      END
