- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
Compiled with gfortran makes no problems.
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
If fine control over the format is important to you, use your own format strings instead of relying on list-directed output.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page