subroutine ctrlc_check (error)
  use gbl_message
  use sic_dependencies_interfaces
  use sic_interfaces, except_this=>ctrlc_check
  use sic_structures
  !---------------------------------------------------------------------
  ! @ private
  !  Pause if ^C has been pressed and reset CONTROLC flag to false.
  !---------------------------------------------------------------------
  logical, intent(inout) :: error  !
  ! Local
  character(len=*), parameter :: rname='PAUSE'
  !
  if (.not.sic_ctrlc()) return
  if (nlire.lt.maxlev) then
    call sic_message(seve%i,rname,'Generated by pressing ^C')
    if (error) then
      call sic_message(seve%w,rname,'Error returned by aborted command '//  &
      'ignored')
      error = .false.
    endif
    call break
  else
    call sic_message(seve%w,rname,'<^C> Ignored, level too deep')
  endif
end subroutine ctrlc_check
