Aliasing in Fortran function
问题 For optimisation reasons, Fortran enforces that the dummy arguments of a subroutine or function are not alias, i.e., they do not point the the same memory place. I am wondering if the same constraint applies to the returned value of a function. In other words, for a given myfunc function: function myfunc(a) real, intent(in) :: a(:) real :: myfunc(size(a)) myfunc = a * 2 end function myfunc is it standard-compliant to write: a = myfunc(a) and b = myfunc(a) ? 回答1: The arguments of a function