C     @(#)write.f	1.2     03/25/98
C
      subroutine write (nun, string)

c write a trimmed string to output stream
c   if using stream 6 will put a space in for carriage control character

      character*(*) string

      last = len_trim(string)
      if (last .eq. 0) then
        write (nun, '(a)')
      else
        if (nun .eq. 6) then
          write (nun, '(1x,a)') string(:last)
        else if (nun .eq. -1) then
          write (*, '(1x,a)') string(:last)
        else
          write (nun, '(a)') string(:last)
        end if
      end if
      return
      end
