Subroutine Aborter(iunit,ierrmsg) !---------------------------------------------------------------------- ! ABORT A PROGRAM AFTER A FATAL ERROR CONDITION IS DETECTED. ! ! ! input: iunit Unit Number of the file to write error messages to. ! ierrmsg An error message to write ilunerr ! ! The advantage of using this subroutine is that it will ! generate a traceback showing the chain of subroutines which ! eventually bombed, and it forces an arithmetic error which ! the job control system can detect as a fatal error. ! character ierrmsg*(*) common /abortcmn/ zz0,zz1 ! ! zz0 is in a common block to prevent an optimizing compiler ! from evaluating 1.0/zz0 during compilation rather than during ! execution. ! write(iunit,1001) 1001 format(//' %ABORTER: ** FATAL ERROR. ABORT SUBROUTINE CALLED **'//) write(iunit,1002)ierrmsg 1002 format(1x,a,//) ! on CRAY's and VAXes: ! generate a divide-by-zero error: zz1=1.0/zz0 !^ ilunerr=5 !^ ! on the DecStation: !^ call exit(1) write(ilunerr,1010) zz0 1010 format(' ?ABORTER-- ZZ0= ',1PE11.4,' AND STILL EXECUTING...') STOP END Subroutine Aborter