Parameter (ndim=1300, mdim=10) Real*4 A(ndim, mdim), B(mdim, mdim), C(ndim, ndim) Real*4 DiagB(mdim), DiagC(ndim) C Open (unit = 7, file = "hw0.dat", status="unknown") Open (unit = 8, file = "hw0_drl.out", status="unknown") C Read(7, *) Read(7, *) n=1200 m=6 Do i=1,ndim Read(7,*,end=100) (A(i,j), j=1,m) Enddo 100 nn=i-1 write(*,*) 'read', nn, ' lines' write(*,*) C C Check the read against head, tail C write(*,*) (A(1,j), j=1,m) write(*,*) (A(n,j), j=1,m) write(*,*) C C b(i,j)=sum(a'(i,k)*a(k,j) C Do i=1,m Do J=1,m Sum=0. do k=1,n Sum=sum+A(k,i)*A(k,j) enddo B(i,j)=sum enddo enddo C Do i=1,m write(*,*) (b(i,j), j=1,m) enddo C write(*,*) write(*,*) 'Diags of B' Do i=1,m diagB(i)=B(i,i) write(*,*) diagB(i) enddo C Sum2=0. Do i=1,m Do J=1,m term=abs(b(i,j)-b(j,i))/( (b(i,j)+b(j,i)) /2.) sum2=sum2+term**2 enddo enddo size=sqrt(sum2/(1.*m*m)) write(*,*) write(*,*) 'size of B =', size C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C c(i,j)=sum(a(i,k)*a'(k,j) C Do i=1,n Do J=1,n Sum=0. do k=1,m Sum=sum+A(i,k)*A(j,k) enddo C(i,j)=sum enddo enddo C C write(*,*) C write(*,*) 'Diags of c' C Do i=1,n C diagC(i)=C(i,i) C write(*,*) i, diagC(i) C enddo C Sum2=0. Do i=1,n Do J=1,n term=abs(c(i,j)-c(j,i))/( (c(i,j)+c(j,i)) /2.) sum2=sum2+term**2 enddo enddo size=sqrt(sum2/(1.*n*n)) write(*,*) write(*,*) 'size of C =', size C stop end