Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: Allocatable...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 19 Topic 8191 of 8774
Post > Topic >>

Re: Allocatable arrays in derived types

by nospam@[EMAIL PROTECTED] (Richard Maine) Apr 29, 2008 at 02:26 AM

relaxmike <michael.baudin@[EMAIL PROTECTED]
> wrote:

> I don't remember exactly where I read it on this forum,
> but I remember that the difference between allocatable and pointer
> arrays is that, when an allocatable array goes out of scope,
> it is automatically deallocated.

That is *A* difference. It is certainly not *THE* difference.

> This is the main reason for the overhead of a allocatable
> array

No. That has pretty much nothing to do with it. Indeed, the size
overhead of an alocatable array is typically the same as that for a
pointer array.

> there is also an additional bookkeeping
> for the derived type itself ?

Not typically. There can be padding in some cases.

> And what if one computes directly the size of the allocatable
> array ? I expect it to be 1, but is that true ?

No. One would actiually have a bit of trouble computing such a thing (I
assume you mean the size of the descriptor or some such thing). If you
did, it would more likely be the same as that of the component. A single
integer is "clearly" insufficient to store the necessary data, which at
a minimum for a rank 1 array is the lower bound, size, and memory
location.

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




 19 Posts in Topic:
Allocatable arrays in derived types
Gib Bogle <bogle@[EMAI  2008-04-29 19:57:51 
Re: Allocatable arrays in derived types
Arjen Markus <arjen.ma  2008-04-29 01:23:58 
Re: Allocatable arrays in derived types
relaxmike <michael.bau  2008-04-29 02:03:17 
Re: Allocatable arrays in derived types
nospam@[EMAIL PROTECTED]   2008-04-29 02:26:48 
Re: Allocatable arrays in derived types
"Jugoslav Dujic"  2008-04-29 12:24:18 
Re: Allocatable arrays in derived types
relaxmike <michael.bau  2008-04-29 04:14:21 
Re: Allocatable arrays in derived types
"Jugoslav Dujic"  2008-04-29 14:08:55 
Re: Allocatable arrays in derived types
"James Van Buskirk&q  2008-04-29 14:30:21 
Re: Allocatable arrays in derived types
relaxmike <michael.bau  2008-04-29 06:08:04 
Re: Allocatable arrays in derived types
nospam@[EMAIL PROTECTED]   2008-04-29 09:06:51 
Re: Allocatable arrays in derived types
glen herrmannsfeldt <g  2008-04-29 08:41:18 
Re: Allocatable arrays in derived types
nospam@[EMAIL PROTECTED]   2008-04-29 14:14:44 
Re: Allocatable arrays in derived types
paul.richard.thomas@[EMAI  2008-04-29 22:25:33 
Re: Allocatable arrays in derived types
"James Van Buskirk&q  2008-04-30 00:20:44 
Re: Allocatable arrays in derived types
paul.richard.thomas@[EMAI  2008-04-30 10:19:07 
Re: Allocatable arrays in derived types
Gib Bogle <bogle@[EMAI  2008-05-02 08:57:21 
Re: Allocatable arrays in derived types
paul.richard.thomas@[EMAI  2008-04-29 05:58:51 
Re: Allocatable arrays in derived types
Damian <damian@[EMAIL   2008-04-30 00:59:43 
Re: Allocatable arrays in derived types
paul.richard.thomas@[EMAI  2008-05-01 02:40:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 23:35:13 CDT 2008.