c*************************************************** program assign1 c main program c*************************************************** implicit double precision (a-h,o-z) dimension a(4,5), b(4,5), c(5,6) c--------------------------------------------------- do 100 i = 1,4 do 101 j = 1,5 a(i,j) = 10. / (i+j) b(i,j) = 2. * (i-j) 101 continue 100 continue do 102 i = 1,5 do 103 j = 1,6 c(i,j) = 10. / (2*i+j) 103 continue 102 continue call mprint (a,4,5,4,'a ') call mprint (b,4,5,4,'b ') call mprint (c,5,6,5,'c ') stop end c******************************************************** subroutine mprint(a,ii,jj,mm,aname) c print an ii x jj partition of an array c whose dimension is mm for first subscript c******************************************************** implicit double precision (a-h,o-z) character*8 aname dimension a(mm,*) c-------------------------------------------------------- nn = (jj + 5)/6 jb = 0 do 100 n = 1,nn ja = jb + 1 jb = ja + 5 if (jj.lt.(ja + 5)) jb = jj write(6,2000) aname, (j,j=ja,jb) do 200 i=1,ii write(6,2001) i, (a(i,j), j = ja,jb) 200 continue 100 continue return 2000 format(/5x,'matrix ',a8/1x,'row/col',i6,5i12) 2001 format(i4,4x,6e12.4) end