Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Strange coarray behavior

$
0
0

It seems that the following code produces all kinds of weird, non-repeatable results. The code was compiled with 16.0 and run in debug (x64) mode, while 'Enable F2003 Semantics' was set to either yes or no.

When 'Enable F2003 Semantics' is set to 'no' (which should, I believe, lead to an error on line 9), no error is encountered at all.

When 'Enable F2003 Semantics' is set to 'yes', results are non-repeatable (access violations, or array on image 1 showing only 0s, etc.)

PROGRAM TEST
IMPLICIT NONE
TYPE T
    INTEGER,ALLOCATABLE :: A(:)
    CHARACTER(LEN=2) :: S
END TYPE T
TYPE(T) :: U[*]
IF (THIS_IMAGE()==2) THEN
    U%A = [1,2,3]
    U%S = 'AB'
    WRITE(*,*) U
END IF
SYNC ALL
IF (THIS_IMAGE()==1) THEN
    WRITE(*,*) SIZE(U[2]%A)
    U = U[2]
    WRITE(*,*) U
END IF
END PROGRAM TEST

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>