fortran function to return an array
FUNCTION MyFuncName(Param1, Param2, ...) RESULT( resultName )
IMPLICIT NONE
TYPE, DIMENSION(...) :: resultName
TYPE [, Intention] :: Param1
TYPE [, Intention] :: Param2
....
END ! Ends subroutine definition
NOTE: You can use input parameters in the
result array declaration !!!
NOTE: You can function name instead of a result variable