func6 Function

public function func6(x) result(f)

Arguments

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

Return Value real(kind=rk), dimension(:), allocatable


Source Code

   function func6(x) result(f)
      real(rk), dimension(:), intent(in)  :: x
      real(rk), dimension(:), allocatable :: f

      allocate(f(3))

      f(1) = x(1)**2 + 0.5*x(2)**2
      f(2) = x(1)**3 + 0.5*x(2)**3
      f(3) = x(1)**4 + 0.5*x(2)**4

   end function func6