2 ! Test the fix for PR48456 and PR48360 in which the backend
3 ! declarations for components were not located in the automatic
4 ! reallocation on assignments, thereby causing ICEs.
6 ! Contributed by Keith Refson <krefson@googlemail.com>
7 ! and Douglas Foulds <mixnmaster@gmail.com>
13 real, dimension(3,3) :: h0
19 real, allocatable, save, dimension(:,:) :: hmat
30 end subroutine assignit
37 integer, parameter :: dp = kind(0.d0)
40 real(dp), dimension(5) :: some_vector
44 type(my_type_sub) :: some_element
47 end module custom_type
49 module custom_interfaces
52 subroutine store_data_subroutine(vec_size)
54 integer, intent(in) :: vec_size
56 end subroutine store_data_subroutine
59 end module custom_interfaces
61 module store_data_test
66 type(my_type), dimension(:), allocatable :: some_type_to_save
68 end module store_data_test
78 call store_data_subroutine(vec_size)
79 call print_after_transfer()
83 subroutine store_data_subroutine(vec_size)
90 integer, intent(in) :: vec_size
93 allocate(some_type_to_save(vec_size))
97 some_type_to_save(k)%some_element%some_vector(1) = 1.0_dp
98 some_type_to_save(k)%some_element%some_vector(2) = 2.0_dp
99 some_type_to_save(k)%some_element%some_vector(3) = 3.0_dp
100 some_type_to_save(k)%some_element%some_vector(4) = 4.0_dp
101 some_type_to_save(k)%some_element%some_vector(5) = 5.0_dp
105 end subroutine store_data_subroutine
107 subroutine print_after_transfer()
114 real(dp), dimension(:), allocatable :: C_vec
119 do k = 1,size(some_type_to_save)
121 C_vec = some_type_to_save(k)%some_element%some_vector
122 print *, "C_vec", C_vec
126 end subroutine print_after_transfer