1 ! Copyright 2016-2019 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/>.
18 integer, allocatable
:: ivla (:, :, :)
21 integer, allocatable
:: ivla1 (:, :, :)
22 integer, allocatable
:: ivla2 (:, :)
26 integer, allocatable
:: ivla (:)
29 integer, allocatable
:: ivla (:)
36 type(one
), target
:: onev
41 type(five
) :: fivearr (2)
42 type(five
), allocatable
:: fivedynarr (:)
46 allocate (onev
%ivla (11,22,33)) ! before-allocated
47 l
= allocated(onev
%ivla
)
49 onev
%ivla(:, :, :) = 1
50 onev
%ivla(1, 2, 3) = 123
51 onev
%ivla(3, 2, 1) = 321
53 allocate (twov
%ivla1 (5,12,99)) ! onev-filled
54 l
= allocated(twov
%ivla1
)
55 allocate (twov
%ivla2 (9,12))
56 l
= allocated(twov
%ivla2
)
58 twov
%ivla1(:, :, :) = 1
59 twov
%ivla1(1, 2, 3) = 123
60 twov
%ivla1(3, 2, 1) = 321
66 threev
%ivar
= 3 ! twov-filled
67 allocate (threev
%ivla (20))
68 l
= allocated(threev
%ivla
)
74 allocate (fourv
%ivla (10)) ! threev-filled
75 l
= allocated(fourv
%ivla
)
82 allocate (fivev
%tone
%ivla (10, 10, 10)) ! fourv-filled
83 l
= allocated(fivev
%tone
%ivla
)
84 fivev
%tone
%ivla(:, :, :) = 1
85 fivev
%tone
%ivla(1, 2, 3) = 123
86 fivev
%tone
%ivla(3, 2, 1) = 321
88 allocate (fivearr(1)%tone
%ivla (2, 4, 6)) ! fivev-filled
89 allocate (fivearr(2)%tone
%ivla (12, 14, 16))
90 fivearr(1)%tone
%ivla(:, :, :) = 1
91 fivearr(1)%tone
%ivla(2, 2, 3) = 223
92 fivearr(2)%tone
%ivla(:, :, :) = 2
93 fivearr(2)%tone
%ivla(6, 7, 8) = 678
95 allocate (fivedynarr(2)) ! fivearr-filled
96 allocate (fivedynarr(1)%tone
%ivla (2, 4, 6))
97 allocate (fivedynarr(2)%tone
%ivla (12, 14, 16))
98 fivedynarr(1)%tone
%ivla(:, :, :) = 1
99 fivedynarr(1)%tone
%ivla(2, 2, 3) = 223
100 fivedynarr(2)%tone
%ivla(:, :, :) = 2
101 fivedynarr(2)%tone
%ivla(6, 7, 8) = 678
103 l
= allocated(fivedynarr
) ! fivedynarr-filled
104 end program vla_struct