Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

fortran 2008 standard and ERF

wim_van_hoydonck
Beginner
957 Views

Hi there,

I use the following version of ifort:

[bash]ifort (IFORT) 12.0.2 20110112[/bash]

Using the following program:

$ cat test.f90

[fortran]program test
  implicit none
  integer , parameter :: dp = selected_real_kind(p=15,r=300)
  print *, erf( 1.2_dp )
end program test[/fortran]

Compiling and executing this:

[fortran]$ ifort -o test test.f90
$ ./test
0.910313978229635
[/fortran]
Works ok. Now if I add '-std' the compiler complains that fortran 2003 does not allow erf as intrinsic procedure. This is expected behaviour. If I change the '-std' to '-std08' (which is not documented in the man page), I still get:

[bash]$ ifort -o test test.f90 -std08
tst.f90(7): warning #7416: Fortran 2008 does not allow this intrinsic procedure.   [ERF]
  print *, erf( 1.2_dp )
[/bash]
Removing the print statement and recompiling does not give a warning that '-std08' is not a good option, so I assume it is just not documented (yet).

What I hoped to get was that ifort would not complain about ERF, as it is an intrinsic procedure in fortran 2008.

In summary, in version 12.0.2 20110112:

-std08 is not documented in the man page

- ERF is not recognised as an intrinsic procedure by the fortran compiler when fortran 2008 standards checking is enabled.

Apparently, there is a newer version of the compiler, but I haven't had time to install it. Anyone can confirm that a newer version behaves the same/in a different way?

And is there a way around this? I would rather keep the '-std08' so that only standard compliant code is added.

Kind regards,

Wim Van Hoydonck

0 Kudos
3 Replies
Ron_Green
Moderator
957 Views
Wim,

The Update 3 compiler currently available will behave in the same manner as your Update 2 compiler. No difference.

-std08 is not documented because F08 standards checking has not been implemented. This is a feature being planned for a future major update.

ron
0 Kudos
wim_van_hoydonck
Beginner
957 Views

Hi Ron,

Thanks for the answer.

So if I need/want both the error function and standards checking, I have to implement it myself or use an external library that implements it.

Wim

0 Kudos
Steven_L_Intel1
Employee
957 Views
Do not use -std08 - while the option is recognized, it does not work and is not even equivalent to -std03. I suggest you use -std03 (or just -std) and deal with the reporting of F2008 features separately.
0 Kudos
Reply