      program test
C     test string I/O

      character  infile*80,string*20
      integer    nchar

      string = 'string'
      nchar = 6

      write(infile,'(a9,a2)') 'ninernine','to'
      infile = string(1:nchar)//infile

      print*, infile

      write(infile,'(a,a9,a2)') string(1:nchar),'ninernine','tw'

      print*, infile

      stop
      end
