CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C    Af2Afree.f                                                        C
C    FORMAT NO HENKAN  Free to Free                                    C
C    Ascii to Free Ascii                  coded by Fuku 2003.4.02      C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
      DIMENSION  ACC(180000) ,AAC(180000)
      CHARACTER*80 CUTL
	CHARACTER*20 FOMA,FOMA2
	CHARACTER*15 RNAM,BNAM
	REAL*4  ACC,AAC
C
C     INPUT OF FILE NAME
C
      WRITE(6,200)
  200 FORMAT(1H, 'DATA FILE-NAME !'/)
      READ(5,352) RNAM
      OPEN(10,FILE=RNAM)
	do 2 i=1,8
	  read (10,351) cutl
	  write(6,*) cutl
    2 CONTINUE
	CLOSE(10)
C    	   
	WRITE(6,210)
  210 FORMAT(1H ,'READ-NUMBER OF DATA')
      READ(5,*) NN
C
      WRITE(6,220)
  220 FORMAT(1H ,'CUT-NUMBER OF DATA !')
      READ(5,*) CN
	N=NN-CN
C
      WRITE(6,230)
  230 FORMAT(1H ,'CUT-Line NUMBER !')
      READ(5,*) NSKIP
C
      WRITE(6,240)
  240 FORMAT(1H ,'Format e.g.(8F10.2)!'/)
      READ(5,'(A20)') FOMA
C
C
      WRITE(6,250)
  250 FORMAT(1H ,'Coeficient F.')
      READ(5,*) COEF
C
      WRITE(6,260)
  260 FORMAT(1H ,'INPUT NEW  FILE-NAME !'/)
      READ(5,352) BNAM
C
      WRITE(6,270)
  270 FORMAT(1H ,'NEW  Format e.g.(1E11.3) !'/)
      READ(5,'(A20)') FOMA2
C
C     READ FILE DATA
C
      OPEN(10,FILE=RNAM)
	 DO 10 I=1,NSKIP 
       READ(10,351) CUTL
   10 CONTINUE
       READ(10,FOMA) (ACC(I),I=1,NN)
c
  351 FORMAT(A80)
  352 FORMAT(A15)  
      CLOSE(10)
C
	AcMAX = 0.
	J=1
      DO 6 I=1,NN
	     IF (I.GT.CN) GOTO 5
	GOTO 6
    5 AAC(J)=ACC(I) * COEF	
c
	  if( abs(AAC(J)) . GT . AcMAX ) THEN
	    AcMAX = abs(AAC(J))
	    MAXI = J
	   End if 
	 J = J+1
c     
    6 CONTINUE
C
C     OUTPUT FILE NAME
C
      OPEN(11,FILE=BNAM)
	 write(11,340) BNAM, N
	 write(11,342) AcMax, MAXI*0.01  
      WRITE(11,FOMA2) (AAC(I),I=1,N)
  340 FORMAT(1X, A12 , ' store= ', I6 )
  342	FORMAT(1X, 'Max=', F8.3, '  time=', F6.2)
      CLOSE(11)
C
C
      STOP
      END