- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would you please attach a ZIP of a sample project that shows the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - this is very strange. We will investigate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page