PROBLEM WITH ALLOCATABLE ARRAYS
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.fortran Profile…
 Up
PROBLEM WITH ALLOCATABLE ARRAYS         


Author: jdturner
Date: Jul 16, 2008 08:38

ALL,
I define a data type as:

TYPE TENSOR
REAL(DP)::T0
REAL(DP),ALLOCATABLE,DIMENSION(:) :: T1
REAL(DP),ALLOCATABLE,DIMENSION(:,:) :: T2
REAL(DP),ALLOCATABLE,DIMENSION(:,:,:) :: T3
REAL(DP),ALLOCATABLE,DIMENSION(:,:,:,:) :: T4
REAL(DP),ALLOCATABLE,DIMENSION(:,:,:,:,:):: T5
END TYPE

Define variable and allocate as

TYPE(TENSOR):: S,Y,Z,X,W

CALL ALLOCATE_NTUPLE( S ); S = ZERO
CALL ALLOCATE_NTUPLE( Y ); Y = ZERO
CALL ALLOCATE_NTUPLE( Z ); Z = ZERO
CALL ALLOCATE_NTUPLE( W ); W = ZERO
CALL ALLOCATE_NTUPLE( X ); X = ZERO

Y=3.0D0 !overloading works
W=4.0D0*Y !!!!Never get past here!
Show full article (5.84Kb)
7 Comments
Re: PROBLEM WITH ALLOCATABLE ARRAYS         


Author: Dick Hendrickson
Date: Jul 16, 2008 08:53

Two comments. Which version of which compiler are you using.
Allocatable components were added to Fortran late in the game
and early implementations had bugs.

Also, try putting in some diagnostic print statements after
the defined assignment. You say it works, but all you know for
sure is that it didn't fail catastrophically ;). Try printing
allocation status and bounds.

Dick Hendrickson
jdturner wrote:
> ALL,
> I define a data type as:
>
> TYPE TENSOR
> REAL(DP)::T0
> REAL(DP),ALLOCATABLE,DIMENSION(:) :: T1
> REAL(DP),ALLOCATABLE,DIMENSION...
Show full article (6.62Kb)
no comments
Re: PROBLEM WITH ALLOCATABLE ARRAYS         


Author: jdturner
Date: Jul 16, 2008 16:02

On Jul 16, 10:53 am, Dick Hendrickson att.net>
wrote:
> Two comments. Which version of which compiler are you using.
> Allocatable components were added to Fortran late in the game
> and early implementations had bugs.
>
> Also, try putting in some diagnostic print statements after
> the defined assignment. You say it works, but all you know for
> sure is that it didn't fail catastrophically ;). Try printing
> allocation status and bounds.
>
> Dick Hendrickson
>
> jdturner wrote:
>> ALL,
>> I define a data type as:
>
>> TYPE TENSOR
>> REAL(DP)::T0
>> REAL(DP),ALLOCATABLE,DIMENSION(:) :: T1 ...
Show full article (15.49Kb)
no comments
Re: PROBLEM WITH ALLOCATABLE ARRAYS         


Author: Jan Vorbrüggen
Date: Jul 17, 2008 06:13

> Using Intel 9.1

That's two major releases and dunno how many years behind the current
status. Even if the compiler is broken and not your code - which is
quite possible, as that early (despite the 9 in the number) version had
many bugs -, you're not going to get any help. Upgrade to a current
version and try again.

Jan
no comments
Re: PROBLEM WITH ALLOCATABLE ARRAYS         


Author: Jugoslav Dujic
Date: Jul 17, 2008 06:16

jdturner wrote:
| On Jul 16, 10:53 am, Dick Hendrickson att.net>
| wrote:
|| Two comments. Which version of which compiler are you using.
|| Allocatable components were added to Fortran late in the game
|| and early implementations had bugs.
||
|| Also, try putting in some diagnostic print statements after
|| the defined assignment. You say it works, but all you know for
|| sure is that it didn't fail catastrophically ;). Try printing
|| allocation status and bounds.


I compiled your code (from the first post) with last Ifort for
Windows, 10.1.024

The only obvious error I see in your code is
Show full article (1.43Kb)
no comments
Re: PROBLEM WITH ALLOCATABLE ARRAYS         


Author: Dick Hendrickson
Date: Jul 17, 2008 09:27

jdturner wrote:
> On Jul 16, 10:53 am, Dick Hendrickson att.net>
> wrote:
>> Two comments. Which version of which compiler are you using.
>> Allocatable components were added to Fortran late in the game
>> and early implementations had bugs.
>>
>> Also, try putting in some diagnostic print statements after
>> the defined assignment. You say it works, but all you know for
>> sure is that it didn't fail catastrophically ;). Try printing
>> allocation status and bounds.
>>
>> Dick Hendrickson
>>
>> jdturner wrote:
>>> ALL,
>>> I define a data type as:
>>> TYPE TENSOR
>>> REAL(DP)::T0
>>> REAL(DP),ALLOCATABLE,DIMENSION(:) :: T1 ...
Show full article (16.44Kb)
no comments
Re: PROBLEM WITH ALLOCATABLE ARRAYS         


Author: jdturner
Date: Jul 17, 2008 17:22

On Jul 17, 11:27 am, Dick Hendrickson att.net>
wrote:
> jdturner wrote:
>> On Jul 16, 10:53 am, Dick Hendrickson att.net>
>> wrote:
>>> Two comments. Which version of which compiler are you using.
>>> Allocatable components were added to Fortran late in the game
>>> and early implementations had bugs.
>
>>> Also, try putting in some diagnostic print statements after
>>> the defined assignment. You say it works, but all you know for
>>> sure is that it didn't fail catastrophically ;). Try printing
>>> allocation status and bounds.
>
>>> Dick Hendrickson
>
>>> jdturner wrote:
>>>> ALL,
>>>> I define a data type as:
>>>> TYPE TENSOR ...
Show full article (10.70Kb)
no comments
Re: PROBLEM WITH ALLOCATABLE ARRAYS         


Author: Jan Vorbrüggen
Date: Jul 18, 2008 06:14

Both Jim and Dick: Is it too much to ask that you delete those boatloads
of irrelevant quoted text when you reply? CTRL-A is your friend...

Jan
no comments

RELATED THREADS
SubjectArticles qty Group
how to join array into arraycomp.lang.perl.misc ·
Re: Does passing an array make a copy of the array in memory?comp.lang.labview ·