Re: Allocatable Arrays As Outputs
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Wed, 30 Jan 2008 13:29:25 -0800
<bonzaboy@xxxxxxxxx> wrote:
You can try using pointers instead (they are pretty simple to use in
f95).
However, they would do nothing to solve either of the problems with the
OP's code, as pointers have exactly the same requirements. Namely
1. The array in the main program also needs the comparable property
(pointer or allocatable as the case may be).
2. The subroutine needs an explicit interface.
The only thing solved by using pointer is to make the code
f90/f95-conforming, as allocatable dummy arguments require either f2003
or f95+TR. But most compilers do support the TR by now, and that does
not appear to be the OP's problem.
I would say that changing to using a pointer here would not solve any
problems, but might add new ones (memory management problems and the
likelihood of errors both go way up with pointers compared to
allocatables).
If you declare propertynames as a pointer...
You also have to use the
save attribute in the subroutine to ensure the memory isn't lost when
the subroutine exits.
That is not so.
In fact, you are not allowed to use SAVE for dummy arguments at all.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Allocatable Arrays As Outputs
- From: glen herrmannsfeldt
- Re: Allocatable Arrays As Outputs
- References:
- Allocatable Arrays As Outputs
- From: Infinity77
- Re: Allocatable Arrays As Outputs
- From: bonzaboy
- Allocatable Arrays As Outputs
- Prev by Date: passing a variable number of args/vectors to a routine
- Next by Date: Re: Allocatable Arrays As Outputs
- Previous by thread: Re: Allocatable Arrays As Outputs
- Next by thread: Re: Allocatable Arrays As Outputs
- Index(es):
Relevant Pages
|