Fortran array cannot be returned in function: not a DUMMY variable
问题 Being new to Fortran 90 free-form, I would really like to know why the following piece of code snippet would not work: program test2 implicit none !!! A program to practice f90 writing. ! Define double precision data integer, parameter :: dp = kind(1.d0) real(dp) :: a(3), b(3) integer :: i a = (/(i, i=1, 3)/) b = (/(i, i=1, 3)/) write (*, *) m31tensorprod(a, b) contains function m31tensorprod(a, b) real(dp), dimension(3), intent(in) :: a, b real(dp), intent(out) :: m31tensorprod(3, 3) integer