PROGRAM compress c Compresses the residue numbers for solvents by combining them c into 'residues' of 10 atoms. CHARACTER*65 line WRITE (6, 1001) 'Enter input file name:' 1001 FORMAT (A) READ (5, 1001) line OPEN (unit=1, form='FORMATTED', status='OLD', 1 file=line) WRITE (6, 1001) 'Enter output file name:' READ (5, 1001) line OPEN (unit=2, form='FORMATTED', status='UNKNOWN', 1 file=line) c Main loop DO WHILE (.TRUE.) READ (1, 1001, end=9) line c Check for water IF (line(4:6) .EQ. 'WAT') THEN c Be sure not already compressed IF (line(13:13) .EQ. ' ') THEN READ (line(9:11), 1002) nres 1002 FORMAT (i3) iat = MOD(nres,10) nres = nres-iat+10 WRITE (line(8:10), 1002) nres WRITE (line(13:13), 1003) iat 1003 FORMAT (i1) ELSE WRITE (6, 1001) ' Solvents already compressed' CLOSE (unit=1) CLOSE (unit=2, disp='DELETE') stop endIF endIF WRITE (2, 1001) line endDO 9 CLOSE (unit=1) CLOSE (unit=2) end