smooth Subroutine

public subroutine smooth(n, xin, yin, var, yout, ifail)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real, intent(in), dimension (:) :: xin
real, intent(in), dimension (:) :: yin
real, intent(inout) :: var
real, intent(out), dimension (:) :: yout
integer, intent(out) :: ifail

Contents

Source Code


Source Code

  subroutine smooth (n, xin, yin, var, yout, ifail)
    implicit none

    integer, intent(in) :: n
    real, dimension (:), intent (in) :: xin, yin
    real, dimension (:), intent (out) :: yout
    real, intent(in out) :: var
    integer, intent(out) :: ifail

! these next arrays should be double precision, which we usually get with 
! compiler options
    real, dimension (1) :: se
    real, dimension (:), allocatable :: x, f, y, df
    real, dimension (:,:), allocatable :: wk, c
    real :: dvar

    allocate (x(n), f(n), y(n), df(n), c(n, 3))
    allocate (wk(n+2,7))

    ifail = 0
    x = xin
    f = yin
    df = 1.
    dvar=var
    call cubgcv (x,f,df,n,y,c,n,dvar,0,se,wk,ifail)
    var=dvar
    yout = y

    deallocate (x, f, y, df, c, wk)

  end subroutine smooth