(j3.2006) LOCK_TYPE question regarding C1302 and allocatable -without coarray

malcolm at nag-j.co.jp malcolm
Tue Jun 28 15:59:43 EDT 2011


??????
  Tobias Burnus <burnus at net-b.de>
???????????????

> The following is probably trivially visible from the standard, but I 
> fail to see it (it's probably too warm w/ 30+ C = 86+ F).
> 
> I think the following code is invalid - as there is no coarray even 
> though there is a lock variable:
> 
> use iso_fortran_env
> implicit none
> type t
>    type(lock_type) :: a
> end type t
> type t2
>    type(lock_type), allocatable :: c1
> end type t2
> type(t2) :: x
> end
> 
> However, I think the following constraint is not violated:
> 
> "C1302 A named variable of type LOCK_TYPE shall be a coarray. A named 
> variable with a noncoarray subcomponent of type LOCK_TYPE shall be a 
> coarray."

It looks to me like X has a noncoarray subcomponent of type LOCK_TYPE.

> 
> with
> 
> "1.3.33.3   subcomponent <structure> direct component that is a 
> subobject of the structure (6.4.2)"
> 
> "1.3.33.1   direct component   one of the components, or one of the 
> direct components of a nonpointer nonallocatable component (4.5.1)"

So definitely a subcomponent then, since c1 is a component.


Cheers,
-- 
......................Malcolm.




More information about the J3 mailing list