1C> \ingroup nwint
2C> @{
3C>
4C> \brief Generate periodic images of atomic centers
5C>
6C> See [1] for details.
7C>
8C> [1] JE Jaffe, AC Hess,
9C>     <i>"Gaussian basis density functional theory for systems
10C>     periodic in two or three dimensions: Energy and forces"</i>,
11C>    J.Chem.Phys. <b>105</b>, 10983-10998 (1996), DOI:
12C>    <a href="https://doi.org/10.1063/1.472866">
13C>    10.1063/1.472866</a>
14C>
15      subroutine intp_txyz(n_cent, n_geom, R, xyz_new)
16c $Id$
17      implicit none
18#include "nwc_const.fh"
19#include "geomP.fh"
20c::external subroutines used
21c... dgemv
22c::passed
23      integer n_cent               !< [Input] center to be translated
24      integer n_geom               !< [Input] geometry handle to use
25      double precision R(3)        !< [Input] fractional translation vector
26      double precision xyz_new(3)  !< [Output] new coordinates based on R translations
27c::local
28      double precision xyz_frac(3) !< fractional coordinates
29      integer ixyz
30c
31c.. zero local arrays
32      call dcopy(3,0.0d00,0,xyz_new,1)
33      call dcopy(3,0.0d00,0,xyz_frac,1)
34c
35c... compute n center fractional coordinates
36c....    xyz_frac = amatrix_inv*coords(*,n_cent,n_geom)
37c
38      call dgemv('n',3,3,1.0d00,amatrix_inv(1,1,n_geom),3,
39     &    coords(1,n_cent,n_geom),1,
40     &    0.0d00,xyz_frac,1)
41c
42c... compute j translated fractional coordinates
43c.........  xyz_frac = xyz_frac + R
44c
45      do 00100 ixyz=1,3
46          xyz_frac(ixyz) = xyz_frac(ixyz) + R(ixyz)
4700100 continue
48c
49c... computer j translated cart. coordinates.
50c........ xyz_new = amatrix*xyz_frac
51c
52      call dgemv('n',3,3,1.0d00,amatrix(1,1,n_geom),3,
53     &    xyz_frac,1,
54     &    0.0d00,xyz_new,1)
55c
56      end
57C> @}
58