cost_1d_forward Subroutine

public subroutine cost_1d_forward(func)

Arguments

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

Calls

proc~~cost_1d_forward~2~~CallsGraph proc~cost_1d_forward~2 cost_1d_forward cost1f cost1f proc~cost_1d_forward~2->cost1f cost1i cost1i proc~cost_1d_forward~2->cost1i

Called by

proc~~cost_1d_forward~2~~CalledByGraph proc~cost_1d_forward~2 cost_1d_forward interface~cosft~2 cosft interface~cosft~2->proc~cost_1d_forward~2

Source Code

  subroutine cost_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)
    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_forward: LENSAV not big enough"
    if(ier==20)stop "cost_1d_forward: error returned by lower level routine"
    call cost1f(N,inc,func,lenr,wsave,lensav,work,lenwrk,ier)
    deallocate(wsave,work)
    select case(ier)
    case (0)
       return
    case (1)
       stop "cost_1d_forward: LENR not big enough"
    case (2)
       stop "cost_1d_forward: LENSAV not big enough"
    case (3)
       stop "cost_1d_forward: LENWRK not big enough"
    case (20)
       stop "cost_1d_forward: input error returned by lower level routine"
    end select
  end subroutine cost_1d_forward