It is my understanding that the intrinsic inquiry function IS_CONTIGUOUS is one of the Fortran 2008 functionalities supported by the PGI Fortran compiler.
However, as far as I can see, the PGI compiler (17.1, 16.x) fails to compile the program if the argument to IS_CONTIGUOUS is a section of an array - please see below for a MWE:
$ cat contig.F90 program contig implicit none integer, parameter :: a(3) = [1, 4, 9] write(*,*) is_contiguous(a) #ifdef SECTION write(*,*) is_contiguous(a(1:2)) #endif end program $ pgfortran contig.F90 -o contig $ ./contig T $ pgfortran contig.F90 -o contig -DSECTION PGF90-S-0074-Illegal number or type of arguments to is_contiguous - keyword argument array (contig.F90: 6) 0 inform, 0 warnings, 1 severes, 0 fatal for contig $ ifort contig.F90 -o contig -DSECTION $ ./contig T T
As you can see, the number and type of arguments in both calls is exactly the same, yet if the preprocessor keeps the second call a compilation error is raised and no binary is generated.
Other compilers which support the IS_CONTIGUOUS function [Intel Fortran compilers 16.0.3 and 17.0.1, or NAG Fortran 6.1 (6124)] correctly compile and execute the program above.
Would it be possible for you to assist with this issue? Thank you.