function largest(a,b) implicit none integer,target,intent(in) :: a,b integer,pointer :: largest if (a.gt.b) then largest => a else largest => b end if end function largest
Using the generalized pointer assignment form
pointer => ptr_expression(ptr_expression returns a pointer result), the function name must identify a target by being the LHS of a pointer assignment
integer, pointer :: greater greater => largest(a,b)The interface of an external pointer valued function must always be explicit.