cost_1d_backward Subroutine

public subroutine cost_1d_backward(func)

Arguments

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

Calls

proc~~cost_1d_backward~2~~CallsGraph proc~cost_1d_backward~2 cost_1d_backward cost1b cost1b proc~cost_1d_backward~2->cost1b cost1i cost1i proc~cost_1d_backward~2->cost1i

Called by

proc~~cost_1d_backward~2~~CalledByGraph proc~cost_1d_backward~2 cost_1d_backward interface~icosft~2 icosft interface~icosft~2->proc~cost_1d_backward~2

Source Code

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