[J3] is whole array a variable?
John Reid
John.Reid at stfc.ac.uk
Sat Apr 28 04:48:56 EDT 2018
Anton Shterenlikht via J3 wrote:
> Malcolm, I'm sorry about the confusion.
> Maybe I am overthinking it.
> Is this conforming?
>
> integer i(10)[*]
> if ( this_image() .eq. 1 ) i(3)[2] = i(3)
> i(1) = 0
> end
>
> I think yes, because i(3) and i(1) are different variables.
I agree.
> It just occurred to me that perhaps this does violate
> 11.6.2 Segments, para3, bullet 1
> because both variables, i(3) and I(1),
> are parts of the same array i.
Yes, but this does cause the whole array to become defined. See 19.6.5
for the ways variables become defined.
>
> Are different components of a variable of DT themselves
> variables, i.e. is this conforming?
Yes, see 3.154.
>
> type t
> integer i,j
> end type t
> type(t) :: var[*]
> if ( this_image() .eq. 1 ) var[2]%i = var%i
> var%j = 0
> end
>
> Are var%i and var%j different variables as far
> as the rules of 11.6.2 Segments, para3, bullet 1 apply?
Yes, see also 19.6.5 (1).
Cheers,
John.
More information about the J3
mailing list