- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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 kopiert
5 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
> 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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite