To make a long story short that dealt with complex variables and segfaults
and allocatable arrays being defined as size zero that could not be,
I think all the problems have a root cause having to do with REAL() in
nvfortran(1). anyone see any reason ‘A’ and ‘B’ should not be returning
[1,3,5] and [2,4,6] ?
program testit
use, intrinsic :: iso_fortran_env, only : stdout=>OUTPUT_UNIT
character(len=*),parameter :: gen='(*(g0,1x))'
integer,allocatable :: arr(:)
arr=[1,2,3,4,5,6]
write(stdout,gen)'A',real(arr(1::2))
write(stdout,gen)'B',real(arr(2::2))
write(stdout,gen)'C',real(arr(1:))
write(stdout,gen)'D',real(arr)
write(stdout,gen)'E',arr(1::2)
write(stdout,gen)'F',arr(2::2)
write(stdout,gen)'a',size(real(arr(1::2)))
write(stdout,gen)'b',size(real(arr(2::2)))
write(stdout,gen)'c',size(real(arr(1:)))
write(stdout,gen)'d',size(real(arr))
write(stdout,gen)'e',size(arr(1::2))
write(stdout,gen)'f',size(arr(2::2))
end program testit
nvfortran 20.7-0 LLVM 64-bit target on x86-64 Linux -tp nehalem
NVIDIA Compilers and Tools
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
A 1.000000 3.000000 5.000000 0. 0. 16017.00
B 2.000000 4.000000 6.000000 0. 0.
C 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000
D 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000
E 1 3 5
F 2 4 6
a 6
b 5
c 6
d 6
e 3
f 3