Fortran 2018 standard issue

When I compile my code using Intel Fortran Compiler with -stand=f18, I get a warning

warning #7416: Fortran 2018 does not allow this intrinsic procedure.   [COMPILER_VERSION]
warning #7416: Fortran 2018 does not allow this intrinsic procedure.   [COMPILER_OPTIONS]

I believe both of them are still part of fortran2018 standard but I am not sure. So, are these features deprecated and why is that?

According to MR&C they should be fine. Have you used iso_fortran_env where you are invoking the routines?

No, it is a bug in Intel Fortran compiler - please see this thread: community.intel.com/t5/Intel-Fortran-Compiler/Using-stand-f18-with-ISO-FORTRAN-ENV/m-p/1219046#M152295

By the way, for Intel Fortran compiler specific issues, you may want to try Intel Fortran forum first.

2 Likes

For the code

use iso_fortran_env, only: compiler_version,compiler_options
implicit none
write (*,"(a,/,a)") "compiler:",trim(compiler_version())
write (*,"(/,a,/,a)") "compiler options:",trim(compiler_options())
end

ifort -nologo -stand:f18 xcompiler_version.f90 on Windows 10 appears to give spurious warnings

xcompiler_version.f90(3): warning #7416: Fortran 2018 does not allow this intrinsic procedure.   [COMPILER_VERSION]
write (*,"(a,/,a)") "compiler:",trim(compiler_version())
-------------------------------------^
xcompiler_version.f90(4): warning #7416: Fortran 2018 does not allow this intrinsic procedure.   [COMPILER_OPTIONS]
write (*,"(/,a,/,a)") "compiler options:",trim(compiler_options())
-----------------------------------------------^

but does create an executable with output

compiler:
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1 Build 20201112_000000

compiler options:
/nologo /stand:f18

Note that compiler_version() and compiler_options() were in Fortran 2008 (and are still in 2018). This looks like a bug in the compiler.

Curiously, with ifort 2021.5.0 and ifx 2022.0.0 with options -warn all -stand f08, I have this warning:

RAY3D_main.f90(116): warning #7416: Fortran 2008 does not allow this intrinsic procedure.   [COMPILER_VERSION]
    print *, "  ", compiler_version()
-------------------^

@vmagnin , it will be helpful to Intel Fortran users if you can report this issue at the Intel Fortran forum:

1 Like

Done.

:+1:

The forum answer is that it is fixed in the April version (ifx 2022.1.0).

1 Like