Oracle® Solaris Studio 12.4: Fortran User's Guide

Exit Print View

Updated: March 2015
 
 

4.6.11 Fortran 2003 POINTER INTENT Feature

The Fortran compiler now supports the INTENT attribute for POINTER dummy arguments: INTENT(IN), INTENT(OUT), or INTENT(INOUT) may be specified for pointer dummies.

For example,

subroutine sub(P)
integer, pointer, intent(in) :: p
...

end

The INTENT attribute for pointers applies to the pointer and not what it points to, so for INTENT(IN) pointers, the following are illegal because they modify the pointer:

 p => t
 allocate(p)
 deallocate(p)

But the following is legal for INTENT(IN) pointers, because it modifies the pointee:

 p = 400