PROGRAM newnum2 c Renumbers solvent in WH file. If compressed input, then compressed c output. Uses file for solvent mapping. CHARACTER*65 line, filin, filout, filnam INTEGER newsol(601:999)/399*0/ c Get file names WRITE (6, 1000) 'Enter filename for input WH file:' 1000 FORMAT (a) READ (5, 1000) filin OPEN (unit=1, file=filin, status='OLD', readonly, form='FORMATTED') WRITE (6, 1000) 'Enter filename for output WH file:' READ (5, 1000) filout OPEN (unit=2, file=filout, status='UNKNOWN', form='FORMATTED', 1 carriagecontrol='LIST') WRITE (6, 1000) 'Enter filename for solvent mapping:' READ (5, 1000) filnam OPEN (unit=3, file=filnam, status='OLD', readonly, form='FORMATTED') c First read solvent mapping after initiallizing DO WHILE (.TRUE.) READ (3, 1001, end=10) i, newsol(i) 1001 FORMAT (2i5) endDO 10 CLOSE (unit=3) c Main loop DO WHILE (.TRUE.) READ (1, 1000, end=20) line c Handle compression if needed IF (line(4:6) .EQ. 'WAT') THEN IF (line(13:13) .NE. ' ') THEN READ (line(13:13), 1002) iat 1002 FORMAT (i1) READ (line(9:11), 1003) nres 1003 FORMAT (i3) nres = nres-10+iat IF (newsol(nres) .EQ. 0) THEN WRITE (6, 1000) 'Disallowed solvent:' WRITE (6, 1000) line endIF nres = newsol(nres) iat = MOD(nres,10) nres = nres-iat+10 WRITE (line(13:13), 1002) iat WRITE (line(9:11), 1003) nres ELSE READ (line(9:11), 1003) nres IF (newsol(nres) .EQ. 0) THEN WRITE (6, 1000) 'Disallowed solvent:' WRITE (6, 1000) line endIF nres = newsol(nres) WRITE (line(9:11), 1003) nres endIF endIF WRITE (2, 1000) line endDO 20 CLOSE (unit=1) CLOSE (unit=2) end