Re: passing variables.... crazy error?




Jim schreef:
"Dave" <davemccloskey@xxxxxxxxx> wrote in message
news:1169065316.977413.165600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Unfortunately, I will be working on legacy code, so I am learning F77.

Thomas Koenig wrote:
Dave <davemccloskey@xxxxxxxxx> wrote:
X + Y = 154136.

Why?

Run the program though ftnchek after adding a program name,
and it will result in

$ ftnchek foo.f

FTNCHEK Version 3.3 November 2004

File foo.f:
12 END
^
Warning near line 12 col 7 file foo.f: MYSUM not set when RETURN
encountered

Warning in module MYSUM in file foo.f: Variables declared but never
referenced:
MYSUM declared at line 9 file foo.f

Warning in module MYSUM in file foo.f: Variables set but never used:
Z set at line 11 file foo.f

0 syntax errors detected in file foo.f
3 warnings issued in file foo.f

Warning: Subprogram MYSUM invoked inconsistently
Defined in module MYSUM line 9 file foo.f as type real
Invoked in module MAIN line 5 file foo.f as type intg

But really, Fortran 77 is only for legacy code. Use Fortran 95
instead.

Perhaps you are expected to use F77, but those errors are errors in any
version of Fortran.
Jim

Also, almost all FORTRAN 77 programs are accepted by Fortran 90/95
compilers as well.
(The main caveat is that not all extensions to the FORTRAN 77 standard
are accepted)

There is very little reason, IMO, to stick to FORTRAN 77, even if this
is a legacy system.

Regards,

Arjen

.



Relevant Pages

  • Re: passing variables.... crazy error?
    ... Run the program though ftnchek after adding a program name, ... Warning near line 12 col 7 file foo.f: ... Warning in module MYSUM in file foo.f: Variables set but never used: ... Fortran 77 is only for legacy code. ...
    (comp.lang.fortran)
  • Re: passing variables.... crazy error?
    ... Run the program though ftnchek after adding a program name, ... Warning near line 12 col 7 file foo.f: ... Warning in module MYSUM in file foo.f: Variables set but never used: ... Fortran 77 is only for legacy code. ...
    (comp.lang.fortran)
  • Re: passing variables.... crazy error?
    ... Unfortunately, I will be working on legacy code, so I am learning F77. ... Run the program though ftnchek after adding a program name, ... Warning near line 12 col 7 file foo.f: ... Warning in module MYSUM in file foo.f: Variables set but never used: ...
    (comp.lang.fortran)
  • Re: warning on running image !!!!!
    ... Compaq visual Fortran returns this warning: ... It is warning you that your program may not run on Windows 95 or Windows ... Intel Fortran Support ...
    (comp.lang.fortran)
  • Re: The structure contains one or more misaligned fields
    ... Steve Lionel wrote: ... warning when compiling a fairly big Fortran code base. ... see the Intel Fortran documentation under Optimizing ...
    (comp.lang.fortran)