Re: xsc file format

From: Luca Muccioli (
Date: Mon Dec 22 2008 - 05:22:16 CST

dear Kyriakos,

  in the most general case you have nine figures for the simulation cell in the
xst/xsc file, e.g.

# NAMD extended system configuration restart file
#$LABELS step a_x a_y a_z b_x b_y b_z c_x c_y c_z o_x o_y o_z
20000000 45.8525 0 0 0.144183 41.6781 0 0.362906 0.23746 43.5339 0 0 0
          1 2 3 4 5 6 7 8 9

they represent the cell axes (a,b,c), and they are the columns of the matrix
called CO in the fortran routines below. I adapted them, maybe they need some changes to

to compute the distances, you need also the inverse of the CO matrix=OC, and do
like this:





Luca Muccioli, Ph. D.
Dipartimento di Chimica Fisica e Inorganica, INSTM
Universita` di Bologna
Via Risorgimento 4
40136 Bologna (Italia)

Phone: +39-051-6446992
Fax: +39-051-2093690

  function HMatrix(sides,angles) result(CO)
     real(rk),intent(in):: sides(3),angles(3)
     real(rk):: CO(3,3)
     real(rk):: ax,bx,by,cx,cy,cz,cang(3),qt







   end function HMatrix

  function BoxSides(co,alpha,beta,gamma) result(v)
     IMPLICIT none
     integer, intent(in) :: cfg
     real(rk):: CO(3,3)
     real(rk) :: V(3)
     real(rk),intent(out),optional:: alpha,beta,gamma

     real(rk):: ax,bx,cx,by,cy,cz,qt

     ax = CO(1,1)
     bx = CO(1,2)
     cx = CO(1,3)
     by = CO(2,2)
     cy = CO(2,3)
     cz = CO(3,3)

     v(1) = ax
     v(2) = sqrt(bx**2+by**2)
     v(3) = sqrt(cx**2+cy**2+cz**2)

     if (present(alpha).and.present(beta).and.present(gamma)) then
        gamma = bx/v(2)
        beta = cx/v(3)
        qt = by/v(2)
        alpha = cy*qt/v(3)+beta*gamma

        alpha = rad_to_deg*acos(alpha)
        beta = rad_to_deg*acos(beta)
        gamma = rad_to_deg*acos(gamma)

   end function BoxSides

On Mon, 22 Dec 2008, Kyriakos Kachrimanis wrote:

> Date: Mon, 22 Dec 2008 11:24:46 +0200
> From: Kyriakos Kachrimanis <>
> To:
> Subject: namd-l: xsc file format
> Dear NAMD users,
> I am new to NAMD and I would like to simulate an organic crystal and I could not find a detailed description of the .xsc file format. Could someone please provide an example of an xsc file for a crystalline system? How are the unit cell axes lengths and angles defined?
> Thanks in advance.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:50:17 CST