func Function

function func(x) result(f)

Test function to minimize.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

indep. variable

Return Value real(kind=wp)

function value f(x)


Source Code

    function func(x) result(f)

    implicit none

    real(wp),intent(in) :: x  !! indep. variable
    real(wp)            :: f  !! function value `f(x)`

    f = sin(x)

    end function func