public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* g77 and FORTRAN 90
@ 2001-10-27 21:55 jshier
  2001-10-28 13:02 ` Toon Moene
  0 siblings, 1 reply; 2+ messages in thread
From: jshier @ 2001-10-27 21:55 UTC (permalink / raw)
  To: help-gcc

[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]

GNU:
I am having trouble getting a certain program to compile under g77. 
I use the standard F90 code but get errors. The program compiled under a 
Windows compiler (not g77) and all previous programs worked. I am 
including my compiler output and my program file.


Jon Shier


COMPILER RESULTS:

g77 e.f
saw_static = 0
added library = -lg2c
e.f: In program `e':
e.f:21:
CONTAINS
1       2
Unrecognized statement name at (1) and invalid form for assignment or 
statement-function definition at (2)
e.f:9:
write(*,*)"What is the maximum n: "
1
e.f:24: (continued):
FUNCTION find_fact(n)
2
Statement at (2) invalid in context established by statement at (1)
e.f:9:
write(*,*)"What is the maximum n: "
1
e.f:25: (continued):
real::find_fact,total
2
Statement at (2) invalid in context established by statement at (1)
e.f:9:
write(*,*)"What is the maximum n: "
1
e.f:26: (continued):
integer::i
2
Statement at (2) invalid in context established by statement at (1)
e.f:9:
write(*,*)"What is the maximum n: "
1
e.f:27: (continued):
integer::n
2
Statement at (2) invalid in context established by statement at (1)
e.f:15:
factval=find_fact(i)
1
e.f:30: (continued):
find_fact = 1
2
Invalid declaration of or reference to symbol `find_fact' at (2) 
[initially seen at (1)]
e.f:9:
write(*,*)"What is the maximum n: "
1
e.f:40: (continued):
END FUNCTION find_fact
2
Statement at (2) invalid in context established by statement at (1)
e.f
e.f


[-- Attachment #2: e.f --]
[-- Type: text/plain, Size: 617 bytes --]

	!Anthony Mahieu
	!Jon Shier
	!Engineering 160H
	!October 17th, 2001
	
	program e
	real::factval,x,sum
	integer::i,n
	write(*,*)"What is the maximum n: "
	read(*,*)n
	write(*,*)"What is x: "
	read(*,*)x
	
	do i=0,n
		factval=find_fact(i)
		sum = sum + (x**i/factval) 
	end do
	write(*,*)"The sum is: ",sum
	stop
	
	CONTAINS
	
	!!!!FACTORIAL!!!!
	FUNCTION find_fact(n)
	real::find_fact,total
	integer::i
	integer::n	
	total=1
	if(n==0)then
     	find_fact = 1
	else if(n==1)then
     	find_fact = 1
	else
	do i=2,n
	total=total*i
	end do
	find_fact=total
	end if
	RETURN
	END FUNCTION find_fact
	RETURN
	end program e

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

* Re: g77 and FORTRAN 90
  2001-10-27 21:55 g77 and FORTRAN 90 jshier
@ 2001-10-28 13:02 ` Toon Moene
  0 siblings, 0 replies; 2+ messages in thread
From: Toon Moene @ 2001-10-28 13:02 UTC (permalink / raw)
  To: jshier; +Cc: help-gcc

jshier@mac.com wrote:

> I am having trouble getting a certain program to compile under g77.
> I use the standard F90 code but get errors. The program compiled under a
> Windows compiler (not g77) and all previous programs worked. I am
> including my compiler output and my program file.

Well, basically, you just discovered that g77 is not a full Fortran 90
compiler (it supports some of the Fortran 90 features that are not in
Fortran 77).

Unfortunately, there is no g90 (or g95) - yet.  GNU Fortran 95 is under
construction (see the web page pointed to in my signature), but at
present it doesn't do more than parse Fortran 95 programs - it doesn't
generate code from it.

-- 
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] 2+ messages in thread

end of thread, other threads:[~2001-10-28 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-27 21:55 g77 and FORTRAN 90 jshier
2001-10-28 13:02 ` 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).