public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with g77 Fortran
@ 2002-07-03 14:13 Rob Willson
  2002-07-04 13:38 ` Toon Moene
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Willson @ 2002-07-03 14:13 UTC (permalink / raw)
  To: gcc-help

Hello,
  I have GNU-Fortran installed on my PC LInux system and am having
problems compiling my old Fortran 77 programs on the new system.
Specifically, I get an error when I try to read a data file using a
statements like


open(unit=1,file='datafile.dat', recl=132,status='old')

.
.
      Read(1,10) x,y,z
10    FOrmat(3f10.2)

When I say:  f77 -o prog prog.f , I get a statement.." sfe: formatted io
is not allowed"


How can I modify my program to make IO compatible with the GNU compiler?

ALso, is there a source for understanding the basics of GNU77? For
example, I learned that the "type" statement is not valid, but one must
use "print" instead.

Thanks for your help.

Rob Willson
Dept. Anatomy and Cell Biology
Tufts University School of Medicine
Boston, MA

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with g77 Fortran
  2002-07-03 14:13 Problem with g77 Fortran Rob Willson
@ 2002-07-04 13:38 ` Toon Moene
  2002-07-10 14:55   ` Toon Moene
  0 siblings, 1 reply; 3+ messages in thread
From: Toon Moene @ 2002-07-04 13:38 UTC (permalink / raw)
  To: Rob Willson; +Cc: gcc-help

Rob Willson wrote:

>   I have GNU-Fortran installed on my PC LInux system and am having
> problems compiling my old Fortran 77 programs on the new system.
> Specifically, I get an error when I try to read a data file using a
> statements like
> 
> open(unit=1,file='datafile.dat', recl=132,status='old')
> 
> .
> .
>       Read(1,10) x,y,z
> 10    FOrmat(3f10.2)
> 
> When I say:  f77 -o prog prog.f , I get a statement.." sfe: formatted io
> is not allowed"

The "recl=132" makes the run time library think this is a direct access
file.  Removing it will make the program work.

I'll look up whether this is correct behaviour.

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with g77 Fortran
  2002-07-04 13:38 ` Toon Moene
@ 2002-07-10 14:55   ` Toon Moene
  0 siblings, 0 replies; 3+ messages in thread
From: Toon Moene @ 2002-07-10 14:55 UTC (permalink / raw)
  To: Rob Willson, gcc-help

I wrote:

> Rob Willson wrote:

> > open(unit=1,file='datafile.dat', recl=132,status='old')

> >       Read(1,10) x,y,z
> > 10    FOrmat(3f10.2)
> >
> > When I say:  f77 -o prog prog.f , I get a statement.." sfe: formatted io
> > is not allowed"
> 
> The "recl=132" makes the run time library think this is a direct access
> file.  Removing it will make the program work.

This analysis is not correct - it makes the run time library think this
is an unformatted file.

> I'll look up whether this is correct behaviour.

I asked around on comp.lang.fortran; this is the result:

Fortran 77 left this open - Fortran 90 interpreted it as:  The record
length is the maximum you can use (write to) on sequential I/O.

I made a fix to the g77 run time library to allow RECL=nnn without
having it assuming you want unformatted I/O.

This change will be in the next major release.

Cheers,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-07-10 21:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-03 14:13 Problem with g77 Fortran Rob Willson
2002-07-04 13:38 ` Toon Moene
2002-07-10 14:55   ` Toon Moene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).