- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any way to lift the 7200 characters per line restriction in ifort?
The reason is that I'm using some macros to avoid code duplication and they can be pretty long (whole functions sometimes).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you also involving FPP? If so you then have line restrictions in both Fortran and fpp.
Maybe you can use a "tiny url" approach. Copious plain text macro that expands (downwards) to cryptic unique macro name that is then used to compose a longer composite macro.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jimdempseyatthecove wrote:
Are you also involving FPP? If so you then have line restrictions in both Fortran and fpp.
Maybe you can use a "tiny url" approach. Copious plain text macro that expands (downwards) to cryptic unique macro name that is then used to compose a longer composite macro.
Jim Dempsey
Yes, I am using FPP. Should I not?
Where can I find an example for this tiny url approach? Would it damage the readability of the code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It was unknown (to me) as to if fpp was used. Nothing wrong with fpp, but knowing fpp is involved adds information to your query that is necessary for meaningful discussion.
Now then:
Does the original (yourFile.f90) have a text/statement line longer than 7200 characters?
.OR.
Due to (fpp) macro expansion(s), you generate a text/statement line longer than 7200 characters into a temporary file for use by ifort?
And should the answer be yes to the first question, does (would) the fpp macro substitution produce a Fortran statement longer than the pre-macro substitution line?
Is the produced macro expansion
singleFortranStatement
.OR.
statement;statement;...;statement
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Short answer - no, there isn't a way for you to lift that restriction. I think your macro approach is unreasonable and nonportable, and would suggest seeing if introducing newlines into your macro expansion would do what you want. I have also seen people use #include for templates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If fpp is unsuitable for your needs, perhaps you should consider writing your own preprocessor using AWK or other favorite programmable text editing program. Or, consider writing your preprocessor in Fortran.
Write your source program as
YourProgram.Holysord (multiple files too)
Then in your make file, produce a rule that converts the *.Holysord files to *.f90 files (and if you have an absurdly long expression, break it into multiple statements).
QED
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page