Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Debugprofile integer*4 calculations use integer*2 kind

Jan_Jaap
Beginner
860 Views

On a 64-bit OS windows 7 professionel with visual studio 2012 and Intel® Fortran Compiler 14.0 the debug profile gives incorrect results De Integerkind in the project is set to integer(4) integers are explicitly defined as kind=4 Still calulatuions result in as value as if the integerkind=2 program Console1 implicit none !DIR$ INTEGER:4 integer Kint,Lint integer*2 Kint2,Lint2 integer*4 Kint4,Lint4 Integer*8 Kint8,Lint8 real max,max2,max4,max8 10 Format( a17,i8,a13,i10,a6,F22.0) max=huge(Kint) Kint=43210 Lint=1000*43+210 print 10,'Integer=43210:', Kint,'=1000*43+210:',Lint,' max=',max max2=huge(Kint2) Kint2=43210 Lint2=1000*43+210 print 10,'Integer*2=43210:', Kint2,'=1000*43+210:',Lint2,' max2=', 1max2 max4=huge(Kint4) Kint4=43210 Lint4=1000*43+210 print 10,'Integer*4=43210:', Kint4,'=1000*43+210:',Lint4,' max4=', 1max4 Print * pause end program Console1 For the Kint4 teh Release gives othes results of the calculation of =1000*43+210 (43210) then debug (-22326) What settings can i change to get the right results? Jan Jaap

0 Kudos
6 Replies
Steven_L_Intel1
Employee
860 Views

Would you please attach a ZIP of a sample project that shows the problem?

0 Kudos
Jan_Jaap
Beginner
860 Views

Here is the  project attatched

0 Kudos
Steven_L_Intel1
Employee
860 Views

Thanks - this is very strange. We will investigate.

0 Kudos
Steven_L_Intel1
Employee
860 Views

I see now. You have Integer size:16 set as the property for the console1.for file. This overrides the value you set in the project.

0 Kudos
Jan_Jaap
Beginner
860 Views

Still i expect the same result in release as in debug

I explicily set Kint4 as an integer*4 and I expect that overules any project or file setting.

Jan Jaap

0 Kudos
Steven_L_Intel1
Employee
860 Views

The options are different in the release and debug configuration. I could not reproduce a problem once the file property was removed, Note that you have integer size set to 64 in the Debug configuration but not Release:

Debug mode with file property removed:

   Integer=43210:   43210=1000*43+210:     43210  max=  9223372036854775808.
 Integer*2=43210:  -22326=1000*43+210:    -22326 max2=                32767.
 Integer*4=43210:   43210=1000*43+210:     43210 max4=           2147483648.

Fortran Pause - Enter command<CR> or <CR> to continue.

Release mode (no integer_size:64)

   Integer=43210:   43210=1000*43+210:     43210  max=           2147483648.
 Integer*2=43210:  -22326=1000*43+210:    -22326 max2=                32767.
 Integer*4=43210:   43210=1000*43+210:     43210 max4=           2147483648.

Fortran Pause - Enter command<CR> or <CR> to continue.

0 Kudos
Reply