home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
adaptor.zip
/
adapt.zip
/
adaptor
/
examples
/
dalib
/
replic
/
rep2.f
< prev
next >
Wrap
Text File
|
1993-04-28
|
574b
|
34 lines
program replicate
double precision a(10,10), ra(5,5), x
integer i, j, n
cmf$ layout ra(:serial,:serial)
forall (i=1:10,j=1:10) a(i,j) = i + j
ra = 0
ra = a(4:8,2:6)
n = 0
do i = 4, 8
do j = 2, 6
n = n + i + j
print *, 'a(',i,',',j,') = ', a(i,j)
end do
end do
do i = 1, 5
do j = 1, 5
print *, 'ra(',i,',',j,') = ', ra(i,j)
end do
end do
x = sum (ra)
print *, x
print *, 'Result is ', x, ' should be ', n
end