Re: dimension question



sc <stas_ch@xxxxxxxx> wrote:

Well, array storage method in fortran is a little bit different from
other languages I know.

Some other languages use row-first instead of column-first ordering, but
your original code (which passed a 100x100 actual argument to a 2x2
dummy) wouldn't have worked any better that way.

If you you know of any languages where anything like that would have
worked, then what is happening is that it is working with a slice of the
larger array - not just counting on the memory layout to happen to fit
(it won't). The notation might possibly hide that, but that's bound to
be what is happening. Fortran does have a way to do that - at least as
of f90. That's the array slice notation that Mike Metcalf illustrated.

If you restrict yourself to Fortran 77, then yes, lots of array-related
things are harder. Fortran 77 doesn't have a concept of an array slice;
all you can do is play tricks with the memory layout.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: dimension question
    ... That's the array slice notation that Mike Metcalf illustrated. ... Otherwise, C89 arrays do work similar to Fortran arrays, ... There are also interpreted languages like Matlab, Mathematica, and R ...
    (comp.lang.fortran)
  • Re: Fortran now in the Great Language Shootout
    ... > representative of how Fortran compares to the other programming ... > languages than the current naive implementation in multiple languages. ...
    (comp.lang.fortran)
  • Re: what is the most suitable Linux platform for Programmers and software developers
    ... C, C++, Perl, Python, Lisp, and a bunch of other languages are supported ... There are FORTRAN compilers, but FORTRAN ... Look at the Linux ...
    (comp.os.linux.misc)
  • Re: Fortran bashing in the MATLAB newsgroup
    ... try to keep up with more modern languages. ... There is one sole reason for teaching Fortran ... I've got my own ideas about what modern Fortran is good for and why I ... As an example of item 1, if you're talking to C/C++ programmers, ...
    (comp.lang.fortran)
  • Re: Clearly, it is too late to fix c99 - C is dead
    ... operations on integers (some other languages supported this, ... > strict formatting rules. ... Cobol has an odd reliance on a strict ... FORTRAN did in the days it was all-caps; ...
    (comp.lang.c)