On 1/13/2019 10:52 AM, FortranFan wrote:
> The standard is rather silent on this but considering the fact it says "It is processor dependent whether any other object is contiguous" at all, one would think this is entirely in the processor-dependent category and the onus being on the coder. The compiler can of course choose to be "kind" and "helpful" to coders as appropriate.
>
> The book Modern Fortran Explained, the previous edition toward Fortran 2008 or the current edition including Fortran 2018, has in the section of CONTIGUOUS attribute a statement among other descriptions, "For an assumed-shape array, it specifies that if the corresponding actual is not contiguous, copy-in copy-out is used (to) make the dummy arguments contiguous."
This was the subject of interpretation F08/0061 (see
https://j3-fortran.org/doc/year/11/11-199r2.txt) that was approved for
F2008 Corrigendum 2. The change also made its way into F2018.
F2008 says: "The CONTIGUOUS attribute specifies that an assumed-shape
array can only be argument associated with a contiguous effective
argument,..."
where F2018 says: "The CONTIGUOUS attribute specifies that an
assumed-shape array is contiguous..."
The effect of this is that the processor (compiler) must ensure that the
effective argument is contiguous, whether or not the actual argument is
contiguous.
The original paper (11-199r2) suggests adding a note saying that this
may be accomplished by copy-in/copy-out, but that did not make it to the
paper that was passed. You can see the text that was passed in
https://j3-fortran.org/doc/year/17/17-020.txt
--
Steve Lionel
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn:
https://www.linkedin.com/in/stevelionel
Blog:
http://intel.com/software/DrFortran