The -ftrap=mode option enables trapping for floating-point exceptions. If no signal handler has been established by an ieee_handler() call, the exception terminates the program with a memory dump core file. See the Fortran User’s Guide for details on this compiler option. For example, to enable trapping for overflow, division by zero, and invalid operations, compile with -ftrap=common. (This is the f95 default.)
You must compile the application’s main program with -ftrap= for trapping to be enabled.