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

Some real,save variable in module lost its value after called

hmli_l_
Beginner
335 Views
Hi.
I have a fortran program(with large array):
module  icon
        real,save :: theta0,estart,zstart
endmodule icon
It works well gfortran, bu if it compiled with Intel compiler 2018.update3 or 2015, the estart variable losts its value when called in other subroutine.
 
if I have added a new variable tmpestart, the tmpestart has its value correctly.
module  icon
        real,save :: theta0,estart,zstart,tmpestart
endmodule icon

Can you help me how to deal with it or is this a Intel compiler bug?

Thank you very much.

0 Kudos
2 Replies
Juergen_R_R
Valued Contributor I
335 Views

This is not a complete example of your problem, you mention a large array but there are no arrays shown. We do not know where and when you set the values for your module variables. You mention subroutines but there are no subroutines shown. 

0 Kudos
hmli_l_
Beginner
335 Views

The reason is during some arrays out of bounds.

Compiled with -check bounds can find the array.

 

0 Kudos
Reply