Re: Help requested troubleshooting code



On Feb 16, 4:15 pm, pixel <p...@xxxxxxxx> wrote:
Zachary Davis wrote:

I've run into a segmentation fault runtime error with a fortran code
that I've been writing, which I no doubt think has to do with some
out-of-bounds arrays I've declared and used, but I'm not certain of
where my mistake lies...

      program prandtl meyer

for starters,

xx.f90(1) : Error: Syntax error, found IDENTIFIER 'MEYER' when expecting
one of: <END-OF-STATEMENT>
      program prandtl meyer
----------------------^

and some 30 others...

It's fixed format code. This point is explained in other postings.

Invest in a commercial grade compiler, and your workload will get
easier. I had to hold my nose looking at this evagelically (non
fortran) inspired code style - simply awful.

The OPs code IS pretty ripe. The major problem is that all of the
variables are global, all are arrays and all arrays are the same size.
There is no distinction made between temporaries which really are
local to either the predictor loop or the corrector loop and between
variables shared between these two loops. In addition, there are
several loop invariants which should be moved out and there are
numerous common sub-expressions which should be converted to
temporaries.

While memory space is no longer a real concern, IMO the code would be
easier to understand if it was written as a series of recurrences
rather than naked access to array elements.

-- e

.



Relevant Pages

  • Re: Whats the best language to learn...
    ... over the arrays of vertices, ... loop over the selected models; ... recently my edge construction and shadow-volume rendering code ... but enums just make it easier and quicker to make ...
    (comp.programming)
  • Re: awk and arrays
    ... Bearing in mind I'm very rusty with scripting -- data structures are part of ... going to loop over it many times? ... Or if they (the regulars) enjoy the problem and start playing golf with it, ... but not a way to loop on a subset of such multi-dimensional arrays. ...
    (comp.lang.awk)
  • Re: Segmentation fault (core dumped)
    ... I have two files from where I extract values in columns (1D dynamic arrays). ... IF (fInputStatus11 /= 0) EXIT ... Note that this READ is inside the J loop, and so will read the whole ...
    (comp.lang.fortran)
  • Re: GNAT compiler switches and optimization
    ... allocating and freeing arrays, the the effects ... But I imagined allocation is just what is happening all the time ... type LIST is array of BOOLEAN; ... 2000 loop ...
    (comp.lang.ada)
  • Re: Non-rectangular 3D plot
    ... Ok I see where my code would get very confusing now. ... I originally had it accepting arrays for my inputs, ... I have shown my new code below without x and y in the for loop. ... to have y increment over a counter j for a given x value. ...
    (comp.soft-sys.matlab)