Re: allocating arrays, trouble



To repeat, you did not declare the variable, as you misspelled it.

Michael


In article <13e70ff2-e276-428a-8ec6-8258be941aa5@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
chain_lube@xxxxxxxxxxx says...

On Nov 26, 2:21 pm, Arjen Markus <arjen.mar...@xxxxxxxxxx> wrote:
On 26 nov, 14:59, Reinhold Bader <Ba...@xxxxxx> wrote:



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

F=F6rster vom Silberwald wrote:

[snip]

PS: However, still I am interested in my original question: why can't
I pass buffer integer variables to a subroutine so as to allocate an
array and memory? Is this due to my ifort compiler?

ifort puts automatics on the stack. There are two workarounds: Either

* increase your stack limit (e.g., via the "ulimit -s ..." command) in y=
our
shell before running a.out
* use the -heap-arrays switch supported by newer ifort (9.1+) releases.

Regards
Reinhold

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE -http://enigmail.mozdev.org

iD8DBQFHStFfFVLhKuD7VgsRAn9EAJ43pnr2UluwfoGB027LDBxlEekRCQCeOFy6
pQd3K8JNYAQiHnSnH6EjvMQ=3D
=3DItq0
-----END PGP SIGNATURE-----

Well, actually there is another one:

Explicitly allocate the arrays you need at the start.

BTW, Steve Lionel posted a link the other day to a series
of articles that expose some of the finer details of Fortran.
One of these concerns the use of the stack. I recommend
reading it.

Regards,

Arjen


Thanks for all the tips (I really appreciate it). But still I do not
get it: what is the difference between passing a buffer variable
(which actually holds the dimension!) and hard coding the dimension
into the declare statement?

Is this a compiler issue or just prohibited in Fortran 90?

Thanks

.



Relevant Pages

  • Re: Function declarations - why are they needed?
    ... >> For example in Python functions are defined once and never declared ... The same holds in Fortran where you need not declare ... Fortran is typically used for large MLOC programs and there is *no* ... else) which require the called routine to have an 'explicit interface' ...
    (comp.lang.c)
  • United with a KISS
    ... in Fortran as in C, ... KISS RNG, ... Furthermore, this common output sequence ... declare fixed binary; ...
    (comp.lang.pl1)
  • Re: double confusion
    ... Ian Bush schrieb: ... scope, ... Modules that came in in Fortran 90, where you can just declare things "once at ...
    (comp.lang.fortran)
  • Re: function prototype declaration
    ... If I change IBFLEN to an int ... It looks like you're trying to write Fortran in C, ... Furthermore, variables can be *declared* in headers, but they ... don't need to declare them in the header at all. ...
    (comp.lang.c)
  • Re: PK for Fact Table?
    ... of Ralph's writings say the PK is the a composite of the ... dimension FK's. ... The first is whether any candidate key exists. ... If you declare the PK in the fact table, ...
    (comp.databases)