program test_save

  integer i
  
  do i=0,10
     call sr1
  end do
  
contains
  
  subroutine sr1()
    
    integer, save :: i = 0
    
    i = i + 1

    print *, i
    
  end subroutine sr1

end program test_save
