program test_saves

   implicit none

   call asub ( 3, .TRUE. )
   call asub ( 4, .FALSE. )

contains

subroutine asub (i, control)

   implicit none

   integer, intent (in) :: i
   logical, intent (in) :: control

   integer :: j = 0
   !integer, save :: j = 0
   !integer :: j = 0    ! save is superfluous because of the initialization
   integer :: k

   j = j + i
   if ( control ) k = 0
   k = k + i

   write (*, *) '### ASUB: i, j, k=', i, j, k

end subroutine asub

end program test_saves
