|
11 | 11 | #endif |
12 | 12 | select type(array) |
13 | 13 | type is(complex) |
14 | | - intrinsic_array%complex_1D = array |
| 14 | + allocate(intrinsic_array%complex_1D, source = array) |
15 | 15 | type is(integer) |
16 | | - intrinsic_array%integer_1D = array |
| 16 | + allocate(intrinsic_array%integer_1D, source = array) |
17 | 17 | type is(logical) |
18 | | - intrinsic_array%logical_1D = array |
| 18 | + allocate(intrinsic_array%logical_1D, source = array) |
19 | 19 | type is(real) |
20 | | - intrinsic_array%real_1D = array |
| 20 | + allocate(intrinsic_array%real_1D, source = array) |
21 | 21 | type is(double precision) |
22 | | - intrinsic_array%double_precision_1D = array |
| 22 | + allocate(intrinsic_array%double_precision_1D, source = array) |
23 | 23 | class default |
24 | 24 | error stop "intrinsic_array_t construct: unsupported rank-2 type" |
25 | 25 | end select |
26 | 26 | #ifndef NAGFOR |
27 | 27 | rank(2) |
28 | 28 | select type(array) |
29 | 29 | type is(complex) |
30 | | - intrinsic_array%complex_2D = array |
| 30 | + allocate(intrinsic_array%complex_2D, source = array) |
31 | 31 | type is(integer) |
32 | | - intrinsic_array%integer_2D = array |
| 32 | + allocate(intrinsic_array%integer_2D, source = array) |
33 | 33 | type is(logical) |
34 | | - intrinsic_array%logical_2D = array |
| 34 | + allocate(intrinsic_array%logical_2D, source = array) |
35 | 35 | type is(real) |
36 | | - intrinsic_array%real_2D = array |
| 36 | + allocate(intrinsic_array%real_2D, source = array) |
37 | 37 | type is(double precision) |
38 | | - intrinsic_array%double_precision_2D = array |
| 38 | + allocate(intrinsic_array%double_precision_2D, source = array) |
39 | 39 | class default |
40 | 40 | error stop "intrinsic_array_t construct: unsupported rank-2 type" |
41 | 41 | end select |
42 | 42 |
|
43 | 43 | rank(3) |
44 | 44 | select type(array) |
45 | 45 | type is(complex) |
46 | | - intrinsic_array%complex_3D = array |
| 46 | + allocate(intrinsic_array%complex_3D, source = array) |
47 | 47 | type is(integer) |
48 | | - intrinsic_array%integer_3D = array |
| 48 | + allocate(intrinsic_array%integer_3D, source = array) |
49 | 49 | type is(logical) |
50 | | - intrinsic_array%logical_3D = array |
| 50 | + allocate(intrinsic_array%logical_3D, source = array) |
51 | 51 | type is(real) |
52 | | - intrinsic_array%real_3D = array |
| 52 | + allocate(intrinsic_array%real_3D, source = array) |
53 | 53 | type is(double precision) |
54 | | - intrinsic_array%double_precision_3D = array |
| 54 | + allocate(intrinsic_array%double_precision_3D, source = array) |
55 | 55 | class default |
56 | 56 | error stop "intrinsic_array_t construct: unsupported rank-3 type" |
57 | 57 | end select |
|
62 | 62 | #endif |
63 | 63 |
|
64 | 64 | end procedure |
65 | | - |
| 65 | + |
66 | 66 | module procedure as_character |
67 | 67 | integer, parameter :: single_number_width=32 |
68 | 68 |
|
69 | | - if (1 /= count( & |
| 69 | + if (1 /= count( & |
70 | 70 | [ allocated(self%complex_1D), allocated(self%complex_double_1D), allocated(self%integer_1D), & |
71 | 71 | allocated(self%logical_1D), allocated(self%real_1D), & |
72 | 72 | allocated(self%complex_2D), allocated(self%complex_double_2D), allocated(self%integer_2D), & |
|
132 | 132 | end if |
133 | 133 |
|
134 | 134 | character_self = trim(adjustl(character_self)) |
135 | | - end procedure |
| 135 | + end procedure |
136 | 136 |
|
137 | 137 | end submodule intrinsic_array_s |
0 commit comments