Localizing a Fortran Error - Get the Position of the Error

Click For Summary
SUMMARY

The discussion focuses on troubleshooting a Fortran runtime error: "forrtl: error (73): floating divide by zero." Participants suggest using debugging tools like gdb to identify the error's location and recommend implementing print statements as flags to isolate the problematic code segment. The conversation emphasizes the importance of examining floating-point operations and the potential for zero values in calculations. A specific subroutine, "ffset," is highlighted as a potential source of the error, with advice on checking variable initialization and execution flow.

PREREQUISITES
  • Understanding of Fortran programming language
  • Familiarity with debugging tools such as gdb
  • Knowledge of floating-point arithmetic and IEEE 754 standards
  • Experience with subroutine and module structures in Fortran
NEXT STEPS
  • Learn how to use gdb for debugging Fortran applications
  • Research techniques for implementing print statements as flags in Fortran
  • Explore the IEEE 754 standard for floating-point arithmetic
  • Investigate best practices for variable initialization in Fortran
USEFUL FOR

This discussion is beneficial for Fortran developers, programmers troubleshooting runtime errors, and anyone interested in improving their debugging skills in numerical computing contexts.

  • #31
The problem disappeared when I switched compiler from iFort to g77!
Many thanks for your help anyway!
 
Technology news on Phys.org
  • #32
The mighty ifort "falls" to g77 ... oh boy :-p .
 
  • #33
Putting on someone else's shoes is almost never a good idea. Unless they fit, that is.

That must have been a pretty painful fit, to be worth 3 pages of frantic posts.

Glad you got that sorted out. :biggrin:
 
Last edited:
  • #34
Thing is, I didn't chose compiler to begin with. There's a ranking list built into the code such that ifort is automatically chosen first. Only if there's no ifort installed it goes on to the next compiler on the list...
When I took away ifort from PATH, g77 was chosen and everything (well, at least this specific problem) worked out well.
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 5 ·
Replies
5
Views
5K
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K