PROGRAM rotdiam c Apply transformation crystallographic two-fold around y-axis c to Diamond file. Relabel subunits. CHARACTER*132 line REAL x(3) WRITE (6, 1000) 'Enter filename for input file:' 1000 FORMAT (a) READ (5, 1000) line OPEN (unit=1, status='OLD', file=line, readonly, form='FORMATTED') WRITE (6, 1000) 'Enter filename for output file:' READ (5, 1000) line OPEN (unit=2, status='UNKNOWN', form='FORMATTED', file=line, 1 carriagecontrol='LIST') DO i = 1,3 READ (1, 1000) line ll = length(line) WRITE (2, 1000) line(1:ll) endDO c Loop natom = 0 DO WHILE (.TRUE.) READ (1, 1000, end=99) line ll = length(line) READ (line(1:30), 1001) x 1001 FORMAT (3f10.4) x(1) = -x(1) x(3) = -x(3) WRITE (line(1:30), 1001) x line(72:72) = CHAR(ICHAR(line(72:72))+6) WRITE (2, 1000) line(1:ll) endDO 99 CLOSE (unit=1) CLOSE (unit=2) end INTEGER FUNCTION length(line) CHARACTER*132 line DO i = 132,1,-1 IF (line(i:i) .NE. ' ') goto 9 endDO 9 length = i return end