2 ! Series of routines for testing a loc() implementation
4 common /errors
/errors(12)
18 common /errors
/errors(12)
20 integer, parameter :: n
= 9
21 integer, parameter :: m
= 10
22 integer, parameter :: o
= 11
24 integer :: i
,j
,k
,intsize
,realsize
,dblsize
,chsize
,ch8size
27 integer itarg3 (o
,m
,n
)
32 character chtarg2(m
,n
)
33 character chtarg3(o
,m
,n
)
34 character*8 ch8targ1(n
)
35 character*8 ch8targ2(m
,n
)
36 character*8 ch8targ3(o
,m
,n
)
38 intsize
= kind(itarg1(1))
39 realsize
= kind(rtarg1(1))
40 chsize
= kind(chtarg1(1))*len(chtarg1(1))
41 ch8size
= kind(ch8targ1(1))*len(ch8targ1(1))
45 if (loc(itarg1
).ne
.loc(itarg1(i
))-offset
*intsize
) then
49 if (loc(rtarg1
).ne
.loc(rtarg1(i
))-offset
*realsize
) then
53 if (loc(chtarg1
).ne
.loc(chtarg1(i
))-offset
*chsize
) then
57 if (loc(ch8targ1
).ne
.loc(ch8targ1(i
))-offset
*ch8size
) then
63 offset
= (j
-1)+m
*(i
-1)
65 loc(itarg2(j
,i
))-offset
*intsize
) then
70 loc(rtarg2(j
,i
))-offset
*realsize
) then
74 if (loc(chtarg2
).ne
. &
75 loc(chtarg2(j
,i
))-offset
*chsize
) then
79 if (loc(ch8targ2
).ne
. &
80 loc(ch8targ2(j
,i
))-offset
*ch8size
) then
86 offset
= (k
-1)+o
*(j
-1)+o
*m
*(i
-1)
88 loc(itarg3(k
,j
,i
))-offset
*intsize
) then
93 loc(rtarg3(k
,j
,i
))-offset
*realsize
) then
97 if (loc(chtarg3
).ne
. &
98 loc(chtarg3(k
,j
,i
))-offset
*chsize
) then
102 if (loc(ch8targ3
).ne
. &
103 loc(ch8targ3(k
,j
,i
))-offset
*ch8size
) then
112 end subroutine testloc