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

Tobias Burnus burnus
Mon Jun 27 09:59:22 EDT 2011

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

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 


"   subcomponent <structure> direct component that is a 
subobject of the structure (6.4.2)"

"   direct component   one of the components, or one of the 
direct components of a nonpointer nonallocatable component (4.5.1)"

Related example:

type t
   type(lock_type), allocatable :: a
end type t
type(t) :: x


More information about the J3 mailing list