(j3.2006) Does synchronization occur?

Van Snyder Van.Snyder
Tue Oct 7 19:09:17 EDT 2014


Given

  type :: T1
    real, allocatable :: A(:)[*]
  end type T1

  type :: T2
    type(t1), allocatable :: C
  end type T2

contains

  subroutine S
    type(t2), allocatable :: X
    ... assume X%C%A gets allocated
  end subroutine S

Does deallocation of X%C%A cause synchronization?

6.7.3.2p12 says there's synchronization when a subcomponent gets
deallocated by execution of an END statement, but X%C%A is not a
subcomponent because X%C is allocatable.

Does an argument by induction save us?

1. X gets deallocated by execution of the END statement.
2. X%C gets deallocated because X gets deallocated.
3. X%C%A gets deallocated because X%C gets deallocated.

6.7.3.2p11-12 only address the case of executing a deallocate statement
for which an <allocate-object> is a coarray.  6.7.3.2p6-7 don't mention
coarrays.  Does 6.7.3.2p10 save us?

This would be a lot clearer if 6.7.3.2p11-12 simply said "deallocation"
instead of mentioning only two of at least five reasons something might
be deallocated.





More information about the J3 mailing list