module dummy
  
  type pippo
     real(8), allocatable :: vec(:)
  end type pippo

  public 

contains
  
  subroutine initstruct(struct)

    type(pippo), intent(out) :: struct
    
    allocate(struct%vec(1:10))
    struct%vec = 1.0d0
    
    print *,allocated(struct%vec),"initstruct"

  end subroutine initstruct

  subroutine initvec(vect)

    real(8), allocatable, intent(out) :: vect(:)
    
    allocate(vect(1:10))
    vect = 1.0d0
    
    print *,allocated(vect),"initvec"

  end subroutine initvec

  subroutine freestruct(struct)
    
    type(pippo), intent(inout) :: struct
    
    deallocate(struct%vec)

  end subroutine freestruct

end module dummy
