weird problem Fortran 77

From: Qian Yong Chen (cqy_at_cfm.brown.edu)
Date: 10/30/03


Date: Thu, 30 Oct 2003 11:36:27 -0500

I have a small code which runs well under compaq Fortran,
but gives segmentation error under Sun workstation.
The same code run well under Sun 2 years ago. That is before they
upgrade the Fortran compiler.
I found out what causes the problem. But don't know why. See some
examples:

 Code with problem;

    program main
    integer N
    N = 10

    call sub(N)

    end -----------> end of main

    subroutine sub(N)
    real*8 a(0:N)

    a(0) = 5 -----------> crashes right here.

    end

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.



Relevant Pages

  • Re: weird problem Fortran 77
    ... >I have a small code which runs well under compaq Fortran, ... >but gives segmentation error under Sun workstation. ... >upgrade the Fortran compiler. ...
    (comp.lang.fortran)
  • weird problem Fortran 77
    ... I have a small code which runs well under compaq Fortran, ... but gives segmentation error under Sun workstation. ... Or if I only declare a, ...
    (comp.lang.fortran)