Sorry ......
Ignore "allocatable" entry in the type TYP.
I was not careful enough.
What really interested me is pointer (or array)
assignment of the "pointer" entry.
ALexei
Ted Stern wrote:
> >>>>> Alexei Matveev writes:
>
> Alexei> Dear Everybody,
>
> Alexei> Can anybody explain me what should happen
> Alexei> after assignment
> Alexei> x = y
> Alexei> if the typed variables declared as:
>
> Alexei> type :: TYP
> Alexei> real,pointer :: p(:)
> Alexei> real,allocatable :: a(:)
>
> Just out of curiousity, which compiler allowed you to declare "a" as
> allocatable? Although this will be present in the 200X standard, I don't
> think all compilers are yet compliant with this.
>
> Alexei> end type
>
> Alexei> type(TYP) :: x,y
>
> Alexei> call allocate_and_place_some_data(y)
>
> Alexei> x = y
> Alexei> ^^^^^^^^^
>
> My understanding is that you get the effect of
>
> x % p => y % p ! x%p points to same memory as y%p
>
> for the first part. However, I don't think you can get
>
> x % a = y % a
>
> unless you have previously allocated x % a with the same shape as y % a.
>
> Alexei> Thanks in anticipation,
>
> Alexei> Alexei Matveev
>
> HTH (hope that helps...)
> Ted
> --
> Ted Stern Analysis/Porting/Tuning, Engineering Applications
> Cray Inc. http://www.cray.com
> 411 First Avenue South, Suite 600 Direct 206-701-2182, Main 206-701-2000
> Seattle, WA 98104-2860 FAX 206-701-2500
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|