!------------------------------------------------------------------------------
!
!  Program name:
!
!    pointer_assignment
!
!  Purpose:
!
!    This program illustrates the use of pointer assignment 
!    statements.
!
!------------------------------------------------------------------------------

PROGRAM pointer_assignments

  IMPLICIT NONE
  REAL, POINTER :: p1, p2
  REAL, TARGET :: t1 = 3.4, t2 = 4.5

  p1 => t1                  ! p1 points to t1
  PRINT *, p1, t1           ! all 3.4

  p2 => t2                  ! p2 points to t2
  PRINT *, p2, t2           ! all 4.5

  p2 => p1                  ! p2 points to the target of p1
                            ! t2 reamins unchange
  PRINT *, p1, t1, p2, t2   ! p1, t1 and p2 all 3.4, t2 remains 4.5  

END PROGRAM pointer_assignments
