-
Notifications
You must be signed in to change notification settings - Fork 92
Refactor: move procedure definitions submodules #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit also makes a procedure that is referenced in only one place an internal procedure.
Thanks a lot, this is great. I have a few questions:
It's unclear to me why the compiler throws an error here. It doesn't seem to be about duplicate interfaces in the module and submodule, because a number of other duplicate interfaces compile fine (e.g. activation, random, etc.).
Again, this code looks fine and I don't understand why the compiler is not happy with it. Declaring the result type on a separate line doesn't seem to make a difference. Do you have any clues? While being able to build this with earlier GFortran (item 1) is not essential, building with ifort is (item 2). |
If I move the type constructor (layer and network) functions from submodules back to modules, ifort and ifx can compile and run. @rouson are you open to this one exception? |
Yes but I have some other ideas that I'd like to investigate this morning. There's a chance that some of the code in the PR is not standard-conforming. I'll provide more detail shortly and will push any required fixes. |
@milancurcic I have a workaround for the Intel compiler issue. I'll push it soon. Fixing the issue was a little cumbersome because of the need to change things in both the interface body and the procedure definition to keep the redundant information consistent, which is why I prefer to not repeat the information. When I need to see both the interface information and the procedure definition, I open side-by-side screens. I think I know what caused the problem and I hope to find the time to submit a bug report to Intel. Neural-fortran is the first code that I've seen where the result is given an explicit name other than the procedure and the result type is declared in the function prefix. (More commonly, when I see a |
That's fascinating, great detective work. I often use |
This commit works around a problem in which ifort does not allow function prefixes to contain a type declaration when a function has an explicitly named result.
@milancurcic this commit is ready to merge modulo the TODO that I believe you added in the initial comment. I'll leave those tasks to you if that's ok. |
Great, thank you. Yes, I'll tackle the TODOs, they're chores. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @rouson! Will merge.
@rouson While working on #58 I found that if the function result is declared with an alternative name (using e.g. |
@milancurcic that's great news! |
This PR incorporates the suggestions from @milancurcic in PR #47 and replaces that PR, which is now closed.
This PR separates procedure interface bodies (in modules) from procedure definitions (in submodules) for all modules except mod_kinds.f90, which contains no procedures.
Benefits
public
module entity (e.g.,pi
) no longer appears in the module.TODO prior to merging this PR