CHARMM Development Project
Posted By: rmv fix atom names for xyz trajectory - 12/17/20 09:27 PM
There is an issue with the XYZ format output for trajectories, in that it only writes the first character of the atom name. The snippet below from source/dynamc/dynio.F90 (or dynio.src for c43b2 and before) is the current code:

Code
  DO I=1,NATOM
     IF(MXYZ == 1) &
          WRITE(IUN,'(A1,1X,3E25.15)') ATYPE(I)(1:1),X(I),Y(I),Z(I)
     IF(MXYZ == 2) &
          WRITE(IUN,'(A1,1X,6E25.15)') ATYPE(I)(1:1),X(I),Y(I),Z(I), &
          VX(I),VY(I),VZ(I)
     IF(MXYZ == 3) &
          WRITE(IUN,'(A1,1X,9E25.15)') ATYPE(I)(1:1),X(I),Y(I),Z(I), &
          VX(I),VY(I),VZ(I),DX(I),DY(I),DZ(I)
     IF(MXYZ == 4) &
          WRITE(IUN,'(A1,1X,6E25.15)') ATYPE(I)(1:1),X(I),Y(I),Z(I), &
          DX(I),DY(I),DZ(I)
  ENDDO

Changing the array indices and format string in the four WRITE statements as shown below will write the full atom names for all output types.

Code
  DO I=1,NATOM
     IF(MXYZ == 1) &
          WRITE(IUN,'(A8,1X,3E25.15)') ATYPE(I)(1:8),X(I),Y(I),Z(I)
     IF(MXYZ == 2) &
          WRITE(IUN,'(A8,1X,6E25.15)') ATYPE(I)(1:8),X(I),Y(I),Z(I), &
          VX(I),VY(I),VZ(I)
     IF(MXYZ == 3) &
          WRITE(IUN,'(A8,1X,9E25.15)') ATYPE(I)(1:8),X(I),Y(I),Z(I), &
          VX(I),VY(I),VZ(I),DX(I),DY(I),DZ(I)
     IF(MXYZ == 4) &
          WRITE(IUN,'(A8,1X,6E25.15)') ATYPE(I)(1:8),X(I),Y(I),Z(I), &
          DX(I),DY(I),DZ(I)
  ENDDO
© CHARMM forums