- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.)
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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..
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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/
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The directives are
!DIR$ FREEFORM
!DIR$ NOFREEFORM
Jim Dempsey
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Google is your friend. A search for "Fortran directives" found:
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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/
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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