PROGRAM HEURISTIC5 C This program reads in a 2-column file putting the values into C arrays A and B. C The first value from array B is subtracted off all the other values C of B, then stored in array C. Array C is then written to disk, keeping C the original array A as the first column. C .......................... PARAMETER (NMAX=2000) REAL A(NMAX), B(NMAX), C(NMAX) REAL B0 CHARACTER*50 INPUTFILE, OUTPUTFILE C .......................... WRITE(*,'(A,$)') 'Enter the name of the INPUT file : ' READ (*,'(A)') INPUTFILE WRITE(*,'(A,$)') 'Enter the name of the OUTPUT FILE: ' READ (*,'(A)') OUTPUTFILE IERR = 0 NDATA = NMAX CALL GET_DATA (INPUTFILE, ndata, a, b, ierr) B0 = B(1) DO I=1, NDATA C(I) = B(I) - B0 END DO IERR = 0 CALL WRITE_DATA( OUTPUTFILE, NDATA, A, C, IERR) C .......................... STOP 'HEURISTIC5 finished.' END C----------------------------------------------------------------- C Notice the format of the write statement. The syntax '(A)' is used C to read/write a character variable string of unknown length. C The '(A,$)' contains a special symbol, the '$', to tell the output C not to carriage-return. It makes for nicer looking I/O.