Fortran Functions with a pointer result in a normal assignment
问题 After some discussion on the question found here Correct execution of Final routine in Fortran I thought it will be useful to know when a function with a pointer result is appropriate to use with a normal or a pointer assignment. For example, given this simple function function pointer_result(this) implicit none type(test_type),intent(in) pointer :: this type(test_type), pointer :: pointer_result allocate(pointer_result) end function I would normally do test=>pointer_result(test) , where test