FORTRAN - Error 112 Run-time Error

  • Context: Fortran 
  • Thread starter Thread starter Athos_F
  • Start date Start date
  • Tags Tags
    Error Fortran
Click For Summary
SUMMARY

The discussion addresses a recurring Run-time Error 112 encountered in FORTRAN simulations of a lattice model, particularly during larger system runs. The error indicates a reference to an undefined variable, array element, or function result. Users are advised to ensure that all array elements are properly initialized and to double-check array sizes to prevent this issue. Initializing all variables at the beginning of the simulation is recommended to mitigate the occurrence of this error.

PREREQUISITES
  • Understanding of FORTRAN programming language
  • Familiarity with array handling in FORTRAN
  • Knowledge of simulation modeling concepts
  • Experience with debugging techniques in programming
NEXT STEPS
  • Research best practices for initializing variables in FORTRAN
  • Learn about array bounds checking in FORTRAN
  • Explore debugging tools for FORTRAN to identify undefined variables
  • Investigate optimization techniques for large-scale simulations in FORTRAN
USEFUL FOR

This discussion is beneficial for FORTRAN developers, simulation researchers, and programmers dealing with large-scale computational models who need to troubleshoot and optimize their code for performance and reliability.

Athos_F
Messages
1
Reaction score
0
I have strange situation where a code that generaly seems to work fine at times gives a error message.

basically I run simulations on a lattice model, and have experience no problems for small system, but when I go to larger systems (meaning that the simulation takes aprox. 15 min) I sometimes get into problem. To average my results I run each simulation a given number of times, and it seems that in around 0.5 % of the time my largest model gives the following error.

Run-time Error
*** Error 112, Reference to undefined variable, array element or function result (/UNDEF).

The line it conects to the problem is well defined, and should not be the problem.

Anyone know way?
 
Technology news on Phys.org
This error indicates that you are trying to use elemnts of an array without assigning a value for them. Double check the array sizes .

Also I would recommend initializing all your variables (including arrays) at the begininig of your simulation.
 

Similar threads

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