Program Exception

Program Exception


I transferred huge computer model from CVF to Intel Fortran.
It does perferct compiling and linking. When I tried to run the program, I get program exception.
I debugged the program and it happens right at the Subroutine statement. I could not figure out as what is causing the problem.
I even commented all other code and kept only the call to the subroutine that is showing exception. But still the same error.
I checked all intiialization with proper array declaration. My suboruitne program has many ENTRY points.
I tried many times so far by checking all options available for compilation. But no luck.

So, I am submitting my request to the forum and am looking for some tips as how I can solve this problem.



5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You haven't told us what the exception is. Please show the complete and exact text of the error message.

Retired 12/31/2016


Thanks for your quick reponse.
Sorry for providing sufficient information.

Program stops at a call routine in the main program which is an Entry point in the subrotuine STANDARDFILEOUTPUTS.
I just debugged the code and got the following error message in Microsfot Visual Studio

Unhandled exception at 0x775515de in GLLVHTModelDbg.exe: 0xC0000005: Access violation writing location 0x00004c81

In console window, I get the following message

forrtl: Severe 157: Program Exception - access violation

Stack Shows

[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> GLLVHTModelDbg.exe!STANDARDFILEOUTPUTS() Line 2 + 0xe bytes Fortran First few lines of the subroutine is given below

Subroutine StandardFileOutputs
!Global array variables
Use G7Allocmemory
Use AllocMemoryWQCBM3DVariables
Use AllocMemoryWQDPM3DVariables
Use AllocMemoryWQE5M3DVariables
Use AllocMemoryWQADD3DVariables
Use G7NETCDFAllocMemoryVariables

the ole Entry point issue!
you need to provide some snippets of code for a better understanding.
However i would venture to guess that the ENTRY has some variables being passed to/fro?
You need to check that they are properly declared and the declarations match between call and called program?
Also if you do not have proper initialization of the variables it can cause the program to complain.
do you use an interface statement? do more than one routine call that Entry statement?

Venkat, your response to my comment was received via email with some snippets of code
You should post up the snippets to this forum so others can review and add comments (since others may have other comments too!)
In looking at the code you have
Subroutine StandardFileOutputs
(lots of declarations, includes, etc)
!Write headers for different output files
ENTRY KernelOutputHeaders
If(VersionControlNumber == 2 .and. itrnvp == 1 .and.itrnvpss == 1)
Two areas to look at:
1) Do you call Subroutine StandardFileOutputs first? since if not, then calling the ENTRY may wreak havoc

2) perhaps you have an initialization problem with either VersionControlNumber, itrnvp or itrnvpss? Since if any of them are not initialized then INTEL Fortran may complain (based on your compilation settings of whether to 'automatically initialize' and/or Compaq Fortran may have that as the default?

and if those two comments don't help please post the snippets to the forum as then others can look at the code and perhaps offer some additional ideas.


Leave a Comment

Please sign in to add a comment. Not a member? Join today