Hello,

I was wondering if there was a way of squaring a vector or a scalar with the same function? Basically, i’m wondering if these two functions:

function f(x)

real(kind=8) :: f, x

f = x**2/2

end function

end program test

function square(x)

real(kind=8),allocatable :: x(:), square(: )

square = 0.5*x**2

end function

could be fused into one?