program myscope

  implicit none
  real :: b = 2.0

  print *, 'before call xx: myscope b = ',b
  call xx
  print *, 'after call xx: myscope b = ',b
  
  call yy
  
  contains

!===============================================
  subroutine xx

  real :: b = 45.
    
  print *, '>>> xx: b = ',b

  end subroutine xx
!===============================================
  subroutine yy
    
  print *, '>>> yy: b = ',b

  end subroutine yy
!===============================================

end program myscope
