Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

coarrays in common blocks

Rudolf_S_
Beginner
269 Views
Hello, please, can somebody comment on the statement I found at several places that coarray cannot be a part of a common block? I would like to understand if there is a good reason for this... It complicates easy parallelization of existing code a lot, because instead of just changing things inside a common one has to create modules, and then (since I can't change all commons into modules at once) copy information between commons and modules (and have it explicitly twice, in effect). I believe that Cray complilers explicitly state that there *can* be coarrays in commons... On the other and, gfortran seems to reject that. Thanks for any comments and explanations! Best regards Rudolf Sykora
0 Kudos
2 Replies
IanH
Honored Contributor II
269 Views

The standard does not permit a common block object to be a coarray, and a diagnostic is required (constraint C5100 in F2008).

Common blocks specify storage association for the things in them.  Different scopes may declare the common block differently.  I don't see how coarrays could work in that situation - in one subroutine a storage location might be associated with a coarray, in another it might not.

0 Kudos
Rudolf_S_
Beginner
269 Views

> The standard does not permit a common block object to be a coarray, > and a diagnostic is required (constraint C5100 in F2008). > > Common blocks specify storage association for the things in > them.  Different scopes may declare the common block > differently.  I don't see how coarrays could work in that > situation - in one subroutine a storage location might be associated > with a coarray, in another it might not. Thanks! This makes enough justification. (Then the Cray compiler http://docs.cray.com/books/S-3694-50/html-S-3694-50/z1049401672pvl.html section 8.1.6 must presuppose the same order of variables everywhere...) Rudolf Sykora

0 Kudos
Reply