Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

COMMON problem

dray1234
Beginner
613 Views

I am compiling my code using fortran compiler 9.1.

I have a common declaration like:

COMMON /DATE /IM,ID,IY,IFP

Later in the code I do:

IFP=1

This compiles fine with no error but at runtime the program crashes when it reaches the above line.

This program use to work with compaq fortran compiler.

I do not want to convert all the common to modules.

Any suggestion will be highly appreciated.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
613 Views

There's not enough information here. Where is the COMMON declaration? What is the error message? (Access violation?) Can you show a small but complete program that demonstrates the problem?

0 Kudos
dray1234
Beginner
613 Views

I am linking the fortran lib through C++ to Java.

A sample program is:

SUBROUTINE crops(STname, NCROP, PMAT, Ploc)

CHARACTER*256 Dir

CHARACTER*256 FileName, tmp

INCLUDE 'comsw1.inc'

COMMON /DATE/IM,ID,IY,IFP

c other initalizations

IFP=1

END

This compiles file with Intel compiler 9.1 but when I call the subroutine there is a runtime error and the program crashes. I checked at the crash is due to IFP=1.

I don't get any stack trace or specific error message .

I only get a JVM crash.

0 Kudos
Steven_L_Intel1
Employee
613 Views

Still not enough information.

Try writing a Fortran program that calls this subroutine and see what it does. I tried an example myself and didn't see a problem. The contents of the include file might also be of interest.

I assume that in your real code there is more to the beginning of the subroutine - DLLEXPORT directives, perhaps?

0 Kudos
Reply