module mod_bug implicit none contains subroutine init logical, save :: first_time=.true. print *, " first_time =", first_time first_time=.false. return end subroutine init subroutine sub2 type :: index_list_type integer, dimension(:), pointer :: p => null() end type index_list_type type (index_list_type) :: xlist end subroutine sub2 subroutine sub3 integer, dimension(:), allocatable, save :: ufac end subroutine sub3 end module mod_bug program pbug use mod_bug implicit none call init call init end program pbug