- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Steve:
You know you learn things all the time.
I always use the implicit none at the top of my code. When I used the batch files in Microsoft Fortran there was a switch one could set to check that all the variables were declared and used.
I just had a new program Iam developing crash with a Stack Overflow error and a out of bounds in Windows fault.
The code had been working perfectly and I moved the subroutine from the main file to a separate f90 file.
Along the way I found out that I have to set the debug switches in the Preferences, I had always assumed these would be set, dumb really, but a simple trap.
Took an age to fix all the code then.
Question: Do I have to put Implicit None at the top of every routine or just in the main program?
Regards
JMN
You know you learn things all the time.
I always use the implicit none at the top of my code. When I used the batch files in Microsoft Fortran there was a switch one could set to check that all the variables were declared and used.
I just had a new program Iam developing crash with a Stack Overflow error and a out of bounds in Windows fault.
The code had been working perfectly and I moved the subroutine from the main file to a separate f90 file.
Along the way I found out that I have to set the debug switches in the Preferences, I had always assumed these would be set, dumb really, but a simple trap.
Took an age to fix all the code then.
Question: Do I have to put Implicit None at the top of every routine or just in the main program?
Regards
JMN
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Steve:
My machine crashed in the middle of the send, so somehow it went a few times
Sorry
JMN
My machine crashed in the middle of the send, so somehow it went a few times
Sorry
JMN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IMPLICIT NONE belongs in each program unit. You can use /warn:declarations to have that automatically applied if you wish, but I prefer to have it in the code.
I don't know what switches you thought you had to set - can you explain in more detail? A debug configuration should have what you need by default.
I don't know what switches you thought you had to set - can you explain in more detail? A debug configuration should have what you need by default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I deleted the duplicates - no worries.
Moving code to another file should not affect how the code runs. Stack overflow can happen for many reasons - see this old Doctor Fortran post for more on stack overflow.
Moving code to another file should not affect how the code runs. Stack overflow can happen for many reasons - see this old Doctor Fortran post for more on stack overflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> Do I have to put Implicit None at the top of every routine or just in the main program?
Steve already gave you the answer, and here is a hint that will explain why it has to be so. "Implicit None" is a Fortran statement, not a compiler directive. Because Fortran compiles each subprogram separately, the statement applies only to the subprogram in which it is placed. In contrast to C, Fortran statements do not have source-file scope.
A minor clarification: "Implicit None" is a declaration, and must appear after the subprogram declaration statement and any USE statements.
Steve already gave you the answer, and here is a hint that will explain why it has to be so. "Implicit None" is a Fortran statement, not a compiler directive. Because Fortran compiles each subprogram separately, the statement applies only to the subprogram in which it is placed. In contrast to C, Fortran statements do not have source-file scope.
A minor clarification: "Implicit None" is a declaration, and must appear after the subprogram declaration statement and any USE statements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Respondents:
I set the warn declarations and warn undeclared and that seems to have solved the problem.
I also fixed the implicit none.
I used to use the 4Yd all the time in Powerstation and before in MF.
Fun really.
Fixing all these fixed the stack overflow.
Thanks
JMN
I set the warn declarations and warn undeclared and that seems to have solved the problem.
I also fixed the implicit none.
I used to use the 4Yd all the time in Powerstation and before in MF.
Fun really.
Fixing all these fixed the stack overflow.
Thanks
JMN

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