Determining the source of errors in Fortran routines

Most errors in Fortran routines can be identified by the information provided in Fortran runtime messages, which begin with the prefix FOR. The Fortran compiler cannot identify all possible errors. The following list identifies several errors not detected by the compiler that could potentially result in problems:
  • Failing to assign values to variables and arrays before using them in your program.
  • Specifying subscript values that are not within the bounds of an array. If you assign data outside the array bounds, you can inadvertently destroy data and instructions.
  • Moving data into an item that is too small for it, resulting in truncation.
  • Making invalid data references to EQUIVALENCE items of differing types (for example, integer or real).
  • Transferring control into the range of a DO loop from outside the range of the loop. The compiler issues a warning message for all such branches if you specify OPT(2), OPT(3), or VECTOR.
  • Using arithmetic variables and constants that are too small to give the precision you need in the result. For example, to obtain more than 6 decimal digits in floating-point results, you must use double precision.
  • Concatenating character strings in such a way that overlap can occur.
  • Trying to access services that are not available in the operating system or hardware.
  • Failing to resolve name conflicts between Fortran and C library routines using the procedures described in z/OS Language Environment Programming Guide.