Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29434 Discussions

Problems with record size from writing files

andersartig
Beginner
790 Views
Hello
I'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 satzl
satzl=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 regards
Axel
(add file didn't work with chromium)
program arraywrite
complex(8) :: a
COMPLEX(8),ALLOCATABLE :: H0(:,:)
integer :: i,j,k,p,NBW
INTEGER(4)             :: NFIL
INTEGER(4)             :: satzl
NBW=33
satzl=100000
NFIL=12
OPEN(NFIL,FILE='DM.DAT',recl=satzl)
rewind nfil
ALLOCATE(H0(NBW,NBW))
do p=1,NBW
 do i=1,NBW
    H0(p,i)=(1.0,1.0)
 end do
end do
          WRITE(NFIL,*) "TEST",H0(:,:) 
CLOSE(NFIL)
end program arraywrite
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 arraywrite
0 Kudos
1 Reply
mecej4
Honored Contributor III
790 Views
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.
0 Kudos
Reply