PDA

View Full Version : Program compiled with -chk dies without message


tzeis
08-28-2006, 08:35 PM
The -chk and -chkglobal compiler options can be very useful in diagnosing problems in user code. The purpose of this thread is to describe situations where programs compiled with -chk might die, apparently without issuing a diagnostic message. These are situations other than those described in the User Guide for the -chk option. If anyone knows of situations other than those described in the User Guide or this thread, please contact support, and the description can be added here.

1.) If the program opens or makes use of Fortran unit zero, a diagnostic message may not be written to the screen. This is because the -chk diagnostic messages are written to stderr, which is preassigned to Fortran unit zero. If unit zero is opened, and subsequently a diagnostic message is written, it will be sent to the disk file "fort.0". This situation might occur if a file is being opened but the variable containing the unit number is uninitialized.

2.) If a Fortran program contains a function which performs i/o, and the function appears in an i/o list, the program may die without issuing a message, even though the program apparently runs successfully when compiled without -chk. This sort of situation is not legal Fortran.
.