Problems with record size from writing files

Problems with record size from writing files

HelloI've a short code-snipe included. It shoukd write everything in one line. With intel fortran compiler 10  and 12.1.2 20111128 we get several lines, depending on the value of satzlsatzl=100000 makes 2 lines, satzl=200000 makes 12 lines of output.what could it be, how i can fix this problem?
Compiled with gfortran makes no problems.With best regardsAxel(add file didn't work with chromium)program arraywritecomplex(8) :: aCOMPLEX(8),ALLOCATABLE :: H0(:,:)integer :: i,j,k,p,NBWINTEGER(4)             :: NFILINTEGER(4)             :: satzlNBW=33satzl=100000NFIL=12OPEN(NFIL,FILE='DM.DAT',recl=satzl)rewind nfilALLOCATE(H0(NBW,NBW))do p=1,NBW do i=1,NBW    H0(p,i)=(1.0,1.0) end doend do          WRITE(NFIL,*) "TEST",H0(:,:) CLOSE(NFIL)end program arraywriteprogram arraywritecomplex(8) :: aCOMPLEX(8),ALLOCATABLE :: H0(:,:)integer :: i,j,k,p,NBWINTEGER(4)             :: NFILINTEGER(4)             :: satzlNBW=33satzl=100000NFIL=12OPEN(NFIL,FILE='DM.DAT',recl=satzl)rewind nfilALLOCATE(H0(NBW,NBW))

do p=1,NBW do i=1,NBW
    H0(p,i)=(1.0,1.0)
 end doend do
          WRITE(NFIL,*) "TEST",H0(:,:) 
CLOSE(NFIL)

end program arraywrite

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
mecej4's picture

When you use list-directed output, you cannot expect the formatting to be done in a specific way. Nor can you expect list-directed output to be done in exactly the same way by two different compilers.

If fine control over the format is important to you, use your own format strings instead of relying on list-directed output.

Login to leave a comment.