Welcome to the forum. Yes, there is, using elemental functions, for a scalar and conformable array arguments of any rank. Here is an example:
module m
implicit none
integer, parameter :: dp = kind(1.0d0)
contains
elemental function half_square(x) result(y)
real(kind=dp), intent(in) :: x
real(kind=dp) :: y
y = 0.5_dp*x**2
end function half_square
end module m
!
program main
use m, only: dp, half_square
implicit none
print*,half_square(real([1,4,9],kind=dp)) ! output: 0.5 8. 40.5
end program main
And here a nitpick: real(kind=8) may fail or, perhaps worse, mean something else than you expect, because the kind numbers, like 8 above, are not fixed between compilers. @Beliavsky showed a way to achieve double precision that ought to work with any compiler. Others exist as well.
The adagium is: never use literal constants for kinds, but use instead parameters.