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

syntax to distinguish between ivf and cvf inside select case

tropfen
New Contributor I
1,046 Views
Hello,

i am looking for a syntax to distinguish between ivf and cvf inside a select case (or if .. then .. else) statement.

The syntax shall be placed inside a subroutine. The subroutine is placed inside a module which shall be used in cvf and ivf. [example for problematic source to use in both compilers is :inquire(directory=.., exits=..)]

Thanks in advance
Frank
0 Kudos
3 Replies
joerg_kuthe
Novice
1,046 Views

I don't know if there is a solution using standard Fortran statements like SELECT CASE or IF, but maybe using the compiler's metadirective helps you as well. Example:

!DEC$ IF DEFINED ($CVF)
put your Fortran source code for CVFhere
!cDEC$ ELSE
put your Fortran source code for IVFhere
!DEC$ ENDIF

Then add the variable$CVF to the "Predefined Preprocessor Symbols" (dialog "Project Settings" |"Fortran" tab).

Joerg Kuthe
www.qtsoftware.de

0 Kudos
TimP
Honored Contributor III
1,046 Views
You can distinguish ranges of IVF versions at compile time by the predefined preprocessor macros __INTEL_COMPILER=nnnn
0 Kudos
Lorri_M_Intel
Employee
1,046 Views

In the "for what it's worth" category, CVF defined the macro _DF_VER, and (as Tim pointed out) ifort defines the macro __INTEL_COMPILER

It would be a simple matter to use these to conditionalize code for CVF vs Intel Fortran.

- Lorri

0 Kudos
Reply