phaedrus@eneevax.UUCP (06/29/84)
When I try to execute the following program I get an error
message that looks like this:
Error message that the machine types out to my program
write sfe: [100] error in format
logical unit 3, named 'fort.dat'
lately writing sequential formatted external IO
part of last format: (6o2|0)
Illegal instruction (core dumped)
What am I doing wrong?
By the way the "|" symbol between the 2 and the 0 is not a
typing error the machine does it that way.
program test
real a(100)
character*4 name
n=6
do 10 j=1,n
do 10 i=1,n
a(i+(j-1)*n)=iabs(i-j)
10 continue
name='A '
call prpmat('fort.dat',name,n,n,0,a,0)
end
subroutine prpmat(fname,id,m,n,img,xreal,ximag)
character fname*(*)
real xreal(m,n)
real ximag(m,n)
integer i,id,img,j,m,n
open(unit=3,file=fname,status='new')
write(3,*) id,m,n,img
write(6,*) id,m,n,img
100 format(4a1,3i4)
do 10 j=1,n
write(3,101) (xreal(i,j), i=1,m)
if(img.ne.0)then
write(3,101) (ximag(i,j), i=1,m)
endif
10 continue
101 format(6o20)
close(3)
return
end
If anyone can tell me what I am doing wrong I would truly
appreciate it.
thank you
pravin kumar
--
Without hallucinogens, life itself would be impossible.
ARPA: phaedrus%eneevax%umcp-cs@CSNet-Relay
UUCP: {seismo,allegra,brl-bmd}!umcp-cs!eneevax!phaedruswmr@eneevax.UUCP (06/29/84)
In Berkely Fortran ALL files are open for apending. Therefore, new files must be 'rewound' using `rewind (unit_number)'. That should get rid of the end of file error. Wayne Roberts
gwyn@brl-vgr.ARPA (Doug Gwyn ) (06/30/84)
There is no "O" format in FORTRAN 77.
woods@hao.UUCP (Greg "Bucket" Woods) (07/01/84)
> There is no "O" format in FORTRAN 77.
Yes, and it's even worse than this. The compiler does not check format
statements, except to make sure quotes and parentheses match. An error like
this won't be detected until runtime. &*%#^!
--Greg
--
{ucbvax!hplabs | allegra!nbires | decvax!stcvax | harpo!seismo | ihnp4!stcvax}
!hao!woods
"When in doubt, punt"mike@BRL-TGR.ARPA (07/04/84)
From: Mike Muuss <mike@BRL-TGR.ARPA> But F77 does let you pick a new base for numeric conversion. Small consolation. -M
phaedrus@eneevax.UUCP (07/13/84)
What was really confusing about this was the fact that this program
runs perfectly on a UNIVAC 11(something or the other)s FORTRAN77 compiler,
I think it's bloddy well embarrasing that a UNIVAC running EXEC8 has
more than a 4.1 BSD machine.
--
Let's lynch the landlord man!
ARPA: phaedrus%eneevax%umcp-cs@CSNet-Relay
UUCP: {seismo,allegra,brl-bmd}!umcp-cs!eneevax!phaedrusgwyn@brl-tgr.UUCP (07/13/84)
I don't think it is very embarassing that the UNIVAC EXEC8 Fortran compiler has non-standard extensions to the language described in the ANSI Fortran 77 specs whereas the UNIX f77 doesn't.. at least not embarassing for UNIX. Maybe your programmers should be taught how to write portable code.