Dear All, Please, I am trying to read in a data shown in array form but no luck. The data is 10 by 10 with each 10 by 10 depicted by a local array, for e.g. 0 0 0 0 0 0. A sample of the code I tried using is as shown below and the data is as attached. Please, any help or suggestion will be highly appreciated.
Program readdata real*8 r1,r2,r3,r4,r5,r6,r7,r8,r9,fill,akx,aky,akz,akx1,aky1,akz1 real*8 w(2500) complex*16 Gsc(100,100) integer i,j,k,l,m,i1 character*80 linemc open(unit=40,file='datain.txt',status='unknown') do i=1,1000 READ(40,*) akx, aky,akz,akx1,aky1,akz1 ! local array READ(40,*) (Gsc(:,l),l=1,10) ! Read an array corresponding to each local component ! do k=1,10 ! read(40,'(2f8.2)',advance='no') (Gsc(k,l),l=1,10 ) ! read(40,*) (Gsc(k,l),l=1,10 ) READ (40,*) ((Gsc(k,l), l = 1, 10), k = 1, 10) !enddo read(40,*) enddo end program readdata
Last edited by a moderator: