      subroutine diary(str,n)
c     write string str in diary file if required
      include '../stack.h'
      character*(*) str
      integer n

      if(wio.ne.0) write(wio,'(a)') str(1:n)
      return
      end
