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

Fortran Pre-processor file extensions

AJappy
Beginner
470 Views

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 Kudos
1 Solution
IanH
Black Belt
338 Views

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

View solution in original post

2 Replies
IanH
Black Belt
339 Views

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

AJappy
Beginner
329 Views

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.

Reply