Program Exception

Program Exception

Hi,

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.

Thanks

Venkat

5 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

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

Steve

Hi,

Thanks for your quick reponse.
Hi,
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

ntdll.dll!775515de()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!775515de()
ntdll.dll!7754014e()
> 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)
Save
RETURN !
!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.

b

Melden Sie sich an, um einen Kommentar zu hinterlassen.