      subroutine endvis

      logical :: scivis_flag
      include 'ELVIS_H'

      !  shut down SCIVIS/ELVIS, if necessary, as determined by input flag

      call trgraf_elvis_flag(scivis_flag)
      if (scivis_flag) then
         call trgraf_elvis_start(' ',' ')  ! cleans up trgraf_elvis
         i=ef_end()
      endif

      return
      end

