1 ! Copyright 2021-2023 Free Software Foundation, Inc.
3 ! This program is free software; you can redistribute it and/or modify
4 ! it under the terms of the GNU General Public License as published by
5 ! the Free Software Foundation; either version 3 of the License, or
6 ! (at your option) any later version.
8 ! This program is distributed in the hope that it will be useful,
9 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ! GNU General Public License for more details.
13 ! You should have received a copy of the GNU General Public License
14 ! along with this program. If not, see <http://www.gnu.org/licenses/>.
20 integer(kind=4) :: spacer
24 ! A first dynamic type. The array is of a static type.
26 integer(kind=4) :: spacer
27 type(type1), allocatable :: t2_array(:)
30 ! Another dynamic type, the array is again a static type.
32 integer(kind=4) :: spacer
33 type(type1), pointer :: t3_array(:)
36 ! A dynamic type, this time the array contains a dynamic type.
38 integer(kind=4) :: spacer
39 type(type2), allocatable :: t4_array(:)
42 ! A static type, the array though contains dynamic types.
44 integer(kind=4) :: spacer
45 type(type2) :: t5_array (4)
48 ! A static type containing pointers to a type that contains a
51 type(type2), pointer :: ptr_1
52 type(type2), pointer :: ptr_2
55 real, dimension(:), pointer :: var1
56 real, dimension(:), allocatable :: var2
58 type(type2), target :: var4
68 allocate (var4%t2_array(3))
70 allocate (var5%t3_array(3))
72 allocate (var6%t4_array(3))
73 allocate (var6%t4_array(1)%t2_array(2))
74 allocate (var6%t4_array(2)%t2_array(5))
75 allocate (var6%t4_array(3)%t2_array(4))
77 allocate (var7%t5_array(1)%t2_array(2))
78 allocate (var7%t5_array(2)%t2_array(5))
79 allocate (var7%t5_array(3)%t2_array(4))
80 allocate (var7%t5_array(4)%t2_array(1))
85 print *, var1 ! Break Here
88 print *, var4%t2_array(1)
89 print *, var5%t3_array(2)
90 print *, var6%t4_array(1)%t2_array(1)
91 print *, var7%t5_array(1)%t2_array(1)