!------------------------------------------------------------------------------
!
!  Program name:
!
!    vs_ordinary_assignments
!
!  Purpose:
!
!    Contrast with the program p_assign.f90, 
!    this program illustrates pointer assignments vs ordinary 
!    assignments. 
!
!------------------------------------------------------------------------------

PROGRAM vs_ordinary_assignments

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

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

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

  p2 = p1                   ! ordinary assignment
                            ! equivalent to t2 = t1
  PRINT *, t1, p1, t2, p2   ! all 3.4

END PROGRAM vs_ordinary_assignments

