Daily bump.
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray / coindexed_1.f90
blobf90b65cb3898cd2893cf930f411c0c546192c816
1 ! { dg-do run }
4 program test
5 implicit none
6 call char_test()
7 contains
8 subroutine char_test()
9 character(len=3, kind=1), save :: str1a[*], str1b(5)[*]
10 character(len=7, kind=1), save :: str2a[*], str2b(5)[*]
11 character(len=3, kind=4), save :: ustr1a[*], ustr1b(5)[*]
12 character(len=7, kind=4), save :: ustr2a[*], ustr2b(5)[*]
14 ! ---------- Assign to coindexed variable -------------
16 ! - - - - - scalar = scalar
18 ! SCALAR - kind 1 - with padding
19 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
20 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
21 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
22 str1a = 1_"abc"
23 str2a = 1_"XXXXXXX"
24 if (this_image() == num_images()) then
25 str2a[1] = str1a
26 end if
27 sync all
28 if (this_image() == 1) then
29 if (str2a /= 1_"abc ") STOP 1
30 else
31 if (str2a /= 1_"XXXXXXX") STOP 2
32 end if
34 ! SCALAR - kind 4 - with padding
35 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
36 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
37 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
38 ustr1a = 4_"abc"
39 ustr2a = 4_"XXXXXXX"
40 if (this_image() == num_images()) then
41 ustr2a[1] = ustr1a
42 end if
43 sync all
44 if (this_image() == 1) then
45 if (ustr2a /= 4_"abc ") STOP 3
46 else
47 if (ustr2a /= 4_"XXXXXXX") STOP 4
48 end if
50 ! SCALAR - kind 1 - with trimming
51 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
52 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
53 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
54 str2a = 1_"abcde"
55 str1a = 1_"XXX"
56 if (this_image() == num_images()) then
57 str1a[1] = str2a
58 end if
59 sync all
60 if (this_image() == 1) then
61 if (str1a /= 1_"abc") STOP 5
62 else
63 if (str1a /= 1_"XXX") STOP 6
64 end if
66 ! SCALAR - kind 4 - with trimming
67 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
68 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
69 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
70 ustr2a = 4_"abcde"
71 ustr1a = 4_"XXX"
72 if (this_image() == num_images()) then
73 ustr1a[1] = ustr2a
74 end if
75 sync all
76 if (this_image() == 1) then
77 if (ustr1a /= 4_"abc") STOP 7
78 else
79 if (ustr1a /= 4_"XXX") STOP 8
80 end if
82 ! - - - - - array = array
84 ! contiguous ARRAY - kind 1 - with padding
85 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
86 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
87 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
88 str1b(1) = 1_"abc"
89 str1b(2) = 1_"def"
90 str1b(3) = 1_"gjh"
91 str2b(1) = 1_"XXXXXXX"
92 str2b(2) = 1_"YYYYYYY"
93 str2b(3) = 1_"ZZZZZZZ"
94 if (this_image() == num_images()) then
95 str2b(:)[1] = str1b
96 end if
97 sync all
98 if (this_image() == 1) then
99 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " &
100 .or. str2b(3) /= 1_"gjh ") STOP 9
101 else
102 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
103 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 10
104 end if
106 ! contiguous ARRAY - kind 4 - with padding
107 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
108 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
109 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
110 ustr1b(1) = 4_"abc"
111 ustr1b(2) = 4_"def"
112 ustr1b(3) = 4_"gjh"
113 ustr2b(1) = 4_"XXXXXXX"
114 ustr2b(2) = 4_"YYYYYYY"
115 ustr2b(3) = 4_"ZZZZZZZ"
116 if (this_image() == num_images()) then
117 ustr2b(:)[1] = ustr1b
118 end if
119 sync all
120 if (this_image() == 1) then
121 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " &
122 .or. ustr2b(3) /= 4_"gjh ") STOP 11
123 else
124 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
125 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 12
126 end if
128 ! contiguous ARRAY - kind 1 - with trimming
129 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
130 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
131 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
132 str2b(1) = 1_"abcdefg"
133 str2b(2) = 1_"hijklmn"
134 str2b(3) = 1_"opqrstu"
135 str1b(1) = 1_"XXX"
136 str1b(2) = 1_"YYY"
137 str1b(3) = 1_"ZZZ"
138 if (this_image() == num_images()) then
139 str1b(:)[1] = str2b
140 end if
141 sync all
142 if (this_image() == 1) then
143 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" &
144 .or. str1b(3) /= 1_"opq") STOP 13
145 else
146 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
147 .or. str1b(3) /= 1_"ZZZ") STOP 14
148 end if
150 ! contiguous ARRAY - kind 4 - with trimming
151 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
152 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
153 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
154 ustr2b(1) = 4_"abcdefg"
155 ustr2b(2) = 4_"hijklmn"
156 ustr2b(3) = 4_"opqrstu"
157 ustr1b(1) = 4_"XXX"
158 ustr1b(2) = 4_"YYY"
159 ustr1b(3) = 4_"ZZZ"
160 if (this_image() == num_images()) then
161 ustr1b(:)[1] = ustr2b
162 end if
163 sync all
164 if (this_image() == 1) then
165 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" &
166 .or. ustr1b(3) /= 4_"opq") STOP 15
167 else
168 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
169 .or. ustr1b(3) /= 4_"ZZZ") STOP 16
170 end if
172 ! - - - - - array = scalar
174 ! contiguous ARRAY - kind 1 - with padding
175 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
176 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
177 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
178 str1a = 1_"abc"
179 str2b(1) = 1_"XXXXXXX"
180 str2b(2) = 1_"YYYYYYY"
181 str2b(3) = 1_"ZZZZZZZ"
182 if (this_image() == num_images()) then
183 str2b(:)[1] = str1a
184 end if
185 sync all
186 if (this_image() == 1) then
187 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " &
188 .or. str2b(3) /= 1_"abc ") STOP 17
189 else
190 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
191 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 18
192 end if
194 ! contiguous ARRAY - kind 4 - with padding
195 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
196 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
197 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
198 ustr1a = 4_"abc"
199 ustr2b(1) = 4_"XXXXXXX"
200 ustr2b(2) = 4_"YYYYYYY"
201 ustr2b(3) = 4_"ZZZZZZZ"
202 if (this_image() == num_images()) then
203 ustr2b(:)[1] = ustr1a
204 end if
205 sync all
206 if (this_image() == 1) then
207 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " &
208 .or. ustr2b(3) /= 4_"abc ") STOP 19
209 else
210 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
211 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 20
212 end if
214 ! contiguous ARRAY - kind 1 - with trimming
215 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
216 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
217 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
218 str2a = 1_"abcdefg"
219 str1b(1) = 1_"XXX"
220 str1b(2) = 1_"YYY"
221 str1b(3) = 1_"ZZZ"
222 if (this_image() == num_images()) then
223 str1b(:)[1] = str2a
224 end if
225 sync all
226 if (this_image() == 1) then
227 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" &
228 .or. str1b(3) /= 1_"abc") STOP 21
229 else
230 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
231 .or. str1b(3) /= 1_"ZZZ") STOP 22
232 end if
234 ! contiguous ARRAY - kind 4 - with trimming
235 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
236 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
237 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
238 ustr2a = 4_"abcdefg"
239 ustr1b(1) = 4_"XXX"
240 ustr1b(2) = 4_"YYY"
241 ustr1b(3) = 4_"ZZZ"
242 if (this_image() == num_images()) then
243 ustr1b(:)[1] = ustr2a
244 end if
245 sync all
246 if (this_image() == 1) then
247 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" &
248 .or. ustr1b(3) /= 4_"abc") STOP 23
249 else
250 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
251 .or. ustr1b(3) /= 4_"ZZZ") STOP 24
252 end if
254 ! ---------- Take from a coindexed variable -------------
256 ! - - - - - scalar = scalar
258 ! SCALAR - kind 1 - with padding
259 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
260 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
261 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
262 str1a = 1_"abc"
263 str2a = 1_"XXXXXXX"
264 if (this_image() == num_images()) then
265 str2a = str1a[1]
266 end if
267 sync all
268 if (this_image() == num_images()) then
269 if (str2a /= 1_"abc ") STOP 25
270 else
271 if (str2a /= 1_"XXXXXXX") STOP 26
272 end if
274 ! SCALAR - kind 4 - with padding
275 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
276 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
277 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
278 ustr1a = 4_"abc"
279 ustr2a = 4_"XXXXXXX"
280 if (this_image() == num_images()) then
281 ustr2a = ustr1a[1]
282 end if
283 sync all
284 if (this_image() == num_images()) then
285 if (ustr2a /= 4_"abc ") STOP 27
286 else
287 if (ustr2a /= 4_"XXXXXXX") STOP 28
288 end if
290 ! SCALAR - kind 1 - with trimming
291 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
292 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
293 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
294 str2a = 1_"abcde"
295 str1a = 1_"XXX"
296 if (this_image() == num_images()) then
297 str1a = str2a[1]
298 end if
299 sync all
300 if (this_image() == num_images()) then
301 if (str1a /= 1_"abc") STOP 29
302 else
303 if (str1a /= 1_"XXX") STOP 30
304 end if
306 ! SCALAR - kind 4 - with trimming
307 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
308 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
309 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
310 ustr2a = 4_"abcde"
311 ustr1a = 4_"XXX"
312 if (this_image() == num_images()) then
313 ustr1a = ustr2a[1]
314 end if
315 sync all
316 if (this_image() == num_images()) then
317 if (ustr1a /= 4_"abc") STOP 31
318 else
319 if (ustr1a /= 4_"XXX") STOP 32
320 end if
322 ! - - - - - array = array
324 ! contiguous ARRAY - kind 1 - with padding
325 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
326 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
327 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
328 str1b(1) = 1_"abc"
329 str1b(2) = 1_"def"
330 str1b(3) = 1_"gjh"
331 str2b(1) = 1_"XXXXXXX"
332 str2b(2) = 1_"YYYYYYY"
333 str2b(3) = 1_"ZZZZZZZ"
334 if (this_image() == num_images()) then
335 str2b = str1b(:)[1]
336 end if
337 sync all
338 if (this_image() == num_images()) then
339 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " &
340 .or. str2b(3) /= 1_"gjh ") STOP 33
341 else
342 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
343 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 34
344 end if
346 ! contiguous ARRAY - kind 4 - with padding
347 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
348 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
349 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
350 ustr1b(1) = 4_"abc"
351 ustr1b(2) = 4_"def"
352 ustr1b(3) = 4_"gjh"
353 ustr2b(1) = 4_"XXXXXXX"
354 ustr2b(2) = 4_"YYYYYYY"
355 ustr2b(3) = 4_"ZZZZZZZ"
356 if (this_image() == num_images()) then
357 ustr2b = ustr1b(:)[1]
358 end if
359 sync all
360 if (this_image() == num_images()) then
361 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " &
362 .or. ustr2b(3) /= 4_"gjh ") STOP 35
363 else
364 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
365 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 36
366 end if
368 ! contiguous ARRAY - kind 1 - with trimming
369 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
370 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
371 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
372 str2b(1) = 1_"abcdefg"
373 str2b(2) = 1_"hijklmn"
374 str2b(3) = 1_"opqrstu"
375 str1b(1) = 1_"XXX"
376 str1b(2) = 1_"YYY"
377 str1b(3) = 1_"ZZZ"
378 if (this_image() == num_images()) then
379 str1b = str2b(:)[1]
380 end if
381 sync all
382 if (this_image() == num_images()) then
383 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" &
384 .or. str1b(3) /= 1_"opq") STOP 37
385 else
386 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
387 .or. str1b(3) /= 1_"ZZZ") STOP 38
388 end if
390 ! contiguous ARRAY - kind 4 - with trimming
391 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
392 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
393 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
394 ustr2b(1) = 4_"abcdefg"
395 ustr2b(2) = 4_"hijklmn"
396 ustr2b(3) = 4_"opqrstu"
397 ustr1b(1) = 4_"XXX"
398 ustr1b(2) = 4_"YYY"
399 ustr1b(3) = 4_"ZZZ"
400 if (this_image() == num_images()) then
401 ustr1b = ustr2b(:)[1]
402 end if
403 sync all
404 if (this_image() == num_images()) then
405 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" &
406 .or. ustr1b(3) /= 4_"opq") STOP 39
407 else
408 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
409 .or. ustr1b(3) /= 4_"ZZZ") STOP 40
410 end if
412 ! - - - - - array = scalar
414 ! contiguous ARRAY - kind 1 - with padding
415 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
416 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
417 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
418 str1a = 1_"abc"
419 str2b(1) = 1_"XXXXXXX"
420 str2b(2) = 1_"YYYYYYY"
421 str2b(3) = 1_"ZZZZZZZ"
422 if (this_image() == num_images()) then
423 str2b = str1a[1]
424 end if
425 sync all
426 if (this_image() == num_images()) then
427 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " &
428 .or. str2b(3) /= 1_"abc ") STOP 41
429 else
430 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
431 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 42
432 end if
434 ! contiguous ARRAY - kind 4 - with padding
435 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
436 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
437 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
438 ustr1a = 4_"abc"
439 ustr2b(1) = 4_"XXXXXXX"
440 ustr2b(2) = 4_"YYYYYYY"
441 ustr2b(3) = 4_"ZZZZZZZ"
442 if (this_image() == num_images()) then
443 ustr2b = ustr1a[1]
444 end if
445 sync all
446 if (this_image() == num_images()) then
447 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " &
448 .or. ustr2b(3) /= 4_"abc ") STOP 43
449 else
450 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
451 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 44
452 end if
454 ! contiguous ARRAY - kind 1 - with trimming
455 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
456 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
457 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
458 str2a = 1_"abcdefg"
459 str1b(1) = 1_"XXX"
460 str1b(2) = 1_"YYY"
461 str1b(3) = 1_"ZZZ"
462 if (this_image() == num_images()) then
463 str1b = str2a[1]
464 end if
465 sync all
466 if (this_image() == num_images()) then
467 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" &
468 .or. str1b(3) /= 1_"abc") STOP 45
469 else
470 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
471 .or. str1b(3) /= 1_"ZZZ") STOP 46
472 end if
474 ! contiguous ARRAY - kind 4 - with trimming
475 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
476 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
477 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
478 ustr2a = 4_"abcdefg"
479 ustr1b(1) = 4_"XXX"
480 ustr1b(2) = 4_"YYY"
481 ustr1b(3) = 4_"ZZZ"
482 if (this_image() == num_images()) then
483 ustr1b = ustr2a[1]
484 end if
485 sync all
486 if (this_image() == num_images()) then
487 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" &
488 .or. ustr1b(3) /= 4_"abc") STOP 47
489 else
490 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
491 .or. ustr1b(3) /= 4_"ZZZ") STOP 48
492 end if
495 ! ---------- coindexed to coindexed variable -------------
497 ! - - - - - scalar = scalar
499 ! SCALAR - kind 1 - with padding
500 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
501 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
502 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
503 str1a = 1_"abc"
504 str2a = 1_"XXXXXXX"
505 if (this_image() == num_images()) then
506 str2a[1] = str1a[mod(1, num_images())+1]
507 end if
508 sync all
509 if (this_image() == 1) then
510 if (str2a /= 1_"abc ") STOP 49
511 else
512 if (str2a /= 1_"XXXXXXX") STOP 50
513 end if
515 ! SCALAR - kind 4 - with padding
516 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
517 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
518 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
519 ustr1a = 4_"abc"
520 ustr2a = 4_"XXXXXXX"
521 if (this_image() == num_images()) then
522 ustr2a[1] = ustr1a[mod(1, num_images())+1]
523 end if
524 sync all
525 if (this_image() == 1) then
526 if (ustr2a /= 4_"abc ") STOP 51
527 else
528 if (ustr2a /= 4_"XXXXXXX") STOP 52
529 end if
531 ! SCALAR - kind 1 - with trimming
532 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
533 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
534 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
535 str2a = 1_"abcde"
536 str1a = 1_"XXX"
537 if (this_image() == num_images()) then
538 str1a[1] = str2a[mod(1, num_images())+1]
539 end if
540 sync all
541 if (this_image() == 1) then
542 if (str1a /= 1_"abc") STOP 53
543 else
544 if (str1a /= 1_"XXX") STOP 54
545 end if
547 ! SCALAR - kind 4 - with trimming
548 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
549 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
550 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
551 ustr2a = 4_"abcde"
552 ustr1a = 4_"XXX"
553 if (this_image() == num_images()) then
554 ustr1a[1] = ustr2a[mod(1, num_images())+1]
555 end if
556 sync all
557 if (this_image() == 1) then
558 if (ustr1a /= 4_"abc") STOP 55
559 else
560 if (ustr1a /= 4_"XXX") STOP 56
561 end if
563 ! - - - - - array = array
565 ! contiguous ARRAY - kind 1 - with padding
566 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
567 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
568 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
569 str1b(1) = 1_"abc"
570 str1b(2) = 1_"def"
571 str1b(3) = 1_"gjh"
572 str2b(1) = 1_"XXXXXXX"
573 str2b(2) = 1_"YYYYYYY"
574 str2b(3) = 1_"ZZZZZZZ"
575 if (this_image() == num_images()) then
576 str2b(:)[1] = str1b(:)[mod(1, num_images())+1]
577 end if
578 sync all
579 if (this_image() == 1) then
580 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " &
581 .or. str2b(3) /= 1_"gjh ") STOP 57
582 else
583 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
584 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 58
585 end if
587 ! contiguous ARRAY - kind 4 - with padding
588 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
589 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
590 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
591 ustr1b(1) = 4_"abc"
592 ustr1b(2) = 4_"def"
593 ustr1b(3) = 4_"gjh"
594 ustr2b(1) = 4_"XXXXXXX"
595 ustr2b(2) = 4_"YYYYYYY"
596 ustr2b(3) = 4_"ZZZZZZZ"
597 if (this_image() == num_images()) then
598 ustr2b(:)[1] = ustr1b(:)[mod(1, num_images())+1]
599 end if
600 sync all
601 if (this_image() == 1) then
602 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " &
603 .or. ustr2b(3) /= 4_"gjh ") STOP 59
604 else
605 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
606 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 60
607 end if
609 ! contiguous ARRAY - kind 1 - with trimming
610 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
611 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
612 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
613 str2b(1) = 1_"abcdefg"
614 str2b(2) = 1_"hijklmn"
615 str2b(3) = 1_"opqrstu"
616 str1b(1) = 1_"XXX"
617 str1b(2) = 1_"YYY"
618 str1b(3) = 1_"ZZZ"
619 if (this_image() == num_images()) then
620 str1b(:)[1] = str2b(:)[mod(1, num_images())+1]
621 end if
622 sync all
623 if (this_image() == 1) then
624 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" &
625 .or. str1b(3) /= 1_"opq") STOP 61
626 else
627 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
628 .or. str1b(3) /= 1_"ZZZ") STOP 62
629 end if
631 ! contiguous ARRAY - kind 4 - with trimming
632 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
633 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
634 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
635 ustr2b(1) = 4_"abcdefg"
636 ustr2b(2) = 4_"hijklmn"
637 ustr2b(3) = 4_"opqrstu"
638 ustr1b(1) = 4_"XXX"
639 ustr1b(2) = 4_"YYY"
640 ustr1b(3) = 4_"ZZZ"
641 if (this_image() == num_images()) then
642 ustr1b(:)[1] = ustr2b(:)[mod(1, num_images())+1]
643 end if
644 sync all
645 if (this_image() == 1) then
646 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" &
647 .or. ustr1b(3) /= 4_"opq") STOP 63
648 else
649 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
650 .or. ustr1b(3) /= 4_"ZZZ") STOP 64
651 end if
653 ! - - - - - array = scalar
655 ! contiguous ARRAY - kind 1 - with padding
656 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
657 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
658 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
659 str1a = 1_"abc"
660 str2b(1) = 1_"XXXXXXX"
661 str2b(2) = 1_"YYYYYYY"
662 str2b(3) = 1_"ZZZZZZZ"
663 if (this_image() == num_images()) then
664 str2b(:)[1] = str1a[mod(1, num_images())+1]
665 end if
666 sync all
667 if (this_image() == 1) then
668 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " &
669 .or. str2b(3) /= 1_"abc ") STOP 65
670 else
671 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
672 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 66
673 end if
675 ! contiguous ARRAY - kind 4 - with padding
676 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
677 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
678 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
679 ustr1a = 4_"abc"
680 ustr2b(1) = 4_"XXXXXXX"
681 ustr2b(2) = 4_"YYYYYYY"
682 ustr2b(3) = 4_"ZZZZZZZ"
683 if (this_image() == num_images()) then
684 ustr2b(:)[1] = ustr1a[mod(1, num_images())+1]
685 end if
686 sync all
687 if (this_image() == 1) then
688 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " &
689 .or. ustr2b(3) /= 4_"abc ") STOP 67
690 else
691 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
692 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 68
693 end if
695 ! contiguous ARRAY - kind 1 - with trimming
696 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
697 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
698 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
699 str2a = 1_"abcdefg"
700 str1b(1) = 1_"XXX"
701 str1b(2) = 1_"YYY"
702 str1b(3) = 1_"ZZZ"
703 if (this_image() == num_images()) then
704 str1b(:)[1] = str2a[mod(1, num_images())+1]
705 end if
706 sync all
707 if (this_image() == 1) then
708 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" &
709 .or. str1b(3) /= 1_"abc") STOP 69
710 else
711 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
712 .or. str1b(3) /= 1_"ZZZ") STOP 70
713 end if
715 ! contiguous ARRAY - kind 4 - with trimming
716 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
717 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
718 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
719 ustr2a = 4_"abcdefg"
720 ustr1b(1) = 4_"XXX"
721 ustr1b(2) = 4_"YYY"
722 ustr1b(3) = 4_"ZZZ"
723 if (this_image() == num_images()) then
724 ustr1b(:)[1] = ustr2a[mod(1, num_images())+1]
725 end if
726 sync all
727 if (this_image() == 1) then
728 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" &
729 .or. ustr1b(3) /= 4_"abc") STOP 71
730 else
731 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
732 .or. ustr1b(3) /= 4_"ZZZ") STOP 72
733 end if
735 ! ============== char1 <-> char4 =====================
737 ! ---------- Assign to coindexed variable -------------
739 ! - - - - - scalar = scalar
741 ! SCALAR - kind 1 <- 4 - with padding
742 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
743 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
744 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
745 ustr1a = 4_"abc"
746 str1a = 1_"XXXXXXX"
747 if (this_image() == num_images()) then
748 str2a[1] = ustr1a
749 end if
750 sync all
751 if (this_image() == 1) then
752 if (str2a /= 1_"abc ") STOP 73
753 else
754 if (str2a /= 1_"XXXXXXX") STOP 74
755 end if
757 ! SCALAR - kind 4 <- 1 - with padding
758 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
759 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
760 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
761 str1a = 4_"abc"
762 ustr2a = 1_"XXXXXXX"
763 if (this_image() == num_images()) then
764 ustr2a[1] = str1a
765 end if
766 sync all
767 if (this_image() == 1) then
768 if (ustr2a /= 4_"abc ") STOP 75
769 else
770 if (ustr2a /= 4_"XXXXXXX") STOP 76
771 end if
773 ! SCALAR - kind 1 <- 4 - with trimming
774 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
775 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
776 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
777 ustr2a = 4_"abcde"
778 str1a = 1_"XXX"
779 if (this_image() == num_images()) then
780 str1a[1] = ustr2a
781 end if
782 sync all
783 if (this_image() == 1) then
784 if (str1a /= 1_"abc") STOP 77
785 else
786 if (str1a /= 1_"XXX") STOP 78
787 end if
789 ! SCALAR - kind 4 <- 1 - with trimming
790 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
791 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
792 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
793 str2a = 4_"abcde"
794 ustr1a = 1_"XXX"
795 if (this_image() == num_images()) then
796 ustr1a[1] = str2a
797 end if
798 sync all
799 if (this_image() == 1) then
800 if (ustr1a /= 4_"abc") STOP 79
801 else
802 if (ustr1a /= 4_"XXX") STOP 80
803 end if
805 ! - - - - - array = array
807 ! contiguous ARRAY - kind 1 <- 4 - with padding
808 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
809 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
810 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
811 ustr1b(1) = 4_"abc"
812 ustr1b(2) = 4_"def"
813 ustr1b(3) = 4_"gjh"
814 str2b(1) = 1_"XXXXXXX"
815 str2b(2) = 1_"YYYYYYY"
816 str2b(3) = 1_"ZZZZZZZ"
817 if (this_image() == num_images()) then
818 str2b(:)[1] = ustr1b
819 end if
820 sync all
821 if (this_image() == 1) then
822 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " &
823 .or. str2b(3) /= 1_"gjh ") STOP 81
824 else
825 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
826 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 82
827 end if
829 ! contiguous ARRAY - kind 4 <- 1 - with padding
830 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
831 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
832 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
833 str1b(1) = 1_"abc"
834 str1b(2) = 1_"def"
835 str1b(3) = 1_"gjh"
836 ustr2b(1) = 4_"XXXXXXX"
837 ustr2b(2) = 4_"YYYYYYY"
838 ustr2b(3) = 4_"ZZZZZZZ"
839 if (this_image() == num_images()) then
840 ustr2b(:)[1] = str1b
841 end if
842 sync all
843 if (this_image() == 1) then
844 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " &
845 .or. ustr2b(3) /= 4_"gjh ") STOP 83
846 else
847 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
848 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 84
849 end if
851 ! contiguous ARRAY - kind 1 <- 4 - with trimming
852 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
853 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
854 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
855 ustr2b(1) = 4_"abcdefg"
856 ustr2b(2) = 4_"hijklmn"
857 ustr2b(3) = 4_"opqrstu"
858 str1b(1) = 1_"XXX"
859 str1b(2) = 1_"YYY"
860 str1b(3) = 1_"ZZZ"
861 if (this_image() == num_images()) then
862 str1b(:)[1] = ustr2b
863 end if
864 sync all
865 if (this_image() == 1) then
866 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" &
867 .or. str1b(3) /= 1_"opq") STOP 85
868 else
869 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
870 .or. str1b(3) /= 1_"ZZZ") STOP 86
871 end if
873 ! contiguous ARRAY - kind 4 <- 1 - with trimming
874 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
875 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
876 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
877 str2b(1) = 1_"abcdefg"
878 str2b(2) = 1_"hijklmn"
879 str2b(3) = 1_"opqrstu"
880 ustr1b(1) = 4_"XXX"
881 ustr1b(2) = 4_"YYY"
882 ustr1b(3) = 4_"ZZZ"
883 if (this_image() == num_images()) then
884 ustr1b(:)[1] = str2b
885 end if
886 sync all
887 if (this_image() == 1) then
888 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" &
889 .or. ustr1b(3) /= 4_"opq") STOP 87
890 else
891 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
892 .or. ustr1b(3) /= 4_"ZZZ") STOP 88
893 end if
895 ! - - - - - array = scalar
897 ! contiguous ARRAY - kind 1 <- 4 - with padding
898 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
899 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
900 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
901 ustr1a = 4_"abc"
902 str2b(1) = 1_"XXXXXXX"
903 str2b(2) = 1_"YYYYYYY"
904 str2b(3) = 1_"ZZZZZZZ"
905 if (this_image() == num_images()) then
906 str2b(:)[1] = ustr1a
907 end if
908 sync all
909 if (this_image() == 1) then
910 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " &
911 .or. str2b(3) /= 1_"abc ") STOP 89
912 else
913 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
914 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 90
915 end if
917 ! contiguous ARRAY - kind 4 <- 1 - with padding
918 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
919 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
920 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
921 str1a = 1_"abc"
922 ustr2b(1) = 4_"XXXXXXX"
923 ustr2b(2) = 4_"YYYYYYY"
924 ustr2b(3) = 4_"ZZZZZZZ"
925 if (this_image() == num_images()) then
926 ustr2b(:)[1] = str1a
927 end if
928 sync all
929 if (this_image() == 1) then
930 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " &
931 .or. ustr2b(3) /= 4_"abc ") STOP 91
932 else
933 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
934 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 92
935 end if
937 ! contiguous ARRAY - kind 1 <- 4 - with trimming
938 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
939 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
940 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
941 ustr2a = 4_"abcdefg"
942 str1b(1) = 1_"XXX"
943 str1b(2) = 1_"YYY"
944 str1b(3) = 1_"ZZZ"
945 if (this_image() == num_images()) then
946 str1b(:)[1] = ustr2a
947 end if
948 sync all
949 if (this_image() == 1) then
950 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" &
951 .or. str1b(3) /= 1_"abc") STOP 93
952 else
953 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
954 .or. str1b(3) /= 1_"ZZZ") STOP 94
955 end if
957 ! contiguous ARRAY - kind 4 <- 1 - with trimming
958 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
959 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
960 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
961 str2a = 1_"abcdefg"
962 ustr1b(1) = 4_"XXX"
963 ustr1b(2) = 4_"YYY"
964 ustr1b(3) = 4_"ZZZ"
965 if (this_image() == num_images()) then
966 ustr1b(:)[1] = str2a
967 end if
968 sync all
969 if (this_image() == 1) then
970 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" &
971 .or. ustr1b(3) /= 4_"abc") STOP 95
972 else
973 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
974 .or. ustr1b(3) /= 4_"ZZZ") STOP 96
975 end if
977 ! ---------- Take from a coindexed variable -------------
979 ! - - - - - scalar = scalar
981 ! SCALAR - kind 1 <- 4 - with padding
982 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
983 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
984 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
985 ustr1a = 4_"abc"
986 str2a = 1_"XXXXXXX"
987 if (this_image() == num_images()) then
988 str2a = ustr1a[1]
989 end if
990 sync all
991 if (this_image() == num_images()) then
992 if (str2a /= 1_"abc ") STOP 97
993 else
994 if (str2a /= 1_"XXXXXXX") STOP 98
995 end if
997 ! SCALAR - kind 4 <- 1 - with padding
998 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
999 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1000 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1001 str1a = 1_"abc"
1002 ustr2a = 4_"XXXXXXX"
1003 if (this_image() == num_images()) then
1004 ustr2a = str1a[1]
1005 end if
1006 sync all
1007 if (this_image() == num_images()) then
1008 if (ustr2a /= 4_"abc ") STOP 99
1009 else
1010 if (ustr2a /= 4_"XXXXXXX") STOP 100
1011 end if
1013 ! SCALAR - kind 1 <- 4 - with trimming
1014 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1015 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1016 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1017 ustr2a = 4_"abcde"
1018 str1a = 1_"XXX"
1019 if (this_image() == num_images()) then
1020 str1a = ustr2a[1]
1021 end if
1022 sync all
1023 if (this_image() == num_images()) then
1024 if (str1a /= 1_"abc") STOP 101
1025 else
1026 if (str1a /= 1_"XXX") STOP 102
1027 end if
1029 ! SCALAR - kind 4 <- 1 - with trimming
1030 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1031 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1032 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1033 str2a = 1_"abcde"
1034 ustr1a = 4_"XXX"
1035 if (this_image() == num_images()) then
1036 ustr1a = str2a[1]
1037 end if
1038 sync all
1039 if (this_image() == num_images()) then
1040 if (ustr1a /= 4_"abc") STOP 103
1041 else
1042 if (ustr1a /= 4_"XXX") STOP 104
1043 end if
1045 ! - - - - - array = array
1047 ! contiguous ARRAY - kind 1 <- 4 - with padding
1048 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1049 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1050 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1051 ustr1b(1) = 4_"abc"
1052 ustr1b(2) = 4_"def"
1053 ustr1b(3) = 4_"gjh"
1054 str2b(1) = 1_"XXXXXXX"
1055 str2b(2) = 1_"YYYYYYY"
1056 str2b(3) = 1_"ZZZZZZZ"
1057 if (this_image() == num_images()) then
1058 str2b = ustr1b(:)[1]
1059 end if
1060 sync all
1061 if (this_image() == num_images()) then
1062 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " &
1063 .or. str2b(3) /= 1_"gjh ") STOP 105
1064 else
1065 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
1066 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 106
1067 end if
1069 ! contiguous ARRAY - kind 4 <- 1 - with padding
1070 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1071 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1072 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1073 str1b(1) = 1_"abc"
1074 str1b(2) = 1_"def"
1075 str1b(3) = 1_"gjh"
1076 ustr2b(1) = 4_"XXXXXXX"
1077 ustr2b(2) = 4_"YYYYYYY"
1078 ustr2b(3) = 4_"ZZZZZZZ"
1079 if (this_image() == num_images()) then
1080 ustr2b = str1b(:)[1]
1081 end if
1082 sync all
1083 if (this_image() == num_images()) then
1084 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " &
1085 .or. ustr2b(3) /= 4_"gjh ") STOP 107
1086 else
1087 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
1088 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 108
1089 end if
1091 ! contiguous ARRAY - kind 1 <- 4 - with trimming
1092 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1093 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1094 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1095 ustr2b(1) = 4_"abcdefg"
1096 ustr2b(2) = 4_"hijklmn"
1097 ustr2b(3) = 4_"opqrstu"
1098 str1b(1) = 1_"XXX"
1099 str1b(2) = 1_"YYY"
1100 str1b(3) = 1_"ZZZ"
1101 if (this_image() == num_images()) then
1102 str1b = ustr2b(:)[1]
1103 end if
1104 sync all
1105 if (this_image() == num_images()) then
1106 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" &
1107 .or. str1b(3) /= 1_"opq") STOP 109
1108 else
1109 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
1110 .or. str1b(3) /= 1_"ZZZ") STOP 110
1111 end if
1113 ! contiguous ARRAY - kind 4 <- 1 - with trimming
1114 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1115 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1116 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1117 str2b(1) = 1_"abcdefg"
1118 str2b(2) = 1_"hijklmn"
1119 str2b(3) = 1_"opqrstu"
1120 ustr1b(1) = 4_"XXX"
1121 ustr1b(2) = 4_"YYY"
1122 ustr1b(3) = 4_"ZZZ"
1123 if (this_image() == num_images()) then
1124 ustr1b = str2b(:)[1]
1125 end if
1126 sync all
1127 if (this_image() == num_images()) then
1128 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" &
1129 .or. ustr1b(3) /= 4_"opq") STOP 111
1130 else
1131 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
1132 .or. ustr1b(3) /= 4_"ZZZ") STOP 112
1133 end if
1135 ! - - - - - array = scalar
1137 ! contiguous ARRAY - kind 1 <- 4 - with padding
1138 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1139 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1140 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1141 ustr1a = 4_"abc"
1142 str2b(1) = 1_"XXXXXXX"
1143 str2b(2) = 1_"YYYYYYY"
1144 str2b(3) = 1_"ZZZZZZZ"
1145 if (this_image() == num_images()) then
1146 str2b = ustr1a[1]
1147 end if
1148 sync all
1149 if (this_image() == num_images()) then
1150 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " &
1151 .or. str2b(3) /= 1_"abc ") STOP 113
1152 else
1153 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
1154 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 114
1155 end if
1157 ! contiguous ARRAY - kind 4 <- 1 - with padding
1158 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1159 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1160 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1161 str1a = 1_"abc"
1162 ustr2b(1) = 4_"XXXXXXX"
1163 ustr2b(2) = 4_"YYYYYYY"
1164 ustr2b(3) = 4_"ZZZZZZZ"
1165 if (this_image() == num_images()) then
1166 ustr2b = str1a[1]
1167 end if
1168 sync all
1169 if (this_image() == num_images()) then
1170 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " &
1171 .or. ustr2b(3) /= 4_"abc ") STOP 115
1172 else
1173 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
1174 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 116
1175 end if
1177 ! contiguous ARRAY - kind 1 <- 4 - with trimming
1178 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1179 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1180 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1181 ustr2a = 4_"abcdefg"
1182 str1b(1) = 1_"XXX"
1183 str1b(2) = 1_"YYY"
1184 str1b(3) = 1_"ZZZ"
1185 if (this_image() == num_images()) then
1186 str1b = ustr2a[1]
1187 end if
1188 sync all
1189 if (this_image() == num_images()) then
1190 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" &
1191 .or. str1b(3) /= 1_"abc") STOP 117
1192 else
1193 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
1194 .or. str1b(3) /= 1_"ZZZ") STOP 118
1195 end if
1197 ! contiguous ARRAY - kind 4 <- 1 - with trimming
1198 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1199 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1200 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1201 str2a = 1_"abcdefg"
1202 ustr1b(1) = 4_"XXX"
1203 ustr1b(2) = 4_"YYY"
1204 ustr1b(3) = 4_"ZZZ"
1205 if (this_image() == num_images()) then
1206 ustr1b = str2a[1]
1207 end if
1208 sync all
1209 if (this_image() == num_images()) then
1210 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" &
1211 .or. ustr1b(3) /= 4_"abc") STOP 119
1212 else
1213 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
1214 .or. ustr1b(3) /= 4_"ZZZ") STOP 120
1215 end if
1218 ! ---------- coindexed to coindexed variable -------------
1220 ! - - - - - scalar = scalar
1222 ! SCALAR - kind 1 <- 4 - with padding
1223 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1224 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1225 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1226 ustr1a = 4_"abc"
1227 str2a = 1_"XXXXXXX"
1228 if (this_image() == num_images()) then
1229 str2a[1] = ustr1a[mod(1, num_images())+1]
1230 end if
1231 sync all
1232 if (this_image() == 1) then
1233 if (str2a /= 1_"abc ") STOP 121
1234 else
1235 if (str2a /= 1_"XXXXXXX") STOP 122
1236 end if
1238 ! SCALAR - kind 4 <- 1 - with padding
1239 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1240 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1241 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1242 str1a = 1_"abc"
1243 ustr2a = 4_"XXXXXXX"
1244 if (this_image() == num_images()) then
1245 ustr2a[1] = str1a[mod(1, num_images())+1]
1246 end if
1247 sync all
1248 if (this_image() == 1) then
1249 if (ustr2a /= 4_"abc ") STOP 123
1250 else
1251 if (ustr2a /= 4_"XXXXXXX") STOP 124
1252 end if
1254 ! SCALAR - kind 1 <- 4 - with trimming
1255 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1256 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1257 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1258 ustr2a = 4_"abcde"
1259 str1a = 1_"XXX"
1260 if (this_image() == num_images()) then
1261 str1a[1] = ustr2a[mod(1, num_images())+1]
1262 end if
1263 sync all
1264 if (this_image() == 1) then
1265 if (str1a /= 1_"abc") STOP 125
1266 else
1267 if (str1a /= 1_"XXX") STOP 126
1268 end if
1270 ! SCALAR - kind 4 <- 1 - with trimming
1271 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1272 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1273 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1274 str2a = 1_"abcde"
1275 ustr1a = 4_"XXX"
1276 if (this_image() == num_images()) then
1277 ustr1a[1] = str2a[mod(1, num_images())+1]
1278 end if
1279 sync all
1280 if (this_image() == 1) then
1281 if (ustr1a /= 4_"abc") STOP 127
1282 else
1283 if (ustr1a /= 4_"XXX") STOP 128
1284 end if
1286 ! - - - - - array = array
1288 ! contiguous ARRAY - kind 1 <- 4 - with padding
1289 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1290 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1291 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1292 ustr1b(1) = 4_"abc"
1293 ustr1b(2) = 4_"def"
1294 ustr1b(3) = 4_"gjh"
1295 str2b(1) = 1_"XXXXXXX"
1296 str2b(2) = 1_"YYYYYYY"
1297 str2b(3) = 1_"ZZZZZZZ"
1298 if (this_image() == num_images()) then
1299 str2b(:)[1] = ustr1b(:)[mod(1, num_images())+1]
1300 end if
1301 sync all
1302 if (this_image() == 1) then
1303 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " &
1304 .or. str2b(3) /= 1_"gjh ") STOP 129
1305 else
1306 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
1307 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 130
1308 end if
1310 ! contiguous ARRAY - kind 4 <- 1 - with padding
1311 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1312 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1313 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1314 str1b(1) = 1_"abc"
1315 str1b(2) = 1_"def"
1316 str1b(3) = 1_"gjh"
1317 ustr2b(1) = 4_"XXXXXXX"
1318 ustr2b(2) = 4_"YYYYYYY"
1319 ustr2b(3) = 4_"ZZZZZZZ"
1320 if (this_image() == num_images()) then
1321 ustr2b(:)[1] = str1b(:)[mod(1, num_images())+1]
1322 end if
1323 sync all
1324 if (this_image() == 1) then
1325 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " &
1326 .or. ustr2b(3) /= 4_"gjh ") STOP 131
1327 else
1328 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
1329 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 132
1330 end if
1332 ! contiguous ARRAY - kind 1 <- 4 - with trimming
1333 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1334 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1335 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1336 ustr2b(1) = 4_"abcdefg"
1337 ustr2b(2) = 4_"hijklmn"
1338 ustr2b(3) = 4_"opqrstu"
1339 str1b(1) = 1_"XXX"
1340 str1b(2) = 1_"YYY"
1341 str1b(3) = 1_"ZZZ"
1342 if (this_image() == num_images()) then
1343 str1b(:)[1] = ustr2b(:)[mod(1, num_images())+1]
1344 end if
1345 sync all
1346 if (this_image() == 1) then
1347 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" &
1348 .or. str1b(3) /= 1_"opq") STOP 133
1349 else
1350 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
1351 .or. str1b(3) /= 1_"ZZZ") STOP 134
1352 end if
1354 ! contiguous ARRAY - kind 4 <- 1 - with trimming
1355 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1356 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1357 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1358 str2b(1) = 1_"abcdefg"
1359 str2b(2) = 1_"hijklmn"
1360 str2b(3) = 1_"opqrstu"
1361 ustr1b(1) = 4_"XXX"
1362 ustr1b(2) = 4_"YYY"
1363 ustr1b(3) = 4_"ZZZ"
1364 if (this_image() == num_images()) then
1365 ustr1b(:)[1] = str2b(:)[mod(1, num_images())+1]
1366 end if
1367 sync all
1368 if (this_image() == 1) then
1369 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" &
1370 .or. ustr1b(3) /= 4_"opq") STOP 135
1371 else
1372 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
1373 .or. ustr1b(3) /= 4_"ZZZ") STOP 136
1374 end if
1376 ! - - - - - array = scalar
1378 ! contiguous ARRAY - kind 1 <- 4 - with padding
1379 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1380 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1381 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1382 ustr1a = 4_"abc"
1383 str2b(1) = 1_"XXXXXXX"
1384 str2b(2) = 1_"YYYYYYY"
1385 str2b(3) = 1_"ZZZZZZZ"
1386 if (this_image() == num_images()) then
1387 str2b(:)[1] = ustr1a[mod(1, num_images())+1]
1388 end if
1389 sync all
1390 if (this_image() == 1) then
1391 if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " &
1392 .or. str2b(3) /= 1_"abc ") STOP 137
1393 else
1394 if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" &
1395 .or. str2b(3) /= 1_"ZZZZZZZ") STOP 138
1396 end if
1398 ! contiguous ARRAY - kind 4 <- 1 - with padding
1399 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1400 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1401 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1402 str1a = 1_"abc"
1403 ustr2b(1) = 4_"XXXXXXX"
1404 ustr2b(2) = 4_"YYYYYYY"
1405 ustr2b(3) = 4_"ZZZZZZZ"
1406 if (this_image() == num_images()) then
1407 ustr2b(:)[1] = str1a[mod(1, num_images())+1]
1408 end if
1409 sync all
1410 if (this_image() == 1) then
1411 if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " &
1412 .or. ustr2b(3) /= 4_"abc ") STOP 139
1413 else
1414 if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" &
1415 .or. ustr2b(3) /= 4_"ZZZZZZZ") STOP 140
1416 end if
1418 ! contiguous ARRAY - kind 1 <- 4 - with trimming
1419 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1420 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1421 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1422 ustr2a = 4_"abcdefg"
1423 str1b(1) = 1_"XXX"
1424 str1b(2) = 1_"YYY"
1425 str1b(3) = 1_"ZZZ"
1426 if (this_image() == num_images()) then
1427 str1b(:)[1] = ustr2a[mod(1, num_images())+1]
1428 end if
1429 sync all
1430 if (this_image() == 1) then
1431 if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" &
1432 .or. str1b(3) /= 1_"abc") STOP 141
1433 else
1434 if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" &
1435 .or. str1b(3) /= 1_"ZZZ") STOP 142
1436 end if
1438 ! contiguous ARRAY - kind 4 <- 1 - with trimming
1439 str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz"
1440 str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz"
1441 ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz"
1442 str2a = 1_"abcdefg"
1443 ustr1b(1) = 4_"XXX"
1444 ustr1b(2) = 4_"YYY"
1445 ustr1b(3) = 4_"ZZZ"
1446 if (this_image() == num_images()) then
1447 ustr1b(:)[1] = str2a[mod(1, num_images())+1]
1448 end if
1449 sync all
1450 if (this_image() == 1) then
1451 if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" &
1452 .or. ustr1b(3) /= 4_"abc") STOP 143
1453 else
1454 if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" &
1455 .or. ustr1b(3) /= 4_"ZZZ") STOP 144
1456 end if
1458 end subroutine char_test
1459 end program test