- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have seen many program either shows a runtime error/segmentation fault when compiled with gfortran/SUN(on linux platform) but runs smoothly in fortran, as the shown here just for example:
$ gfortran Map.f
In file Map.f:44
nnA(i,ni)=N**4
1
Error: Arithmetic overflow at (1)
In file Map.f:52
nnA(i,ni)=N**4
1
Error: Arithmetic overflow at (1)
In file Map.f:56
if(nnA(i,ni).eq.N**4)then
1
Error: Arithmetic overflow at (1)
In file Map.f:63
else
1
Error: Unexpected ELSE statement at (1)
In file Map.f:64
endif
1
Error: Expecting END DO statement at (1)
In file Map.f:50
goto 20
1
In file Map.f:65
p
2
Warning: Obsolete: GOTO at (1) jumps to END of construct at (2)
[Rudra@snbpc04 BCC]$ ifort Map.f
[Rudra@snbpc04 BCC]$ ./a.out
1 1 1 16
2 2 16 94
3 17 94 514
4 95 514 2756
5 515 2756 14292
What i understood(which is very little about what goes on under the hood) is that the compiler is either not meeting the fortran std. or not using the diskspace properly(as arithmatic overflow of this case). And i was told by one of my friend that one of my code, which i tested with ifort, gfortran and sunf95, fails with xlf. So if i want to make sure that my code is portable to any compiler, what is the way out?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you'd attach the source we could comment more constructively.
I'll note that Intel Fortran does not do integer overflow checking, whereas gfortran seems to offer this.

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