2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / compile / pr40413.f90
blobd8fa73d6991c27bb8ef6b8c2aa77ce73713fb23e
1 module state_matrices
3 implicit none
4 private
6 public :: state_matrix_copy
7 public :: state_matrix_t
8 public :: matrix_element_t
10 type :: matrix_element_t
11 private
12 integer, dimension(:), allocatable :: f
13 end type matrix_element_t
15 type :: state_matrix_t
16 private
17 type(matrix_element_t), dimension(:), allocatable :: me
18 end type state_matrix_t
20 type :: polarization_t
21 logical :: polarized = .false.
22 integer :: spin_type = 0
23 integer :: multiplicity = 0
24 type(state_matrix_t) :: state
25 end type polarization_t
27 contains
29 function polarization_copy (pol_in) result (pol)
30 type(polarization_t) :: pol
31 type(polarization_t), intent(in) :: pol_in
32 !!! type(state_matrix_t) :: state_dummy
33 pol%polarized = pol_in%polarized
34 pol%spin_type = pol_in%spin_type
35 pol%multiplicity = pol_in%multiplicity
36 !!! state_dummy = state_matrix_copy (pol_in%state)
37 !!! pol%state = state_dummy
38 pol%state = state_matrix_copy (pol_in%state)
39 end function polarization_copy
41 function state_matrix_copy (state_in) result (state)
42 type(state_matrix_t) :: state
43 type(state_matrix_t), intent(in), target :: state_in
44 end function state_matrix_copy
46 end module state_matrices