rfft_1d_forward Subroutine

public subroutine rfft_1d_forward(func)

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(inout), dimension(:) :: func

Calls

proc~~rfft_1d_forward~~CallsGraph proc~rfft_1d_forward rfft_1d_forward rfft1f rfft1f proc~rfft_1d_forward->rfft1f rfft1i rfft1i proc~rfft_1d_forward->rfft1i

Called by

proc~~rfft_1d_forward~~CalledByGraph proc~rfft_1d_forward rfft_1d_forward interface~fft fft interface~fft->proc~rfft_1d_forward

Source Code

  subroutine rfft_1d_forward(func)
    real(8),dimension(:),intent(inout) :: func
    real(8),dimension(:),allocatable   :: wsave,work
    integer                            :: N,lenwrk,lensav,lenr,inc,ier
    N      = size(func)
    lenwrk = N
    lensav = N + int( log(dble(N))/log(2.d0) ) + 4
    lenr   = N
    inc    = 1
    allocate(wsave(lensav))
    allocate(work(lenwrk))
    call rfft1i(N,wsave,lensav,ier)
    if(ier==2)stop "rfft_1d_forward: LENSAV not big enough"
    call rfft1f(N,inc,func,lenr,wsave,lensav,work,lenwrk,ier)
    deallocate(wsave,work)
    select case(ier)
    case (0)
       return
    case (1)
       stop "rfft_1d_forward: LENR not big enough"
    case (2)
       stop "rfft_1d_forward: LENSAV not big enough"
    case (3)
       stop "rfft_1d_forward: LENWRK not big enough"
    case (20)
       stop "rfft_1d_forward: input error returned by lower level routine"
    end select
  end subroutine rfft_1d_forward