Hi MatColgrove,
I was in a discussion with the main developers from the project I’m contributing with CUDA Fortran ports and we have the following situation concerning GFORTRAN and PGFORTRAN. I understand the affirmation in the Fortran Interpretation Document, but this case works in all compilers we test, INTEL, GNU, and CRAY. Also, follow strict the document I don’t see how multiple groups in a namelist would work. Using OPEN and READ directly from a file all goes fine, even with PGI.
[bsc99214@p9login1 ~]$ cat open_buff2.f90
integer :: i,j, a, b
CHARACTER(LEN=132) :: buff
namelist/nammpp/ i,j
namelist/namctl/ a,b
buff=' &nammpp i = 10 j = 4 / &namctl a = 5 b = 3 /'
!print *, buff
read(buff,nml=nammpp)
print *, i,j
read(buff,nml=namctl)
print *, a,b
end
With GCC
[bsc99214@p9login1 ~]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/gpfs/apps/POWER9/GCC/10.1.0/bin/../libexec/gcc/ppc64le-redhat-linux/10.1.0/lto-wrapper
Target: ppc64le-redhat-linux
Configured with: ../configure --prefix=/apps/GCC/10.1.0 --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --without-system-libunwind --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-gnu-indirect-function --enable-secureplt --with-long-double-128 --enable-targets=powerpcle-linux --disable-multilib --with-cpu-64=power9 --with-tune-64=power9 --build=ppc64le-redhat-linux --host=ppc64le-redhat-linux --enable-ld --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-linux-futex --enable-lto --enable-plugin --enable-libada --enable-libssp --disable-libssp --disable-libmudflap --enable-version-specific-runtime-libs --program-suffix=-10.1
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC)
[bsc99214@p9login1 ~]$ gfortran open_buff2.f90
[bsc99214@p9login1 ~]$ ./a.out
10 4
5 3
With PGFORTRAN
[bsc99214@p9login1 ~]$ pgfortran -V
pgfortran (aka nvfortran) 20.9-0 linuxpower target on Linuxpower
PGI Compilers and Tools
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
[bsc99214@p9login1 ~]$ pgfortran open_buff2.f90
[bsc99214@p9login1 ~]$ ./a.out
10 4
FIO-F-228/namelist read/internal file/end of file reached without finding group.
In source file open_buff2.f90, at line number 11