Re: weird problem Fortran 77

From: Michael Metcalf (metcalfm_at_acm.org)
Date: 10/30/03


Date: Thu, 30 Oct 2003 17:54:16 +0100


"Qian Yong Chen" <cqy@cfm.brown.edu> wrote in message
news:3FA13E0B.15D01B1C@cfm.brown.edu...
[snip]
> If the value of N is given in the subroutine, it works fine.
> Or if I only declare a(N), it also works.
>
> Any ideas? Thanks.

Your array a is an automatic array as defined by Fortran 90. Your program is
a valid Fortran 90 program (apart from the *8) and the problem would be
caused by a compiler bug if you're working with a Fortran 90 compiler. If
you really are using a Fortran 77 compiler, then the code is illegal. See
also "Fortran 90/95 Explained", Section 6.4.

Regards,

Mike Metcalf



Relevant Pages

  • Re: use of erf intrinsic
    ... while it is also legal to declare a referenced function ... within the calling functionor even block, a la classic FORTRAN, ... The implementation (compiler) is required to check that references ... If you use K&R1 syntax, the compiler is not required to detect ...
    (comp.lang.fortran)
  • Re: A question on Newtons Method
    ... >> I can't believe you'd advise a noob to use a compiler which is still ... > production codes and codes from textbooks. ... > The Fortran standard generally does not specify the required behavior ... >> another important class of hassle which most numerical programmers ...
    (sci.math.num-analysis)
  • Fortran Resources (July 2004)
    ... and the standard for the Fortran language and its derivatives. ... WHERE CAN I OBTAIN A FORTRAN 95 COMPILER? ... Absoft Fortran compilers, debuggers, and development tools for Windows, ... are available for Linux systems. ...
    (comp.lang.fortran)
  • Fortran Resources (August 2004)
    ... and the standard for the Fortran language and its derivatives. ... Absoft Fortran compilers, debuggers, and development tools for Windows, ... and Linux include source-compatible Fortran 95 compiler suites ... are available for Linux systems. ...
    (comp.lang.fortran)
  • Fortran Resources (Last Issue)
    ... the, then, new Fortran 90. ... and the standard for the Fortran language and its derivatives. ... WHERE CAN I OBTAIN A FORTRAN 95 COMPILER? ... The Fortran Company offers F, the subset language, for Unix and Windows, ...
    (comp.lang.fortran)

Loading