      parameter (MDT=2300,MFQ=17)



      implicit real*8(a-h,o-z)
      dimension a(MDT,MFQ),a1(MDT)
      character INFILE*100,OTFILE*100,plus*100,INFILE1*100,
     &          OTFILE(MFQ)*100

      write(*,*)'Enter Input File Name'
      read(*,*)INFILE

      open(10,file=INFILE,status='old')

      i=1
1     read(10,*,end=2)(a(i,j),j=1,MFQ)
      i=i+1
      goto 1
2     close(10)
      N=i-1


       do 3 m=1,MFQ
           do 3 l=1,N
 3             a1(l)=a(l,m)


      write(*,*)'Plus Characters [Yes=1] [No=0]'
      read(*,*)ID
      if (ID.eq.1) then
         write(*,*)'Enter Plus Characters'
         read(*,*)plus
         call CountNumberOfChracters2(plus,1,iend)
      endif


        do k=1,17
           nout=10+k

           if (nout.eq.11) then
              OTFILE(K)='fort.'//'11'//plus(1:iend)
           elseif (nout.eq.12) then
              OTFILE(K)='fort.'//'12'//plus(1:iend)
           elseif (nout.eq.13) then
              OTFILE(K)='fort.'//'13'//plus(1:iend)
           elseif (nout.eq.14) then
              OTFILE(K)='fort.'//'14'//plus(1:iend)
           elseif (nout.eq.15) then
              OTFILE(K)='fort.'//'15'//plus(1:iend)
           elseif (nout.eq.16) then
              OTFILE(K)='fort.'//'16'//plus(1:iend)
           elseif (nout.eq.17) then
              OTFILE(K)='fort.'//'17'//plus(1:iend)
           elseif (nout.eq.18) then
              OTFILE(K)='fort.'//'18'//plus(1:iend)
           elseif (nout.eq.19) then
              OTFILE(K)='fort.'//'19'//plus(1:iend)
           elseif (nout.eq.20) then
              OTFILE(K)='fort.'//'20'//plus(1:iend)
           elseif (nout.eq.21) then
              OTFILE(K)='fort.'//'21'//plus(1:iend)
           elseif (nout.eq.22) then
              OTFILE(K)='fort.'//'22'//plus(1:iend)
           elseif (nout.eq.23) then
              OTFILE(K)='fort.'//'23'//plus(1:iend)
           elseif (nout.eq.24) then
              OTFILE(K)='fort.'//'24'//plus(1:iend)
           elseif (nout.eq.25) then
              OTFILE(K)='fort.'//'25'//plus(1:iend)
           elseif (nout.eq.26) then
              OTFILE(K)='fort.'//'26'//plus(1:iend)
           elseif (nout.eq.27) then
              OTFILE(K)='fort.'//'27'//plus(1:iend)
           endif

           open (10,file=OTFILE(k))

           write(10,1000)(a(l,k),l=1,N)

       enddo

1000   format(1f8.4)
        stop
        end



C***********************************************************************
      subroutine CountNumberOfChracters2(a,istart,iend)
C***********************************************************************

      implicit real*8(a-h,o-z)

      character a*100

      do 100 i=istart,100
         if (a(i:i).eq.',') then
            go to 1
         else if (a(i:i).eq.'') then
            go to 1
         end if
100   continue
1     iend=i-1

      return
      end


