Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29396 ディスカッション

Intel Fortran Compilation Error

Muyan__Can
ビギナー
3,210件の閲覧回数

To whom it may concern,

As I am using the following intel directive in usermat.f90 file:

!DIR$ include impcomEjb.inc

I get the following error message in compile.log file:

 

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.1.156 Build 20171018

Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

 

usermat.f90

usermat.f90(148): remark #5082: Directive ignored - Syntax error, found CHARACTER_CONSTANT 'impcomEjb.inc' when expecting one of: :

!DIR$ include "impcomEjb.inc"

--------------^

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.1.156 Build 20171018

Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

My files are attached to my message.

Could you please help to troubleshoot this error message?

Thank you for your time and kind concern.

 

 

 

0 件の賞賛
1 解決策
Steve_Lionel
名誉コントリビューター III
3,210件の閲覧回数

Intel Fortran has never supported an INCLUDE compiler directive. As Andrew suggests there's no point to one since Fortran has the standard INCLUDE statement. (There's also #include as a preprocessor directive.)

元の投稿で解決策を見る

8 返答(返信)
andrew_4619
名誉コントリビューター III
3,210件の閲覧回数

Plain old:

include "impcom.inc" 

should work if this inc file is in the same folder as the source file. I thought it strange there was a directive !DIR$ include. I can't find that in the help system, but maybe I did not look hard enough..

 

Steve_Lionel
名誉コントリビューター III
3,211件の閲覧回数

Intel Fortran has never supported an INCLUDE compiler directive. As Andrew suggests there's no point to one since Fortran has the standard INCLUDE statement. (There's also #include as a preprocessor directive.)

Muyan__Can
ビギナー
3,210件の閲覧回数

Dear Steve Lionel and Andrew,

Thank you very much for your informative replies to my questions. I was able to run my code with the following command in my usermat.f90 file:

#include "imcompEjb.inc"

However I would like to do the following:

Since I am writing my FORTRAN Code in FREE format (*.f90), I use the compiler  switch /free, which then thinks my code is in FREE format.  Then, I want to switch back to FIXED (F77) format. In order to switch to FIXED I use the following compiler directive:

!DIR$ FIXED

But I get the following error message:

*******************************************************************************************************

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.1.156 Build 20171018
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

usermat.f90
.\impcomEjb.inc(7): remark #5140: Unrecognized directive
!DIR$ FIXED

*******************************************************************************************************

I have attached the files to my E-Mail. Could you please help me to troubleshoot this problem?

Thank you for your time and kind concern.

Best Regards,

Can Muyan

-- 
PhD Student, Dept. of Aerospace Engineering
METUWIND - METU Center for Wind Energy
Middle East Technical University
06800 Ankara
TURKEY


Web: https://ruzgem.metu.edu.tr/en/

 

jimdempseyatthecove
名誉コントリビューター III
3,210件の閲覧回数

The directives are

!DIR$ FREEFORM
!DIR$ NOFREEFORM

Jim Dempsey

JVanB
高評価コントリビューター II
3,210件の閲覧回数

Actually the right syntax (IMHO) is for the INCLUDE file to start with

!DIR$ PUSHFORM

!DIR$ NOFREEFORM

and end with

!DIR$ POPFORM

But these directives aren't as yet supported by ifort.

gib
新規コントリビューター II
3,210件の閲覧回数

Google is your friend.  A search for "Fortran directives" found:

https://software.intel.com/en-us/node/692388

Muyan__Can
ビギナー
3,210件の閲覧回数

Dear Jim Dempsey, Repeat Offender and gib,

Thank you very much for your valuable comments. I was able to correct the mistake in my compile directive by using the following command:

!DIR$ NOFREEFORM

I appreciate your support!

Best Regards,

Can Muyan

-- 
PhD Student, Dept. of Aerospace Engineering
METUWIND - METU Center for Wind Energy
Middle East Technical University
06800 Ankara
TURKEY


Web: https://ruzgem.metu.edu.tr/en/
jimdempseyatthecove
名誉コントリビューター III
3,210件の閲覧回数

Muyan,

There is a difference between the Fortran PreProcessor (FPP) #include
And the Fortran include (no #)

The FPP #include inserts the text in context of the entire compilation unit, whereas the Fortran include text is scoped to the entity in which it is placed (subroutine, function, module, COMMON, ...). The two are not entirely equivalent. When the FPP is not required, use the Fortran INCLUDE.

Jim Dempsey

返信