Re: Question on allocatable arrays in Fortran 90
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Mon, 30 Jan 2006 22:13:25 -0800
Shi Jin <jinzishuai@xxxxxxxxxxx> wrote:
> Is the allocatable arrays in Fortran 90 always continuous in memory?
In essense, yes. The standard doesn't say so in quite those terms, but
there are requirements that pretty much demand it in practice.
> Then I figured +out that the top array does NOT seem to be continuous and
> was somehow copied first to a +continuous array and then the function was
> called.
How did you "figure this out?" You are giving us your conclusions
instead of the raw data. I don't see enough actual data to comment
intelligently. In particular.
Is the subroutine called absolutely identical in both cases, or is there
a difference that you thought was unimportant, so you didn't mention?
How did you time this and determine what times the various parts took?
Is there a chance that your timing includes the time of the allocate
itself?
> code2:real,allocatable::top(:,:,:,:)
> allocate(top(N,N,N,3))
> real::newtop(N,N,N,3)
> newtop=top
> call myfunc(newtop)
This is "obviously" not actual code because you have an executable
statement between the two declarations. This makes me wonder what other
parts of the actual code you thought were unimportant and therefore
didn't show us.
It is often the case that when someone asks for debugging help, the
problem lies in the part of the code that they didn't think was
relevant, and thus didn't show.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- References:
- Question on allocatable arrays in Fortran 90
- From: Shi Jin
- Question on allocatable arrays in Fortran 90
- Prev by Date: Re: Need clarification on unformatted IO
- Next by Date: Re: Are generic linked lists possible in Fortran95?
- Previous by thread: Question on allocatable arrays in Fortran 90
- Next by thread: Re: Get Rich
- Index(es):
Relevant Pages
|
|