1 ! Test eoshift1 for character arrays.
5 integer, parameter :: n1 = 2, n2 = 5, n3 = 4, slen = 3
6 character (len = slen), dimension (n1, n2, n3) :: a
7 character (len = slen) :: filler
8 integer (kind = 1), dimension (n1, n3) :: shift1
9 integer (kind = 2), dimension (n1, n3) :: shift2
10 integer (kind = 4), dimension (n1, n3) :: shift3
11 integer (kind = 8), dimension (n1, n3) :: shift4
14 shift1 (1, :) = (/ 1, 3, 2, 2 /)
15 shift1 (2, :) = (/ 2, 1, 1, 3 /)
23 a (i1, i2, i3) = 'ab'(i1:i1) // 'cdefg'(i2:i2) // 'hijk'(i3:i3)
28 call test (eoshift (a, shift1, 'foo', 2), 'foo')
29 call test (eoshift (a, shift2, 'foo', 2), 'foo')
30 call test (eoshift (a, shift3, 'foo', 2), 'foo')
31 call test (eoshift (a, shift4, 'foo', 2), 'foo')
34 call test (eoshift (a, shift1, dim = 2), filler)
35 call test (eoshift (a, shift2, dim = 2), filler)
36 call test (eoshift (a, shift3, dim = 2), filler)
37 call test (eoshift (a, shift4, dim = 2), filler)
39 subroutine test (b, filler)
40 character (len = slen), dimension (n1, n2, n3) :: b
41 character (len = slen) :: filler
47 i2p = i2 + shift1 (i1, i3)
49 if (b (i1, i2, i3) .ne. filler) call abort
51 if (b (i1, i2, i3) .ne. a (i1, i2p, i3)) call abort