c c merge 3 files into 1 c Parameter (no=25, np=(no*(no+1))/2, nog=np) Real*8 gi(nog),hi(nog),pi(nog),ri(nog),gg,pp,hh,rr open(10,file='newGI.d',form='formatted', x status='old') open(11,file='newPI.d',form='formatted', x status='old') open(12,file='newHI.d',form='formatted', x status='old') open(13,file='newRI.d',form='formatted', x status='old') open(15,file='newMI.d',form='formatted',status='unknown') open(17,file='newh2.d',form='formatted',status='unknown') gi=0.d0 pi=0.d0 hi=0.d0 ri=0.d0 c c initialize arrays to zero c 20 read(10,4002,end=100)ir,ic,gg m=ihmssf(ir,ic,no) gi(m)=gg go to 20 100 close(10) 25 read(11,4002,end=26)ir,ic,pp m=ihmssf(ir,ic,no) pi(m)=pp go to 25 26 close(11) 27 read(12,4002,end=28)ir,ic,hh m=ihmssf(ir,ic,no) hi(m)=hh go to 27 28 close(12) 29 read(13,4002,end=31)ir,ic,rr m=ihmssf(ir,ic,no) ri(m)=rr go to 29 31 close(13) write(15,1410) 1410 format(' row col, gi, pi, hi, ri, 1x,2i4,4d16.8') m=0 do 125 ir=1,no do 125 ic=ir,no m=m+1 write(15,1405)ir,ic,gi(m),pi(m),hi(m),ri(m) if(ir.eq.ic)then gg=gi(m)/(gi(m)+pi(m)+hi(m)+ri(m)) pp=(gi(m)+pi(m))/(gi(m)+pi(m)+hi(m)+ri(m)) hh=hi(m)/(gi(m)+pi(m)+hi(m)+ri(m)) write(17,1708)ir,gg,pp,hh 1708 format(1x,i5,3f12.3) endif 125 CONTINUE 1405 format(1x,2i5,4f16.8) 4002 format(1x,2i5,2f18.10) close(15) stop end