[net.lang.f77] f77 bug or am I doing something wrong?

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!phaedrus

wmr@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"