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

fortran 11(2003) double precision

cvnravi
Beginner
610 Views

Hi,

I ported fortran code from fortran power station(4.0) to fortran 11(2003) version. For maintaining double/real values from old to new compiler, I changed properties>fortran>data>"Default Read Kind" from 4 to 8. Now the problem is that the global variables are not maintaing data from one file to other.

Suppose, I created a real*8 variable(ex:abc) in one file as a global(COMMON/test/abc), it is modifying in one file and using it in other file, while coming to other file"abc" variable is not holding the modified data. This is happening only when I changed "Default Real Kind" to 8. Is there any other options I need to modify from properties window?

Please give a solution. Thanks in advance.






0 Kudos
1 Reply
Ron_Green
Moderator
610 Views
Quoting - cvnravi

Hi,

I ported fortran code from fortran power station(4.0) to fortran 11(2003) version. For maintaining double/real values from old to new compiler, I changed properties>fortran>data>"Default Read Kind" from 4 to 8. Now the problem is that the global variables are not maintaing data from one file to other.

Suppose, I created a real*8 variable(ex:abc) in one file as a global(COMMON/test/abc), it is modifying in one file and using it in other file, while coming to other file"abc" variable is not holding the modified data. This is happening only when I changed "Default Real Kind" to 8. Is there any other options I need to modify from properties window?

Please give a solution. Thanks in advance.






Can you create an example program and attach it to this thread?

There could be many reasons: If variables are declared REAL*4 for example, the compiler option will have no effect. Only variables like this:

REAL x,y,z

would be affected. the '*4' overrides your compiler option.

ron
0 Kudos
Reply