      subroutine Error(sname)
c
c   Run-Time Error
c
      USE DFLIB
      INTEGER(2) status
      LOGICAL(4) result
      character(*) sname
c-----------------------------------------------------------------------
c Îøèáêè
      CALL GETSTATUSFPQQ(status)
! 2 error
      IF (IAND(status, FPSW$INVALID ) .NE. 0) THEN
!!      WRITE (32,*) 'Error in subroutine '//sname
!!      WRITE (32,*) 'An invalid result occurred.'
!!      close(32)
!!      result = SYSTEMQQ('notepad.exe error.DAT')
!!      stop 'Run-time ERROR DETECTED!'    
! 3 error
c      ELSE IF (IAND(status, FPSW$DENORMAL ) .NE. 0) THEN
c      WRITE (32,*) 'Error in subroutine '//sname
c      WRITE (32,*) 'A denormal (very small number) occurred.'
c      close(32)
c      result = SYSTEMQQ('notepad.exe error.DAT')
c      stop 'Run-time ERROR DETECTED!'      
! 4 error
      ELSE IF (IAND(status, FPSW$ZERODIVIDE) .NE. 0) THEN
      WRITE (32,*) 'Error in subroutine '//sname
      WRITE (32,*) 'A divide by zero occurred.'
      close(32)
      result = SYSTEMQQ('notepad.exe error.DAT')
      stop 'Run-time ERROR DETECTED!' 
! 5 error      
      ELSE IF (IAND(status, FPSW$OVERFLOW ) .NE. 0) THEN
      WRITE (32,*) 'Error in subroutine '//sname      
      WRITE (32,*) 'An overflow occurred.'
      close(32)
      result = SYSTEMQQ('notepad.exe error.DAT')
      stop 'Run-time ERROR DETECTED!' 
! 6 error      
c      ELSE IF (IAND(status, FPSW$UNDERFLOW ) .NE. 0) THEN
c      WRITE (32,*) 'Error in subroutine '//sname      
c      WRITE (32,*) 'An underflow occurred.'
c      close(32)
c      result = SYSTEMQQ('notepad.exe error.DAT')
c      stop 'Run-time ERROR DETECTED!' 
! 7 error      
c      ELSE IF (IAND(status, FPSW$INEXACT ) .NE. 0) THEN
c      WRITE (32,*) 'Inexact precision occurred.'
c      close(32)
c      stop
      END IF
c            
******** end of Error *************************************************
      return
      end