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

Fortran Pre-processor file extensions

AJappy
初学者
2,300 次查看

I'm developing a series of dll's to use with Abaqus.  I'm using free-form fortran with the .F90 file extension and the -fpp option. I have managed to get the libraries successfully linked with Abaqus and the libraries are working fine when running Abaqus in single threading mode. I'm now trying to get the libraries working with mpi and multi threading.

To facilitate this, Abaqus provides a series of files that need to be included with a #include directive, for example #include <SMAAspUserSubroutines.hdr>. I'm able to locate the file and direct the pre-processor to additional dependencies. However, I'm getting a series of errors originating from the SMAAspUserSubroutines.hdr file. As far as I can tell this is down to the SMAAspUserSubroutines.hdr file being written in extended line length fixed format fortran.

If I change the file extension on my source to .FOR I can remove the errors originating from the SMAAspUserSubroutines.hdr but it gets replaces with a series of errors from my own source... I did just change the file extension.

Is there a way to tell the pre-processor to treat .hdr files or #include files as fixed format whilst still having my source written in free-form? Or do I need to rewrite my source file in fixed format? 

0 项奖励
1 解答
IanH
名誉分销商 III
2,168 次查看

Have you tried the !DEC$ NOFREEFORM directive (followed later by !DEC$ FREEFORM) in your source file ahead of the #include?

在原帖中查看解决方案

2 回复数
IanH
名誉分销商 III
2,169 次查看

Have you tried the !DEC$ NOFREEFORM directive (followed later by !DEC$ FREEFORM) in your source file ahead of the #include?

AJappy
初学者
2,159 次查看

That's worked. I wrapped the #include in the directives you suggested.

!DEC$ NOFREEFORM
#include <SMAAspUserSubroutines.hdr>
!DEC$ FREEFORM

Thank you Ian that's saved me a lot of headaches time.

0 项奖励
回复